Class: AWSCDK::EKS::KubectlProvider
- Inherits:
-
NestedStack
- Object
- NestedStack
- AWSCDK::EKS::KubectlProvider
- Includes:
- IKubectlProvider
- Defined in:
- eks/kubectl_provider.rb
Overview
Implementation of Kubectl Lambda.
Class Method Summary collapse
-
.from_kubectl_provider_attributes(scope, id, attrs) ⇒ AWSCDK::EKS::IKubectlProvider
Import an existing provider.
-
.get_or_create(scope, cluster) ⇒ AWSCDK::EKS::IKubectlProvider
Take existing provider or create new based on cluster.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#account ⇒ String
The AWS account into which this stack will be deployed.
-
#add_dependency(target, reason = nil) ⇒ void
Add a dependency between this stack and another stack.
-
#add_metadata(key, value) ⇒ void
Adds an arbitrary key-value pair, with information you want to record about the stack.
-
#add_stack_tag(tag_name, tag_value) ⇒ void
Configure a stack tag.
-
#add_transform(transform) ⇒ void
Add a Transform to this stack.
-
#allocate_logical_id(cfn_element) ⇒ String
Returns the naming scheme used to allocate logical IDs.
-
#artifact_id ⇒ String
The ID of the cloud assembly artifact for this stack.
-
#availability_zones ⇒ Array<String>
Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
-
#bundling_required ⇒ Boolean
Indicates whether the stack requires bundling or not.
-
#dependencies ⇒ Array<AWSCDK::Stack>
Return the stacks this stack depends on.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this Stack deploys to.
-
#environment ⇒ String
The environment coordinates in which this stack is deployed.
-
#export_string_list_value(exported_value, options = nil) ⇒ Array<String>
Create a CloudFormation Export for a string list value.
-
#export_value(exported_value, options = nil) ⇒ String
Create a CloudFormation Export for a string value.
-
#format_arn(components) ⇒ String
Creates an ARN from components.
-
#get_logical_id(element) ⇒ String
Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
-
#handler_role ⇒ AWSCDK::IAM::IRole
The IAM execution role of the handler.
-
#initialize(scope, id, props) ⇒ KubectlProvider
constructor
A new instance of KubectlProvider.
-
#nested ⇒ Boolean
Indicates if this is a nested stack, in which case
parentStackwill include a reference to its parent. -
#nested_stack_parent ⇒ AWSCDK::Stack?
If this is a nested stack, returns its parent stack.
-
#nested_stack_resource ⇒ AWSCDK::CfnResource?
If this is a nested stack, this represents its
AWS::CloudFormation::Stackresource. -
#node ⇒ Constructs::Node
The tree node.
-
#notification_arns ⇒ Array<String>
Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
-
#partition ⇒ String
The partition in which this stack is defined.
-
#region ⇒ String
The AWS region into which this stack will be deployed (e.g.
us-west-2). -
#regional_fact(fact_name, default_value = nil) ⇒ String
Look up a fact value for the given fact for the region of this stack.
-
#remove_stack_tag(tag_name) ⇒ void
Remove a stack tag.
-
#rename_logical_id(old_id, new_id) ⇒ void
Rename a generated logical identities.
-
#report_missing_context_key(report) ⇒ void
Indicate that a context key was expected.
-
#resolve(obj) ⇒ Object
Resolve a tokenized value in the context of the current stack.
-
#role_arn ⇒ String
The IAM role to assume in order to perform kubectl operations against this cluster.
-
#service_token ⇒ String
The custom resource provider's service token.
-
#set_parameter(name, value) ⇒ void
Assign a value to one of the nested stack parameters.
-
#split_arn(arn, arn_format) ⇒ AWSCDK::ARNComponents
Splits the provided ARN into its components.
-
#stack_id ⇒ String
An attribute that represents the ID of the stack.
-
#stack_name ⇒ String
An attribute that represents the name of the nested stack.
-
#synthesizer ⇒ AWSCDK::IStackSynthesizer
Synthesis method for this stack.
-
#tags ⇒ AWSCDK::TagManager
Tags to be applied to the stack.
-
#template_file ⇒ String
The name of the CloudFormation template file emitted to the output directory during synthesis.
-
#template_options ⇒ AWSCDK::ITemplateOptions
Options for CloudFormation template (like version, transform, description).
-
#termination_protection ⇒ Boolean
Whether termination protection is enabled for this stack.
- #termination_protection=(value) ⇒ Object
-
#to_json_string(obj, space = nil) ⇒ String
Convert an object, potentially containing tokens, to a JSON string.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#to_yaml_string(obj) ⇒ String
Convert an object, potentially containing tokens, to a YAML string.
-
#url_suffix ⇒ String
The Amazon domain suffix for the region in which this stack is defined.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ KubectlProvider
Returns a new instance of KubectlProvider.
12 13 14 15 16 17 18 |
# File 'eks/kubectl_provider.rb', line 12 def initialize(scope, id, props) props = props.is_a?(Hash) ? ::AWSCDK::EKS::KubectlProviderProps.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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkt1YmVjdGxQcm92aWRlclByb3BzIn0=")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.from_kubectl_provider_attributes(scope, id, attrs) ⇒ AWSCDK::EKS::IKubectlProvider
Import an existing provider.
76 77 78 79 80 81 82 |
# File 'eks/kubectl_provider.rb', line 76 def self.from_kubectl_provider_attributes(scope, id, attrs) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") attrs = attrs.is_a?(Hash) ? ::AWSCDK::EKS::KubectlProviderAttributes.new(**attrs.transform_keys(&:to_sym)) : attrs Jsii::Type.check_type(attrs, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkt1YmVjdGxQcm92aWRlckF0dHJpYnV0ZXMifQ==")), "attrs") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_eks.KubectlProvider", "fromKubectlProviderAttributes", [scope, id, attrs]) end |
.get_or_create(scope, cluster) ⇒ AWSCDK::EKS::IKubectlProvider
Take existing provider or create new based on cluster.
89 90 91 92 93 |
# File 'eks/kubectl_provider.rb', line 89 def self.get_or_create(scope, cluster) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklDbHVzdGVyIn0=")), "cluster") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_eks.KubectlProvider", "getOrCreate", [scope, cluster]) end |
.jsii_overridable_methods ⇒ Object
20 21 22 23 24 25 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 |
# File 'eks/kubectl_provider.rb', line 20 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :account => { kind: :property, name: "account", is_optional: false }, :artifact_id => { kind: :property, name: "artifactId", is_optional: false }, :availability_zones => { kind: :property, name: "availabilityZones", is_optional: false }, :bundling_required => { kind: :property, name: "bundlingRequired", is_optional: false }, :dependencies => { kind: :property, name: "dependencies", is_optional: false }, :env => { kind: :property, name: "env", is_optional: false }, :environment => { kind: :property, name: "environment", is_optional: false }, :nested => { kind: :property, name: "nested", is_optional: false }, :notification_arns => { kind: :property, name: "notificationArns", is_optional: false }, :partition => { kind: :property, name: "partition", is_optional: false }, :region => { kind: :property, name: "region", is_optional: false }, :stack_id => { kind: :property, name: "stackId", is_optional: false }, :stack_name => { kind: :property, name: "stackName", is_optional: false }, :synthesizer => { kind: :property, name: "synthesizer", is_optional: false }, :tags => { kind: :property, name: "tags", is_optional: false }, :template_file => { kind: :property, name: "templateFile", is_optional: false }, :template_options => { kind: :property, name: "templateOptions", is_optional: false }, :url_suffix => { kind: :property, name: "urlSuffix", is_optional: false }, :nested_stack_parent => { kind: :property, name: "nestedStackParent", is_optional: true }, :nested_stack_resource => { kind: :property, name: "nestedStackResource", is_optional: true }, :termination_protection => { kind: :property, name: "terminationProtection", is_optional: false }, :handler_role => { kind: :property, name: "handlerRole", is_optional: false }, :role_arn => { kind: :property, name: "roleArn", is_optional: false }, :service_token => { kind: :property, name: "serviceToken", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :add_dependency => { kind: :method, name: "addDependency", is_optional: false }, :add_metadata => { kind: :method, name: "addMetadata", is_optional: false }, :add_stack_tag => { kind: :method, name: "addStackTag", is_optional: false }, :add_transform => { kind: :method, name: "addTransform", is_optional: false }, :allocate_logical_id => { kind: :method, name: "allocateLogicalId", is_optional: false }, :export_string_list_value => { kind: :method, name: "exportStringListValue", is_optional: false }, :export_value => { kind: :method, name: "exportValue", is_optional: false }, :format_arn => { kind: :method, name: "formatArn", is_optional: false }, :get_logical_id => { kind: :method, name: "getLogicalId", is_optional: false }, :regional_fact => { kind: :method, name: "regionalFact", is_optional: false }, :remove_stack_tag => { kind: :method, name: "removeStackTag", is_optional: false }, :rename_logical_id => { kind: :method, name: "renameLogicalId", is_optional: false }, :report_missing_context_key => { kind: :method, name: "reportMissingContextKey", is_optional: false }, :resolve => { kind: :method, name: "resolve", is_optional: false }, :split_arn => { kind: :method, name: "splitArn", is_optional: false }, :to_json_string => { kind: :method, name: "toJsonString", is_optional: false }, :to_yaml_string => { kind: :method, name: "toYamlString", is_optional: false }, :set_parameter => { kind: :method, name: "setParameter", is_optional: false }, } end |
Instance Method Details
#account ⇒ String
The AWS account into which this stack will be deployed.
This value is resolved according to the following rules:
- The value provided to
env.accountwhen the stack is defined. This can either be a concrete account (e.g.585695031111) or theAws.ACCOUNT_IDtoken. Aws.ACCOUNT_ID, which represents the CloudFormation intrinsic reference{ "Ref": "AWS::AccountId" }encoded as a string token.
Preferably, you should use the return value as an opaque string and not
attempt to parse it to implement your logic. If you do, you must first
check that it is a concrete value an not an unresolved token. If this
value is an unresolved token (Token.isUnresolved(stack.account) returns
true), this implies that the user wishes that this stack will synthesize
into an account-agnostic template. In this case, your code should either
fail (throw an error, emit a synth error using Annotations.of(construct).addError()) or
implement some other account-agnostic behavior.
122 123 124 |
# File 'eks/kubectl_provider.rb', line 122 def account() jsii_get_property("account") end |
#add_dependency(target, reason = nil) ⇒ void
This method returns an undefined value.
Add a dependency between this stack and another stack.
This can be used to define dependencies between any two stacks within an app, and also supports nested stacks.
381 382 383 384 385 |
# File 'eks/kubectl_provider.rb', line 381 def add_dependency(target, reason = nil) Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TdGFjayJ9")), "target") Jsii::Type.check_type(reason, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "reason") unless reason.nil? jsii_call_method("addDependency", [target, reason]) end |
#add_metadata(key, value) ⇒ void
This method returns an undefined value.
Adds an arbitrary key-value pair, with information you want to record about the stack.
These get translated to the Metadata section of the generated template.
395 396 397 398 399 |
# File 'eks/kubectl_provider.rb', line 395 def (key, value) Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key") Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value") jsii_call_method("addMetadata", [key, value]) end |
#add_stack_tag(tag_name, tag_value) ⇒ void
This method returns an undefined value.
Configure a stack tag.
At deploy time, CloudFormation will automatically apply all stack tags to all resources in the stack.
408 409 410 411 412 |
# File 'eks/kubectl_provider.rb', line 408 def add_stack_tag(tag_name, tag_value) Jsii::Type.check_type(tag_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tagName") Jsii::Type.check_type(tag_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tagValue") jsii_call_method("addStackTag", [tag_name, tag_value]) end |
#add_transform(transform) ⇒ void
This method returns an undefined value.
Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.
Duplicate values are removed when stack is synthesized.
426 427 428 429 |
# File 'eks/kubectl_provider.rb', line 426 def add_transform(transform) Jsii::Type.check_type(transform, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "transform") jsii_call_method("addTransform", [transform]) end |
#allocate_logical_id(cfn_element) ⇒ String
Returns the naming scheme used to allocate logical IDs.
By default, uses
the HashedAddressingScheme but this method can be overridden to customize
this behavior.
In order to make sure logical IDs are unique and stable, we hash the resource construct tree path (i.e. toplevel/secondlevel/.../myresource) and add it as a suffix to the path components joined without a separator (CloudFormation IDs only allow alphanumeric characters).
The result will be:
If the "human" part of the ID exceeds 240 characters, we simply trim it so the total ID doesn't exceed CloudFormation's 255 character limit.
We only take 8 characters from the md5 hash (0.000005 chance of collision).
Special cases:
- If the path only contains a single component (i.e. it's a top-level resource), we won't add the hash to it. The hash is not needed for disambiguation and also, it allows for a more straightforward migration an existing CloudFormation template to a CDK stack without logical ID changes (or renames).
- For aesthetic reasons, if the last components of the path are the same
(i.e.
L1/L2/Pipeline/Pipeline), they will be de-duplicated to make the resulting human portion of the ID more pleasing:L1L2Pipeline<HASH>instead ofL1L2PipelinePipeline<HASH> - If a component is named "Default" it will be omitted from the path. This allows refactoring higher level abstractions around constructs without affecting the IDs of already deployed resources.
- If a component is named "Resource" it will be omitted from the user-visible path, but included in the hash. This reduces visual noise in the human readable part of the identifier.
472 473 474 475 |
# File 'eks/kubectl_provider.rb', line 472 def allocate_logical_id(cfn_element) Jsii::Type.check_type(cfn_element, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5FbGVtZW50In0=")), "cfnElement") jsii_call_method("allocateLogicalId", [cfn_element]) end |
#artifact_id ⇒ String
The ID of the cloud assembly artifact for this stack.
129 130 131 |
# File 'eks/kubectl_provider.rb', line 129 def artifact_id() jsii_get_property("artifactId") end |
#availability_zones ⇒ Array<String>
Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
If the stack is environment-agnostic (either account and/or region are
tokens), this property will return an array with 2 tokens that will resolve
at deploy-time to the first two availability zones returned from CloudFormation's
Fn::GetAZs intrinsic function.
If they are not available in the context, returns a set of dummy values and
reports them as missing, and let the CLI resolve them by calling EC2
DescribeAvailabilityZones on the target environment.
To specify a different strategy for selecting availability zones override this method.
147 148 149 |
# File 'eks/kubectl_provider.rb', line 147 def availability_zones() jsii_get_property("availabilityZones") end |
#bundling_required ⇒ Boolean
Indicates whether the stack requires bundling or not.
154 155 156 |
# File 'eks/kubectl_provider.rb', line 154 def bundling_required() jsii_get_property("bundlingRequired") end |
#dependencies ⇒ Array<AWSCDK::Stack>
Return the stacks this stack depends on.
161 162 163 |
# File 'eks/kubectl_provider.rb', line 161 def dependencies() jsii_get_property("dependencies") end |
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this Stack deploys to.
168 169 170 |
# File 'eks/kubectl_provider.rb', line 168 def env() jsii_get_property("env") end |
#environment ⇒ String
The environment coordinates in which this stack is deployed.
In the form
aws://account/region. Use stack.account and stack.region to obtain
the specific values, no need to parse.
You can use this value to determine if two stacks are targeting the same environment.
If either stack.account or stack.region are not concrete values (e.g.
Aws.ACCOUNT_ID or Aws.REGION) the special strings unknown-account and/or
unknown-region will be used respectively to indicate this stack is
region/account-agnostic.
187 188 189 |
# File 'eks/kubectl_provider.rb', line 187 def environment() jsii_get_property("environment") end |
#export_string_list_value(exported_value, options = nil) ⇒ Array<String>
Create a CloudFormation Export for a string list value.
Returns a string list representing the corresponding Fn.importValue()
expression for this Export. The export expression is automatically wrapped with an
Fn::Join and the import value with an Fn::Split, since CloudFormation can only
export strings. You can control the name for the export by passing the name option.
If you don't supply a value for name, the value you're exporting must be
a Resource attribute (for example: bucket.bucketName) and it will be
given the same name as the automatic cross-stack reference that would be created
if you used the attribute in another Stack.
One of the uses for this method is to remove the relationship between two Stacks established by automatic cross-stack references. It will temporarily ensure that the CloudFormation Export still exists while you remove the reference from the consuming stack. After that, you can remove the resource and the manual export.
See export_value for an example of this process.
500 501 502 503 504 505 |
# File 'eks/kubectl_provider.rb', line 500 def export_string_list_value(exported_value, = nil) Jsii::Type.check_type(exported_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "exportedValue") = .is_a?(Hash) ? ::AWSCDK::ExportValueOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5FeHBvcnRWYWx1ZU9wdGlvbnMifQ==")), "options") unless .nil? jsii_call_method("exportStringListValue", [exported_value, ]) end |
#export_value(exported_value, options = nil) ⇒ String
Create a CloudFormation Export for a string value.
Returns a string representing the corresponding Fn.importValue()
expression for this Export. You can control the name for the export by
passing the name option.
If you don't supply a value for name, the value you're exporting must be
a Resource attribute (for example: bucket.bucketName) and it will be
given the same name as the automatic cross-stack reference that would be created
if you used the attribute in another Stack.
One of the uses for this method is to remove the relationship between two Stacks established by automatic cross-stack references. It will temporarily ensure that the CloudFormation Export still exists while you remove the reference from the consuming stack. After that, you can remove the resource and the manual export.
Here is how the process works. Let's say there are two stacks,
producer_stack and consumer_stack, and producer_stack has a bucket
called bucket, which is referenced by consumer_stack (perhaps because
an AWS Lambda Function writes into it, or something like that).
It is not safe to remove producerStack.bucket because as the bucket is being
deleted, consumer_stack might still be using it.
Instead, the process takes two deployments:
Deployment 1: break the relationship:
- Make sure
consumer_stackno longer referencesbucket.bucketName(maybe the consumer stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just remove the Lambda Function altogether). - In the
ProducerStackclass, callthis.exportValue(this.bucket.bucketName). This will make sure the CloudFormation Export continues to exist while the relationship between the two stacks is being broken. - Deploy (this will effectively only change the
consumer_stack, but it's safe to deploy both).
Deployment 2: remove the bucket resource:
- You are now free to remove the
bucketresource fromproducer_stack. - Don't forget to remove the
export_value()call as well. - Deploy again (this time only the
producer_stackwill be changed -- the bucket will be deleted).
553 554 555 556 557 558 |
# File 'eks/kubectl_provider.rb', line 553 def export_value(exported_value, = nil) Jsii::Type.check_type(exported_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "exportedValue") = .is_a?(Hash) ? ::AWSCDK::ExportValueOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5FeHBvcnRWYWx1ZU9wdGlvbnMifQ==")), "options") unless .nil? jsii_call_method("exportValue", [exported_value, ]) end |
#format_arn(components) ⇒ String
Creates an ARN from components.
If partition, region or account are not specified, the stack's
partition, region and account will be used.
If any component is the empty string, an empty string will be inserted into the generated ARN at the location that component corresponds to.
The ARN will be formatted as follows:
arn:#partition:service:#region:#account:resourcesepresource-name
The required ARN pieces that are omitted will be taken from the stack that the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope can be 'undefined'.
578 579 580 581 582 |
# File 'eks/kubectl_provider.rb', line 578 def format_arn(components) components = components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**components.transform_keys(&:to_sym)) : components Jsii::Type.check_type(components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "components") jsii_call_method("formatArn", [components]) end |
#get_logical_id(element) ⇒ String
Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
This method is called when a CfnElement is created and used to render the
initial logical identity of resources. Logical ID renames are applied at
this stage.
This method uses the protected method allocate_logical_id to render the
logical ID for an element. To modify the naming scheme, extend the Stack
class and override this method.
596 597 598 599 |
# File 'eks/kubectl_provider.rb', line 596 def get_logical_id(element) Jsii::Type.check_type(element, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5FbGVtZW50In0=")), "element") jsii_call_method("getLogicalId", [element]) end |
#handler_role ⇒ AWSCDK::IAM::IRole
The IAM execution role of the handler.
332 333 334 |
# File 'eks/kubectl_provider.rb', line 332 def handler_role() jsii_get_property("handlerRole") end |
#nested ⇒ Boolean
Indicates if this is a nested stack, in which case parentStack will include a reference to its parent.
194 195 196 |
# File 'eks/kubectl_provider.rb', line 194 def nested() jsii_get_property("nested") end |
#nested_stack_parent ⇒ AWSCDK::Stack?
If this is a nested stack, returns its parent stack.
304 305 306 |
# File 'eks/kubectl_provider.rb', line 304 def nested_stack_parent() jsii_get_property("nestedStackParent") end |
#nested_stack_resource ⇒ AWSCDK::CfnResource?
If this is a nested stack, this represents its AWS::CloudFormation::Stack resource.
undefined for top-level (non-nested) stacks.
313 314 315 |
# File 'eks/kubectl_provider.rb', line 313 def nested_stack_resource() jsii_get_property("nestedStackResource") end |
#node ⇒ Constructs::Node
The tree node.
98 99 100 |
# File 'eks/kubectl_provider.rb', line 98 def node() jsii_get_property("node") end |
#notification_arns ⇒ Array<String>
Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
201 202 203 |
# File 'eks/kubectl_provider.rb', line 201 def notification_arns() jsii_get_property("notificationArns") end |
#partition ⇒ String
The partition in which this stack is defined.
208 209 210 |
# File 'eks/kubectl_provider.rb', line 208 def partition() jsii_get_property("partition") end |
#region ⇒ String
The AWS region into which this stack will be deployed (e.g. us-west-2).
This value is resolved according to the following rules:
- The value provided to
env.regionwhen the stack is defined. This can either be a concrete region (e.g.us-west-2) or theAws.REGIONtoken. Aws.REGION, which is represents the CloudFormation intrinsic reference{ "Ref": "AWS::Region" }encoded as a string token.
Preferably, you should use the return value as an opaque string and not
attempt to parse it to implement your logic. If you do, you must first
check that it is a concrete value an not an unresolved token. If this
value is an unresolved token (Token.isUnresolved(stack.region) returns
true), this implies that the user wishes that this stack will synthesize
into a region-agnostic template. In this case, your code should either
fail (throw an error, emit a synth error using Annotations.of(construct).addError()) or
implement some other region-agnostic behavior.
232 233 234 |
# File 'eks/kubectl_provider.rb', line 232 def region() jsii_get_property("region") end |
#regional_fact(fact_name, default_value = nil) ⇒ String
Look up a fact value for the given fact for the region of this stack.
Will return a definite value only if the region of the current stack is resolved. If not, a lookup map will be added to the stack and the lookup will be done at CDK deployment time.
What regions will be included in the lookup map is controlled by the
@aws-cdk/core:target-partitions context value: it must be set to a list
of partitions, and only regions from the given partitions will be included.
If no such context key is set, all regions will be included.
This function is intended to be used by construct library authors. Application builders can rely on the abstractions offered by construct libraries and do not have to worry about regional facts.
If default_value is not given, it is an error if the fact is unknown for
the given region.
622 623 624 625 626 |
# File 'eks/kubectl_provider.rb', line 622 def regional_fact(fact_name, default_value = nil) Jsii::Type.check_type(fact_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "factName") Jsii::Type.check_type(default_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultValue") unless default_value.nil? jsii_call_method("regionalFact", [fact_name, default_value]) end |
#remove_stack_tag(tag_name) ⇒ void
This method returns an undefined value.
Remove a stack tag.
At deploy time, CloudFormation will automatically apply all stack tags to all resources in the stack.
634 635 636 637 |
# File 'eks/kubectl_provider.rb', line 634 def remove_stack_tag(tag_name) Jsii::Type.check_type(tag_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tagName") jsii_call_method("removeStackTag", [tag_name]) end |
#rename_logical_id(old_id, new_id) ⇒ void
This method returns an undefined value.
Rename a generated logical identities.
To modify the naming scheme strategy, extend the Stack class and
override the allocate_logical_id method.
647 648 649 650 651 |
# File 'eks/kubectl_provider.rb', line 647 def rename_logical_id(old_id, new_id) Jsii::Type.check_type(old_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "oldId") Jsii::Type.check_type(new_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "newId") jsii_call_method("renameLogicalId", [old_id, new_id]) end |
#report_missing_context_key(report) ⇒ void
This method returns an undefined value.
Indicate that a context key was expected.
Contains instructions which will be emitted into the cloud assembly on how the key should be supplied.
660 661 662 663 664 |
# File 'eks/kubectl_provider.rb', line 660 def report_missing_context_key(report) report = report.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::MissingContext.new(**report.transform_keys(&:to_sym)) : report Jsii::Type.check_type(report, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuTWlzc2luZ0NvbnRleHQifQ==")), "report") jsii_call_method("reportMissingContextKey", [report]) end |
#resolve(obj) ⇒ Object
Resolve a tokenized value in the context of the current stack.
670 671 672 673 |
# File 'eks/kubectl_provider.rb', line 670 def resolve(obj) Jsii::Type.check_type(obj, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "obj") jsii_call_method("resolve", [obj]) end |
#role_arn ⇒ String
The IAM role to assume in order to perform kubectl operations against this cluster.
339 340 341 |
# File 'eks/kubectl_provider.rb', line 339 def role_arn() jsii_get_property("roleArn") end |
#service_token ⇒ String
The custom resource provider's service token.
346 347 348 |
# File 'eks/kubectl_provider.rb', line 346 def service_token() jsii_get_property("serviceToken") end |
#set_parameter(name, value) ⇒ void
This method returns an undefined value.
Assign a value to one of the nested stack parameters.
716 717 718 719 720 |
# File 'eks/kubectl_provider.rb', line 716 def set_parameter(name, value) Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") jsii_call_method("setParameter", [name, value]) end |
#split_arn(arn, arn_format) ⇒ AWSCDK::ARNComponents
Splits the provided ARN into its components.
Works both if 'arn' is a string like 'arn:aws:s3:::bucket', and a Token representing a dynamic CloudFormation expression (in which case the returned components will also be dynamic CloudFormation expressions, encoded as Tokens).
685 686 687 688 689 |
# File 'eks/kubectl_provider.rb', line 685 def split_arn(arn, arn_format) Jsii::Type.check_type(arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arn") Jsii::Type.check_type(arn_format, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Gb3JtYXQifQ==")), "arnFormat") jsii_call_method("splitArn", [arn, arn_format]) end |
#stack_id ⇒ String
An attribute that represents the ID of the stack.
This is a context aware attribute:
- If this is referenced from the parent stack, it will return
{ "Ref": "LogicalIdOfNestedStackResource" }. - If this is referenced from the context of the nested stack, it will return
{ "Ref": "AWS::StackId" }
Example value: arn:aws:cloudformation:us-east-2:123456789012:stack/mystack-mynestedstack-sggfrhxhum7w/f449b250-b969-11e0-a185-5081d0136786
246 247 248 |
# File 'eks/kubectl_provider.rb', line 246 def stack_id() jsii_get_property("stackId") end |
#stack_name ⇒ String
An attribute that represents the name of the nested stack.
This is a context aware attribute:
- If this is referenced from the parent stack, it will return a token that parses the name from the stack ID.
- If this is referenced from the context of the nested stack, it will return
{ "Ref": "AWS::StackName" }
Example value: mystack-mynestedstack-sggfrhxhum7w
260 261 262 |
# File 'eks/kubectl_provider.rb', line 260 def stack_name() jsii_get_property("stackName") end |
#synthesizer ⇒ AWSCDK::IStackSynthesizer
Synthesis method for this stack.
267 268 269 |
# File 'eks/kubectl_provider.rb', line 267 def synthesizer() jsii_get_property("synthesizer") end |
#tags ⇒ AWSCDK::TagManager
Tags to be applied to the stack.
274 275 276 |
# File 'eks/kubectl_provider.rb', line 274 def () jsii_get_property("tags") end |
#template_file ⇒ String
The name of the CloudFormation template file emitted to the output directory during synthesis.
Example value: MyStack.template.json
283 284 285 |
# File 'eks/kubectl_provider.rb', line 283 def template_file() jsii_get_property("templateFile") end |
#template_options ⇒ AWSCDK::ITemplateOptions
Options for CloudFormation template (like version, transform, description).
290 291 292 |
# File 'eks/kubectl_provider.rb', line 290 def () jsii_get_property("templateOptions") end |
#termination_protection ⇒ Boolean
Whether termination protection is enabled for this stack.
320 321 322 |
# File 'eks/kubectl_provider.rb', line 320 def termination_protection() jsii_get_property("terminationProtection") end |
#termination_protection=(value) ⇒ Object
324 325 326 327 |
# File 'eks/kubectl_provider.rb', line 324 def termination_protection=(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "terminationProtection") jsii_set_property("terminationProtection", value) end |
#to_json_string(obj, space = nil) ⇒ String
Convert an object, potentially containing tokens, to a JSON string.
696 697 698 699 700 |
# File 'eks/kubectl_provider.rb', line 696 def to_json_string(obj, space = nil) Jsii::Type.check_type(obj, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "obj") Jsii::Type.check_type(space, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "space") unless space.nil? jsii_call_method("toJsonString", [obj, space]) end |
#to_string ⇒ String
Returns a string representation of this construct.
353 354 355 |
# File 'eks/kubectl_provider.rb', line 353 def to_string() jsii_call_method("toString", []) end |
#to_yaml_string(obj) ⇒ String
Convert an object, potentially containing tokens, to a YAML string.
706 707 708 709 |
# File 'eks/kubectl_provider.rb', line 706 def to_yaml_string(obj) Jsii::Type.check_type(obj, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "obj") jsii_call_method("toYamlString", [obj]) end |
#url_suffix ⇒ String
The Amazon domain suffix for the region in which this stack is defined.
297 298 299 |
# File 'eks/kubectl_provider.rb', line 297 def url_suffix() jsii_get_property("urlSuffix") 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.
366 367 368 369 370 371 |
# File 'eks/kubectl_provider.rb', line 366 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 |