Class: AWSCDK::CustomResources::AWSCustomResourcePolicy
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::CustomResources::AWSCustomResourcePolicy
- Defined in:
- custom_resources/aws_custom_resource_policy.rb
Overview
The IAM Policy that will be applied to the different calls.
Class Method Summary collapse
-
.ANY_RESOURCE ⇒ Array<String>
Use this constant to configure access to any resource.
-
.from_sdk_calls(options) ⇒ AWSCDK::CustomResources::AWSCustomResourcePolicy
Generate IAM Policy Statements from the configured SDK calls.
-
.from_statements(statements) ⇒ AWSCDK::CustomResources::AWSCustomResourcePolicy
Explicit IAM Policy Statements.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#initialize(*args) ⇒ AWSCustomResourcePolicy
constructor
A new instance of AWSCustomResourcePolicy.
-
#resources ⇒ Array<String>?
resources for auto-generated from SDK calls.
-
#statements ⇒ Array<AWSCDK::IAM::PolicyStatement>
statements for explicit policy.
Constructor Details
#initialize(*args) ⇒ AWSCustomResourcePolicy
Returns a new instance of AWSCustomResourcePolicy.
8 9 10 |
# File 'custom_resources/aws_custom_resource_policy.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.custom_resources.AwsCustomResourcePolicy does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.ANY_RESOURCE ⇒ Array<String>
Use this constant to configure access to any resource.
50 51 52 |
# File 'custom_resources/aws_custom_resource_policy.rb', line 50 def self.ANY_RESOURCE() Jsii::Kernel.instance.get_static("aws-cdk-lib.custom_resources.AwsCustomResourcePolicy", "ANY_RESOURCE") end |
.from_sdk_calls(options) ⇒ AWSCDK::CustomResources::AWSCustomResourcePolicy
Generate IAM Policy Statements from the configured SDK calls.
Each SDK call with be translated to an IAM Policy Statement in the form of: call.service:call.action (e.g s3:PutObject).
This policy generator assumes the IAM policy name has the same name as the API
call. This is true in 99% of cases, but there are exceptions (for example,
S3's PutBucketLifecycleConfiguration requires
s3:PutLifecycleConfiguration permissions, Lambda's Invoke requires
lambda:InvokeFunction permissions). Use from_statements if you want to
do a call that requires different IAM action names.
32 33 34 35 36 |
# File 'custom_resources/aws_custom_resource_policy.rb', line 32 def self.from_sdk_calls() = .is_a?(Hash) ? ::AWSCDK::CustomResources::SdkCallsPolicyOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jdXN0b21fcmVzb3VyY2VzLlNka0NhbGxzUG9saWN5T3B0aW9ucyJ9")), "options") Jsii::Kernel.instance.call_static("aws-cdk-lib.custom_resources.AwsCustomResourcePolicy", "fromSdkCalls", []) end |
.from_statements(statements) ⇒ AWSCDK::CustomResources::AWSCustomResourcePolicy
Explicit IAM Policy Statements.
42 43 44 45 |
# File 'custom_resources/aws_custom_resource_policy.rb', line 42 def self.from_statements(statements) Jsii::Type.check_type(statements, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pYW0uUG9saWN5U3RhdGVtZW50In0sImtpbmQiOiJhcnJheSJ9fQ==")), "statements") Jsii::Kernel.instance.call_static("aws-cdk-lib.custom_resources.AwsCustomResourcePolicy", "fromStatements", [statements]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 |
# File 'custom_resources/aws_custom_resource_policy.rb', line 12 def self.jsii_overridable_methods { :statements => { kind: :property, name: "statements", is_optional: false }, :resources => { kind: :property, name: "resources", is_optional: true }, } end |
Instance Method Details
#resources ⇒ Array<String>?
resources for auto-generated from SDK calls.
64 65 66 |
# File 'custom_resources/aws_custom_resource_policy.rb', line 64 def resources() jsii_get_property("resources") end |
#statements ⇒ Array<AWSCDK::IAM::PolicyStatement>
statements for explicit policy.
57 58 59 |
# File 'custom_resources/aws_custom_resource_policy.rb', line 57 def statements() jsii_get_property("statements") end |