From b7ba600b769a83a3934eed0865a39ba8c2f10dac Mon Sep 17 00:00:00 2001 From: alpineriveredge Date: Sun, 28 Aug 2022 13:01:53 +0900 Subject: [PATCH] Allow Tags of CloudFormation Stack --- doc/_resource_types/cloudformation_stack.md | 8 ++++++++ doc/resource_types.md | 9 +++++++++ lib/awspec/type/cloudformation_stack.rb | 3 +++ 3 files changed, 20 insertions(+) diff --git a/doc/_resource_types/cloudformation_stack.md b/doc/_resource_types/cloudformation_stack.md index 4530b6e1c..4b6711c58 100644 --- a/doc/_resource_types/cloudformation_stack.md +++ b/doc/_resource_types/cloudformation_stack.md @@ -6,3 +6,11 @@ describe cloudformation_stack('my-cloudformation-stack') do its(:stack_status) { should eq 'UPDATE_COMPLETE' } end ``` + +### have_tag + +```ruby +describe cloudformation_stack('my-cloudformation-stack') do + it { should have_tag('env').value('dev') } +end +``` diff --git a/doc/resource_types.md b/doc/resource_types.md index 068b6719e..98daaaf8d 100644 --- a/doc/resource_types.md +++ b/doc/resource_types.md @@ -457,6 +457,15 @@ describe cloudformation_stack('my-cloudformation-stack') do end ``` + +### have_tag + +```ruby +describe cloudformation_stack('my-cloudformation-stack') do + it { should have_tag('env').value('dev') } +end +``` + ### its(:stack_id), its(:stack_name), its(:change_set_id), its(:description), its(:parameters), its(:creation_time), its(:deletion_time), its(:last_updated_time), its(:rollback_configuration), its(:stack_status), its(:stack_status_reason), its(:disable_rollback), its(:notification_arns), its(:timeout_in_minutes), its(:capabilities), its(:role_arn), its(:enable_termination_protection), its(:parent_id), its(:root_id), its(:drift_information) ## cloudfront_distribution diff --git a/lib/awspec/type/cloudformation_stack.rb b/lib/awspec/type/cloudformation_stack.rb index 76c4c2e1e..f41320db1 100644 --- a/lib/awspec/type/cloudformation_stack.rb +++ b/lib/awspec/type/cloudformation_stack.rb @@ -2,6 +2,9 @@ module Awspec::Type class CloudformationStack < ResourceBase + aws_resource Aws::CloudFormation::Stack + tags_allowed + def resource_via_client @resource_via_client ||= find_cloudformation_stack(@display_name) end