Class: AWSCDK::CustomResourceProviderProps

Inherits:
CustomResourceProviderOptions
  • Object
show all
Defined in:
custom_resource_provider_props.rb

Overview

Initialization properties for CustomResourceProvider.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, environment: nil, memory_size: nil, policy_statements: nil, timeout: nil, use_cfn_response_wrapper: nil, code_directory:, runtime:) ⇒ CustomResourceProviderProps

Returns a new instance of CustomResourceProviderProps.

Parameters:

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

    A description of the function.

  • environment (Hash{String => String}, nil) (defaults to: nil)

    Key-value pairs that are passed to Lambda as Environment.

  • memory_size (AWSCDK::Size, nil) (defaults to: nil)

    The amount of memory that your function has access to.

  • policy_statements (Array<Object>, nil) (defaults to: nil)

    A set of IAM policy statements to include in the inline policy of the provider's lambda function.

  • timeout (AWSCDK::Duration, nil) (defaults to: nil)

    AWS Lambda timeout for the provider.

  • use_cfn_response_wrapper (Boolean, nil) (defaults to: nil)

    Whether or not the cloudformation response wrapper (nodejs-entrypoint.ts) is used. If set to true, nodejs-entrypoint.js is bundled in the same asset as the custom resource and set as the entrypoint. If set to false, the custom resource provided is the entrypoint.

  • code_directory (String)

    A local file system directory with the provider's code.

  • runtime (AWSCDK::CustomResourceProviderRuntime)

    The AWS Lambda runtime and version to use for the provider.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'custom_resource_provider_props.rb', line 15

def initialize(description: nil, environment: nil, memory_size: nil, policy_statements: nil, timeout: nil, use_cfn_response_wrapper: nil, code_directory:, runtime:)
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @environment = environment
  Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil?
  @memory_size = memory_size
  Jsii::Type.check_type(@memory_size, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "memorySize") unless @memory_size.nil?
  @policy_statements = policy_statements
  Jsii::Type.check_type(@policy_statements, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoiYXJyYXkifX0=")), "policyStatements") unless @policy_statements.nil?
  @timeout = timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil?
  @use_cfn_response_wrapper = use_cfn_response_wrapper
  Jsii::Type.check_type(@use_cfn_response_wrapper, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "useCfnResponseWrapper") unless @use_cfn_response_wrapper.nil?
  @code_directory = code_directory
  Jsii::Type.check_type(@code_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "codeDirectory")
  @runtime = runtime
  Jsii::Type.check_type(@runtime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DdXN0b21SZXNvdXJjZVByb3ZpZGVyUnVudGltZSJ9")), "runtime")
end

Instance Attribute Details

#code_directoryString (readonly)

A local file system directory with the provider's code.

The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.

Returns:

  • (String)


89
90
91
# File 'custom_resource_provider_props.rb', line 89

def code_directory
  @code_directory
end

#descriptionString? (readonly)

Note:

Default: - No description.

A description of the function.

Returns:

  • (String, nil)


38
39
40
# File 'custom_resource_provider_props.rb', line 38

def description
  @description
end

#environmentHash{String => String}? (readonly)

Note:

Default: - No environment variables.

Key-value pairs that are passed to Lambda as Environment.

Returns:

  • (Hash{String => String}, nil)


43
44
45
# File 'custom_resource_provider_props.rb', line 43

def environment
  @environment
end

#memory_sizeAWSCDK::Size? (readonly)

Note:

Default: Size.mebibytes(128)

The amount of memory that your function has access to.

Increasing the function's memory also increases its CPU allocation.

Returns:



51
52
53
# File 'custom_resource_provider_props.rb', line 51

def memory_size
  @memory_size
end

#policy_statementsArray<Object>? (readonly)

Note:

Default: - no additional inline policy

A set of IAM policy statements to include in the inline policy of the provider's lambda function.

Please note: these are direct IAM JSON policy blobs, not iam.PolicyStatement objects like you will see in the rest of the CDK.

Examples:

# Example automatically generated from non-compiling source. May contain errors.
provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType", {
    code_directory: "#{__dirname}/my-handler",
    runtime: CustomResourceProviderRuntime::NODEJS_18_X,
    policy_statements: [
        {
            Effect: "Allow",
            Action: "s3:PutObject*",
            Resource: "*",
        },
    ],
})

Returns:

  • (Array<Object>, nil)


72
73
74
# File 'custom_resource_provider_props.rb', line 72

def policy_statements
  @policy_statements
end

#runtimeAWSCDK::CustomResourceProviderRuntime (readonly)

The AWS Lambda runtime and version to use for the provider.



93
94
95
# File 'custom_resource_provider_props.rb', line 93

def runtime
  @runtime
end

#timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.minutes(15)

AWS Lambda timeout for the provider.

Returns:



77
78
79
# File 'custom_resource_provider_props.rb', line 77

def timeout
  @timeout
end

#use_cfn_response_wrapperBoolean? (readonly)

Note:

Default: - true if inlineCode: false and false otherwise.

Whether or not the cloudformation response wrapper (nodejs-entrypoint.ts) is used. If set to true, nodejs-entrypoint.js is bundled in the same asset as the custom resource and set as the entrypoint. If set to false, the custom resource provided is the entrypoint.

Returns:

  • (Boolean, nil)


82
83
84
# File 'custom_resource_provider_props.rb', line 82

def use_cfn_response_wrapper
  @use_cfn_response_wrapper
end

Class Method Details

.jsii_propertiesObject



95
96
97
98
99
100
101
102
103
104
105
106
# File 'custom_resource_provider_props.rb', line 95

def self.jsii_properties
  {
    :description => "description",
    :environment => "environment",
    :memory_size => "memorySize",
    :policy_statements => "policyStatements",
    :timeout => "timeout",
    :use_cfn_response_wrapper => "useCfnResponseWrapper",
    :code_directory => "codeDirectory",
    :runtime => "runtime",
  }
end

Instance Method Details

#to_jsiiObject



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'custom_resource_provider_props.rb', line 108

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "description" => @description,
    "environment" => @environment,
    "memorySize" => @memory_size,
    "policyStatements" => @policy_statements,
    "timeout" => @timeout,
    "useCfnResponseWrapper" => @use_cfn_response_wrapper,
    "codeDirectory" => @code_directory,
    "runtime" => @runtime,
  })
  result.compact
end