Class: AWSCDK::ResourceGroups::CfnGroup::ResourceQueryProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
resource_groups/cfn_group.rb

Overview

The query used to dynamically define the members of a group.

For more information about how to construct a query, see Build queries and groups in Resource Groups .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query: nil, type: nil) ⇒ ResourceQueryProperty

Returns a new instance of ResourceQueryProperty.

Parameters:



783
784
785
786
787
788
# File 'resource_groups/cfn_group.rb', line 783

def initialize(query: nil, type: nil)
  @query = query.is_a?(Hash) ? ::AWSCDK::ResourceGroups::CfnGroup::QueryProperty.new(**query.transform_keys(&:to_sym)) : query
  Jsii::Type.check_type(@query, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19yZXNvdXJjZWdyb3Vwcy5DZm5Hcm91cC5RdWVyeVByb3BlcnR5In1dfX0=")), "query") unless @query.nil?
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type") unless @type.nil?
end

Instance Attribute Details

#queryAWSCDK::IResolvable, ... (readonly)

The query that defines the membership of the group.

This is a structure with properties that depend on the Type .

The Query structure must be included in the following scenarios:

  • When the Type is TAG_FILTERS_1_0 , you must specify a Query structure that contains a TagFilters list of tags. Resources with tags that match those in the TagFilter list become members of the resource group.
  • When the Type is CLOUDFORMATION_STACK_1_0 then this field is required only when you must specify a CloudFormation stack other than the one you are defining. To do this, the Query structure must contain the StackIdentifier property. If you don't specify either a Query structure or a StackIdentifier within that Query , then it defaults to the CloudFormation stack that you're currently constructing.


801
802
803
# File 'resource_groups/cfn_group.rb', line 801

def query
  @query
end

#typeString? (readonly)

Specifies the type of resource query that determines this group's membership. There are two valid query types:.

  • TAG_FILTERS_1_0 indicates that the group is a tag-based group. To complete the group membership, you must include the TagFilters property to specify the tag filters to use in the query.
  • CLOUDFORMATION_STACK_1_0 , the default, indicates that the group is a CloudFormation stack-based group. Group membership is based on the CloudFormation stack. You must specify the StackIdentifier property in the query to define which stack to associate the group with, or leave it empty to default to the stack where the group is defined.


809
810
811
# File 'resource_groups/cfn_group.rb', line 809

def type
  @type
end

Class Method Details

.jsii_propertiesObject



811
812
813
814
815
816
# File 'resource_groups/cfn_group.rb', line 811

def self.jsii_properties
  {
    :query => "query",
    :type => "type",
  }
end

Instance Method Details

#to_jsiiObject



818
819
820
821
822
823
824
825
# File 'resource_groups/cfn_group.rb', line 818

def to_jsii
  result = {}
  result.merge!({
    "query" => @query,
    "type" => @type,
  })
  result.compact
end