Class: AWSCDK::CfnResourceVersionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cfn_resource_version_props.rb

Overview

Properties for defining a CfnResourceVersion.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema_handler_package:, type_name:, execution_role_arn: nil, logging_config: nil) ⇒ CfnResourceVersionProps

Returns a new instance of CfnResourceVersionProps.

Parameters:

  • schema_handler_package (String)

    A URL to the S3 bucket for the resource project package that contains the necessary files for the resource you want to register.

  • type_name (String)

    The name of the resource being registered.

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

    The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume when invoking the resource.

  • logging_config (AWSCDK::IResolvable, AWSCDK::CfnResourceVersion::LoggingConfigProperty, nil) (defaults to: nil)

    Logging configuration information for a resource.



13
14
15
16
17
18
19
20
21
22
# File 'cfn_resource_version_props.rb', line 13

def initialize(schema_handler_package:, type_name:, execution_role_arn: nil, logging_config: nil)
  @schema_handler_package = schema_handler_package
  Jsii::Type.check_type(@schema_handler_package, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "schemaHandlerPackage")
  @type_name = type_name
  Jsii::Type.check_type(@type_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "typeName")
  @execution_role_arn = execution_role_arn
  Jsii::Type.check_type(@execution_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "executionRoleArn") unless @execution_role_arn.nil?
  @logging_config = logging_config.is_a?(Hash) ? ::AWSCDK::CfnResourceVersion::LoggingConfigProperty.new(**logging_config.transform_keys(&:to_sym)) : logging_config
  Jsii::Type.check_type(@logging_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLkNmblJlc291cmNlVmVyc2lvbi5Mb2dnaW5nQ29uZmlnUHJvcGVydHkifV19fQ==")), "loggingConfig") unless @logging_config.nil?
end

Instance Attribute Details

#execution_role_arnString? (readonly)

The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume when invoking the resource.

If your resource calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the resource type handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the resource type handler, thereby supplying your resource type with the appropriate credentials.



55
56
57
# File 'cfn_resource_version_props.rb', line 55

def execution_role_arn
  @execution_role_arn
end

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

Logging configuration information for a resource.



60
61
62
# File 'cfn_resource_version_props.rb', line 60

def logging_config
  @logging_config
end

#schema_handler_packageString (readonly)

A URL to the S3 bucket for the resource project package that contains the necessary files for the resource you want to register.

For information on generating a schema handler package, see Modeling resource types to use with CloudFormation in the CloudFormation Command Line Interface (CLI) User Guide .

To register the resource version, you must have s3:GetObject permissions to access the S3 objects.



32
33
34
# File 'cfn_resource_version_props.rb', line 32

def schema_handler_package
  @schema_handler_package
end

#type_nameString (readonly)

The name of the resource being registered.

We recommend that resource names adhere to the following pattern: company_or_organization :: service :: type .

The following organization namespaces are reserved and can't be used in your resource names:

  • Alexa
  • AMZN
  • Amazon
  • AWS
  • Custom
  • Dev


48
49
50
# File 'cfn_resource_version_props.rb', line 48

def type_name
  @type_name
end

Class Method Details

.jsii_propertiesObject



62
63
64
65
66
67
68
69
# File 'cfn_resource_version_props.rb', line 62

def self.jsii_properties
  {
    :schema_handler_package => "schemaHandlerPackage",
    :type_name => "typeName",
    :execution_role_arn => "executionRoleArn",
    :logging_config => "loggingConfig",
  }
end

Instance Method Details

#to_jsiiObject



71
72
73
74
75
76
77
78
79
80
# File 'cfn_resource_version_props.rb', line 71

def to_jsii
  result = {}
  result.merge!({
    "schemaHandlerPackage" => @schema_handler_package,
    "typeName" => @type_name,
    "executionRoleArn" => @execution_role_arn,
    "loggingConfig" => @logging_config,
  })
  result.compact
end