Class: AWSCDK::CloudFront::Experimental::EdgeFunction
- Inherits:
-
Resource
- Object
- Resource
- AWSCDK::CloudFront::Experimental::EdgeFunction
- Includes:
- Lambda::IVersion
- Defined in:
- cloud_front/experimental/edge_function.rb
Overview
A Lambda@Edge function.
Convenience resource for requesting a Lambda function in the 'us-east-1' region for use with Lambda@Edge. Implements several restrictions enforced by Lambda@Edge.
Note that this construct requires that the 'us-east-1' region has been bootstrapped. See https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html or 'cdk bootstrap --help' for options.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
Instance Method Summary collapse
-
#add_alias(alias_name, options = nil) ⇒ AWSCDK::Lambda::Alias
Defines an alias for this version.
-
#add_event_source(source) ⇒ void
Adds an event source to this function.
-
#add_event_source_mapping(id, options) ⇒ AWSCDK::Lambda::EventSourceMapping
Adds an event source that maps to this AWS Lambda function.
-
#add_function_url(options = nil) ⇒ AWSCDK::Lambda::FunctionURL
Adds a url to this lambda function.
-
#add_permission(id, permission) ⇒ void
Adds a permission to the Lambda resource policy.
-
#add_to_role_policy(statement) ⇒ void
Adds a statement to the IAM role assumed by the instance.
-
#apply_cross_stack_reference_strength(strength) ⇒ void
Override the cross-stack reference strength for this resource.
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#architecture ⇒ AWSCDK::Lambda::Architecture
The system architectures compatible with this lambda function.
-
#configure_async_invoke(options) ⇒ void
Configures options for asynchronous invocation.
-
#connections ⇒ AWSCDK::EC2::Connections
Not supported.
-
#current_version ⇒ AWSCDK::Lambda::IVersion
Convenience method to make
EdgeFunctionconform to the same interface asFunction. -
#edge_arn ⇒ String
The ARN of the version for Lambda@Edge.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#function_arn ⇒ String
The ARN of the function.
-
#function_name ⇒ String
The name of the function.
-
#function_ref ⇒ AWSCDK::Interfaces::AWSLambda::FunctionReference
A reference to a Function resource.
- #generate_physical_name ⇒ String
-
#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String
Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g.
bucket.bucketArn). -
#get_resource_name_attribute(name_attr) ⇒ String
Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g.
bucket.bucketName). -
#grant_invoke(identity) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
-
#grant_invoke_composite_principal(composite_principal) ⇒ Array<AWSCDK::IAM::Grant>
[disable-awslint:no-grants].
-
#grant_invoke_latest_version(identity) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
-
#grant_invoke_url(identity) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
-
#grant_invoke_version(identity, version) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
-
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
The principal to grant permissions to.
-
#initialize(scope, id, props) ⇒ EdgeFunction
constructor
A new instance of EdgeFunction.
-
#is_bound_to_vpc ⇒ Boolean
Whether or not this Lambda function was bound to a VPC.
-
#lambda ⇒ AWSCDK::Lambda::IFunction
The underlying AWS Lambda function.
-
#latest_version ⇒ AWSCDK::Lambda::IVersion
The
$LATESTversion of this function. -
#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric
Return the given named metric for this Lambda Return the given named metric for this Function.
-
#metric_duration(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the Duration of this Lambda How long execution of this Lambda takes.
-
#metric_errors(props = nil) ⇒ AWSCDK::CloudWatch::Metric
How many invocations of this Lambda fail.
-
#metric_invocations(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of invocations of this Lambda How often this Lambda is invoked.
-
#metric_throttles(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.
-
#node ⇒ Constructs::Node
The tree node.
-
#permissions_node ⇒ Constructs::Node
The construct node where permissions are attached.
-
#physical_name ⇒ String
Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
-
#resource_arns_for_grant_invoke ⇒ Array<String>
The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().
-
#role ⇒ AWSCDK::IAM::IRole?
The IAM role associated with this function.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#version ⇒ String
The most recently deployed version of this function.
-
#version_ref ⇒ AWSCDK::Interfaces::AWSLambda::VersionReference
A reference to a Version resource.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ EdgeFunction
Returns a new instance of EdgeFunction.
18 19 20 21 22 23 24 |
# File 'cloud_front/experimental/edge_function.rb', line 18 def initialize(scope, id, props) props = props.is_a?(Hash) ? ::AWSCDK::CloudFront::Experimental::EdgeFunctionProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5leHBlcmltZW50YWwuRWRnZUZ1bmN0aW9uUHJvcHMifQ==")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'cloud_front/experimental/edge_function.rb', line 26 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :env => { kind: :property, name: "env", is_optional: false }, :physical_name => { kind: :property, name: "physicalName", is_optional: false }, :stack => { kind: :property, name: "stack", is_optional: false }, :architecture => { kind: :property, name: "architecture", is_optional: false }, :connections => { kind: :property, name: "connections", is_optional: false }, :current_version => { kind: :property, name: "currentVersion", is_optional: false }, :edge_arn => { kind: :property, name: "edgeArn", is_optional: false }, :function_arn => { kind: :property, name: "functionArn", is_optional: false }, :function_name => { kind: :property, name: "functionName", is_optional: false }, :function_ref => { kind: :property, name: "functionRef", is_optional: false }, :grant_principal => { kind: :property, name: "grantPrincipal", is_optional: false }, :is_bound_to_vpc => { kind: :property, name: "isBoundToVpc", is_optional: false }, :lambda => { kind: :property, name: "lambda", is_optional: false }, :latest_version => { kind: :property, name: "latestVersion", is_optional: false }, :permissions_node => { kind: :property, name: "permissionsNode", is_optional: false }, :resource_arns_for_grant_invoke => { kind: :property, name: "resourceArnsForGrantInvoke", is_optional: false }, :version => { kind: :property, name: "version", is_optional: false }, :version_ref => { kind: :property, name: "versionRef", is_optional: false }, :role => { kind: :property, name: "role", is_optional: true }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false }, :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false }, :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false }, :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false }, :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false }, :add_alias => { kind: :method, name: "addAlias", is_optional: false }, :add_event_source => { kind: :method, name: "addEventSource", is_optional: false }, :add_event_source_mapping => { kind: :method, name: "addEventSourceMapping", is_optional: false }, :add_function_url => { kind: :method, name: "addFunctionUrl", is_optional: false }, :add_permission => { kind: :method, name: "addPermission", is_optional: false }, :add_to_role_policy => { kind: :method, name: "addToRolePolicy", is_optional: false }, :configure_async_invoke => { kind: :method, name: "configureAsyncInvoke", is_optional: false }, :grant_invoke => { kind: :method, name: "grantInvoke", is_optional: false }, :grant_invoke_composite_principal => { kind: :method, name: "grantInvokeCompositePrincipal", is_optional: false }, :grant_invoke_latest_version => { kind: :method, name: "grantInvokeLatestVersion", is_optional: false }, :grant_invoke_url => { kind: :method, name: "grantInvokeUrl", is_optional: false }, :grant_invoke_version => { kind: :method, name: "grantInvokeVersion", is_optional: false }, :metric => { kind: :method, name: "metric", is_optional: false }, :metric_duration => { kind: :method, name: "metricDuration", is_optional: false }, :metric_errors => { kind: :method, name: "metricErrors", is_optional: false }, :metric_invocations => { kind: :method, name: "metricInvocations", is_optional: false }, :metric_throttles => { kind: :method, name: "metricThrottles", is_optional: false }, } end |
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
121 122 123 |
# File 'cloud_front/experimental/edge_function.rb', line 121 def self.PROPERTY_INJECTION_ID() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction", "PROPERTY_INJECTION_ID") end |
Instance Method Details
#add_alias(alias_name, options = nil) ⇒ AWSCDK::Lambda::Alias
Defines an alias for this version.
346 347 348 349 350 351 |
# File 'cloud_front/experimental/edge_function.rb', line 346 def add_alias(alias_name, = nil) Jsii::Type.check_type(alias_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "aliasName") = .is_a?(Hash) ? ::AWSCDK::Lambda::AliasOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkFsaWFzT3B0aW9ucyJ9")), "options") unless .nil? jsii_call_method("addAlias", [alias_name, ]) end |
#add_event_source(source) ⇒ void
This method returns an undefined value.
Adds an event source to this function.
357 358 359 360 |
# File 'cloud_front/experimental/edge_function.rb', line 357 def add_event_source(source) Jsii::Type.check_type(source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklFdmVudFNvdXJjZSJ9")), "source") jsii_call_method("addEventSource", [source]) end |
#add_event_source_mapping(id, options) ⇒ AWSCDK::Lambda::EventSourceMapping
Adds an event source that maps to this AWS Lambda function.
367 368 369 370 371 372 |
# File 'cloud_front/experimental/edge_function.rb', line 367 def add_event_source_mapping(id, ) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") = .is_a?(Hash) ? ::AWSCDK::Lambda::EventSourceMappingOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkV2ZW50U291cmNlTWFwcGluZ09wdGlvbnMifQ==")), "options") jsii_call_method("addEventSourceMapping", [id, ]) end |
#add_function_url(options = nil) ⇒ AWSCDK::Lambda::FunctionURL
Adds a url to this lambda function.
378 379 380 381 382 |
# File 'cloud_front/experimental/edge_function.rb', line 378 def add_function_url( = nil) = .is_a?(Hash) ? ::AWSCDK::Lambda::FunctionURLOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkZ1bmN0aW9uVXJsT3B0aW9ucyJ9")), "options") unless .nil? jsii_call_method("addFunctionUrl", []) end |
#add_permission(id, permission) ⇒ void
This method returns an undefined value.
Adds a permission to the Lambda resource policy.
389 390 391 392 393 394 |
# File 'cloud_front/experimental/edge_function.rb', line 389 def (id, ) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") = .is_a?(Hash) ? ::AWSCDK::Lambda::Permission.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLlBlcm1pc3Npb24ifQ==")), "permission") jsii_call_method("addPermission", [id, ]) end |
#add_to_role_policy(statement) ⇒ void
This method returns an undefined value.
Adds a statement to the IAM role assumed by the instance.
400 401 402 403 |
# File 'cloud_front/experimental/edge_function.rb', line 400 def add_to_role_policy(statement) Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement") jsii_call_method("addToRolePolicy", [statement]) end |
#apply_cross_stack_reference_strength(strength) ⇒ void
This method returns an undefined value.
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified
mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferences context key. This is useful for
selectively weakening specific references to avoid the "deadly embrace" problem
without changing the app-wide default.
284 285 286 287 |
# File 'cloud_front/experimental/edge_function.rb', line 284 def apply_cross_stack_reference_strength(strength) Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength") jsii_call_method("applyCrossStackReferenceStrength", [strength]) end |
#apply_removal_policy(policy) ⇒ void
This method returns an undefined value.
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
301 302 303 304 |
# File 'cloud_front/experimental/edge_function.rb', line 301 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#architecture ⇒ AWSCDK::Lambda::Architecture
The system architectures compatible with this lambda function.
128 129 130 |
# File 'cloud_front/experimental/edge_function.rb', line 128 def architecture() jsii_get_property("architecture") end |
#configure_async_invoke(options) ⇒ void
This method returns an undefined value.
Configures options for asynchronous invocation.
409 410 411 412 413 |
# File 'cloud_front/experimental/edge_function.rb', line 409 def configure_async_invoke() = .is_a?(Hash) ? ::AWSCDK::Lambda::EventInvokeConfigOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkV2ZW50SW52b2tlQ29uZmlnT3B0aW9ucyJ9")), "options") jsii_call_method("configureAsyncInvoke", []) end |
#connections ⇒ AWSCDK::EC2::Connections
Not supported.
Connections are only applicable to VPC-enabled functions.
137 138 139 |
# File 'cloud_front/experimental/edge_function.rb', line 137 def connections() jsii_get_property("connections") end |
#current_version ⇒ AWSCDK::Lambda::IVersion
Convenience method to make EdgeFunction conform to the same interface as Function.
144 145 146 |
# File 'cloud_front/experimental/edge_function.rb', line 144 def current_version() jsii_get_property("currentVersion") end |
#edge_arn ⇒ String
The ARN of the version for Lambda@Edge.
151 152 153 |
# File 'cloud_front/experimental/edge_function.rb', line 151 def edge_arn() jsii_get_property("edgeArn") end |
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
93 94 95 |
# File 'cloud_front/experimental/edge_function.rb', line 93 def env() jsii_get_property("env") end |
#function_arn ⇒ String
The ARN of the function.
158 159 160 |
# File 'cloud_front/experimental/edge_function.rb', line 158 def function_arn() jsii_get_property("functionArn") end |
#function_name ⇒ String
The name of the function.
165 166 167 |
# File 'cloud_front/experimental/edge_function.rb', line 165 def function_name() jsii_get_property("functionName") end |
#function_ref ⇒ AWSCDK::Interfaces::AWSLambda::FunctionReference
A reference to a Function resource.
172 173 174 |
# File 'cloud_front/experimental/edge_function.rb', line 172 def function_ref() jsii_get_property("functionRef") end |
#generate_physical_name ⇒ String
307 308 309 |
# File 'cloud_front/experimental/edge_function.rb', line 307 def generate_physical_name() jsii_call_method("generatePhysicalName", []) end |
#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String
Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).
Normally, this token will resolve to arn_attr, but if the resource is
referenced across environments, arn_components will be used to synthesize
a concrete ARN with the resource's physical name. Make sure to reference
this.physicalName in arn_components.
321 322 323 324 325 326 |
# File 'cloud_front/experimental/edge_function.rb', line 321 def get_resource_arn_attribute(arn_attr, arn_components) Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr") arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents") jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components]) end |
#get_resource_name_attribute(name_attr) ⇒ String
Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).
Normally, this token will resolve to name_attr, but if the resource is
referenced across environments, it will be resolved to this.physicalName,
which will be a concrete name.
336 337 338 339 |
# File 'cloud_front/experimental/edge_function.rb', line 336 def get_resource_name_attribute(name_attr) Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr") jsii_call_method("getResourceNameAttribute", [name_attr]) end |
#grant_invoke(identity) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
419 420 421 422 |
# File 'cloud_front/experimental/edge_function.rb', line 419 def grant_invoke(identity) Jsii::Type.check_type(identity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "identity") jsii_call_method("grantInvoke", [identity]) end |
#grant_invoke_composite_principal(composite_principal) ⇒ Array<AWSCDK::IAM::Grant>
[disable-awslint:no-grants].
428 429 430 431 |
# File 'cloud_front/experimental/edge_function.rb', line 428 def grant_invoke_composite_principal(composite_principal) Jsii::Type.check_type(composite_principal, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLkNvbXBvc2l0ZVByaW5jaXBhbCJ9")), "compositePrincipal") jsii_call_method("grantInvokeCompositePrincipal", [composite_principal]) end |
#grant_invoke_latest_version(identity) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
437 438 439 440 |
# File 'cloud_front/experimental/edge_function.rb', line 437 def grant_invoke_latest_version(identity) Jsii::Type.check_type(identity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "identity") jsii_call_method("grantInvokeLatestVersion", [identity]) end |
#grant_invoke_url(identity) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
446 447 448 449 |
# File 'cloud_front/experimental/edge_function.rb', line 446 def grant_invoke_url(identity) Jsii::Type.check_type(identity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "identity") jsii_call_method("grantInvokeUrl", [identity]) end |
#grant_invoke_version(identity, version) ⇒ AWSCDK::IAM::Grant
[disable-awslint:no-grants].
456 457 458 459 460 |
# File 'cloud_front/experimental/edge_function.rb', line 456 def grant_invoke_version(identity, version) Jsii::Type.check_type(identity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "identity") Jsii::Type.check_type(version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklWZXJzaW9uIn0=")), "version") jsii_call_method("grantInvokeVersion", [identity, version]) end |
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
The principal to grant permissions to.
179 180 181 |
# File 'cloud_front/experimental/edge_function.rb', line 179 def grant_principal() jsii_get_property("grantPrincipal") end |
#is_bound_to_vpc ⇒ Boolean
Whether or not this Lambda function was bound to a VPC.
If this is false, trying to access the connections object will fail.
188 189 190 |
# File 'cloud_front/experimental/edge_function.rb', line 188 def is_bound_to_vpc() jsii_get_property("isBoundToVpc") end |
#lambda ⇒ AWSCDK::Lambda::IFunction
The underlying AWS Lambda function.
195 196 197 |
# File 'cloud_front/experimental/edge_function.rb', line 195 def lambda() jsii_get_property("lambda") end |
#latest_version ⇒ AWSCDK::Lambda::IVersion
The $LATEST version of this function.
Note that this is reference to a non-specific AWS Lambda version, which means the function this version refers to can return different results in different invocations.
To obtain a reference to an explicit version which references the current
function configuration, use lambdaFunction.currentVersion instead.
209 210 211 |
# File 'cloud_front/experimental/edge_function.rb', line 209 def latest_version() jsii_get_property("latestVersion") end |
#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric
Return the given named metric for this Lambda Return the given named metric for this Function.
467 468 469 470 471 472 |
# File 'cloud_front/experimental/edge_function.rb', line 467 def metric(metric_name, props = nil) Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metric", [metric_name, props]) end |
#metric_duration(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the Duration of this Lambda How long execution of this Lambda takes.
Average over 5 minutes
480 481 482 483 484 |
# File 'cloud_front/experimental/edge_function.rb', line 480 def metric_duration(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricDuration", [props]) end |
#metric_errors(props = nil) ⇒ AWSCDK::CloudWatch::Metric
How many invocations of this Lambda fail.
Sum over 5 minutes
492 493 494 495 496 |
# File 'cloud_front/experimental/edge_function.rb', line 492 def metric_errors(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricErrors", [props]) end |
#metric_invocations(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of invocations of this Lambda How often this Lambda is invoked.
Sum over 5 minutes
504 505 506 507 508 |
# File 'cloud_front/experimental/edge_function.rb', line 504 def metric_invocations(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricInvocations", [props]) end |
#metric_throttles(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.
Sum over 5 minutes
516 517 518 519 520 |
# File 'cloud_front/experimental/edge_function.rb', line 516 def metric_throttles(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricThrottles", [props]) end |
#node ⇒ Constructs::Node
The tree node.
78 79 80 |
# File 'cloud_front/experimental/edge_function.rb', line 78 def node() jsii_get_property("node") end |
#permissions_node ⇒ Constructs::Node
The construct node where permissions are attached.
216 217 218 |
# File 'cloud_front/experimental/edge_function.rb', line 216 def () jsii_get_property("permissionsNode") end |
#physical_name ⇒ String
Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
This value will resolve to one of the following:
- a concrete value (e.g.
"my-awesome-bucket") undefined, when a name should be generated by CloudFormation- a concrete name generated automatically during synthesis, in cross-environment scenarios.
107 108 109 |
# File 'cloud_front/experimental/edge_function.rb', line 107 def physical_name() jsii_get_property("physicalName") end |
#resource_arns_for_grant_invoke ⇒ Array<String>
The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().
This property is for cdk modules to consume only. You should not need to use this property. Instead, use grantInvoke() directly.
226 227 228 |
# File 'cloud_front/experimental/edge_function.rb', line 226 def resource_arns_for_grant_invoke() jsii_get_property("resourceArnsForGrantInvoke") end |
#role ⇒ AWSCDK::IAM::IRole?
The IAM role associated with this function.
247 248 249 |
# File 'cloud_front/experimental/edge_function.rb', line 247 def role() jsii_get_property("role") end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
114 115 116 |
# File 'cloud_front/experimental/edge_function.rb', line 114 def stack() jsii_get_property("stack") end |
#to_string ⇒ String
Returns a string representation of this construct.
254 255 256 |
# File 'cloud_front/experimental/edge_function.rb', line 254 def to_string() jsii_call_method("toString", []) end |
#version ⇒ String
The most recently deployed version of this function.
233 234 235 |
# File 'cloud_front/experimental/edge_function.rb', line 233 def version() jsii_get_property("version") end |
#version_ref ⇒ AWSCDK::Interfaces::AWSLambda::VersionReference
A reference to a Version resource.
240 241 242 |
# File 'cloud_front/experimental/edge_function.rb', line 240 def version_ref() jsii_get_property("versionRef") end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
267 268 269 270 271 272 |
# File 'cloud_front/experimental/edge_function.rb', line 267 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |