Class: AWSCDK::ResourceGroups::CfnGroupProps

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

Overview

Properties for defining a CfnGroup.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, configuration: nil, description: nil, resource_query: nil, resources: nil, tags: nil) ⇒ CfnGroupProps

Returns a new instance of CfnGroupProps.

Parameters:

  • name (String)

    The name of a resource group.

  • configuration (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::ResourceGroups::CfnGroup::ConfigurationItemProperty>, nil) (defaults to: nil)

    The service configuration currently associated with the resource group and in effect for the members of the resource group.

  • description (String, nil) (defaults to: nil)

    The description of the resource group.

  • resource_query (AWSCDK::IResolvable, AWSCDK::ResourceGroups::CfnGroup::ResourceQueryProperty, nil) (defaults to: nil)

    The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.

  • resources (Array<String>, nil) (defaults to: nil)

    A list of the Amazon Resource Names (ARNs) of AWS resources that you want to add to the specified group.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    The tag key and value pairs that are attached to the resource group.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'resource_groups/cfn_group_props.rb', line 15

def initialize(name:, configuration: nil, description: nil, resource_query: nil, resources: nil, tags: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @configuration = configuration
  Jsii::Type.check_type(@configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmVzb3VyY2Vncm91cHMuQ2ZuR3JvdXAuQ29uZmlndXJhdGlvbkl0ZW1Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "configuration") unless @configuration.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @resource_query = resource_query.is_a?(Hash) ? ::AWSCDK::ResourceGroups::CfnGroup::ResourceQueryProperty.new(**resource_query.transform_keys(&:to_sym)) : resource_query
  Jsii::Type.check_type(@resource_query, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19yZXNvdXJjZWdyb3Vwcy5DZm5Hcm91cC5SZXNvdXJjZVF1ZXJ5UHJvcGVydHkifV19fQ==")), "resourceQuery") unless @resource_query.nil?
  @resources = resources
  Jsii::Type.check_type(@resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resources") unless @resources.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

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

The service configuration currently associated with the resource group and in effect for the members of the resource group.

A Configuration consists of one or more ConfigurationItem entries. For information about service configurations for resource groups and how to construct them, see Service configurations for resource groups in the Resource Groups User Guide .

You can include either a Configuration or a ResourceQuery , but not both.



45
46
47
# File 'resource_groups/cfn_group_props.rb', line 45

def configuration
  @configuration
end

#descriptionString? (readonly)

The description of the resource group.



50
51
52
# File 'resource_groups/cfn_group_props.rb', line 50

def description
  @description
end

#nameString (readonly)

The name of a resource group.

The name must be unique within the AWS Region in which you create the resource. To create multiple resource groups based on the same CloudFormation stack, you must generate unique names for each.



36
37
38
# File 'resource_groups/cfn_group_props.rb', line 36

def name
  @name
end

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

The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.

For more information about queries and how to construct them, see Build queries and groups in Resource Groups in the Resource Groups User Guide

  • You can include either a ResourceQuery or a Configuration , but not both.
  • You can specify the group's membership either by using a ResourceQuery or by using a list of Resources , but not both.


60
61
62
# File 'resource_groups/cfn_group_props.rb', line 60

def resource_query
  @resource_query
end

#resourcesArray<String>? (readonly)

A list of the Amazon Resource Names (ARNs) of AWS resources that you want to add to the specified group.

  • You can specify the group membership either by using a list of Resources or by using a ResourceQuery , but not both.
  • You can include a Resources property only if you also specify a Configuration property.


68
69
70
# File 'resource_groups/cfn_group_props.rb', line 68

def resources
  @resources
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

The tag key and value pairs that are attached to the resource group.



73
74
75
# File 'resource_groups/cfn_group_props.rb', line 73

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



75
76
77
78
79
80
81
82
83
84
# File 'resource_groups/cfn_group_props.rb', line 75

def self.jsii_properties
  {
    :name => "name",
    :configuration => "configuration",
    :description => "description",
    :resource_query => "resourceQuery",
    :resources => "resources",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



86
87
88
89
90
91
92
93
94
95
96
97
# File 'resource_groups/cfn_group_props.rb', line 86

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "configuration" => @configuration,
    "description" => @description,
    "resourceQuery" => @resource_query,
    "resources" => @resources,
    "tags" => @tags,
  })
  result.compact
end