@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:00:42.432Z") @Stability(value=Experimental) public class CfnResource extends CfnRefElement
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnResource.Builder
(experimental) A fluent builder for
CfnResource. |
| Modifier | Constructor and Description |
|---|---|
|
CfnResource(software.constructs.Construct scope,
String id,
CfnResourceProps props)
(experimental) Creates a resource construct.
|
protected |
CfnResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnResource(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeletionOverride(String path)
(experimental) Syntactic sugar for `addOverride(path, undefined)`.
|
void |
addDependsOn(CfnResource target)
(experimental) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
|
void |
addMetadata(String key,
Object value)
(experimental) Add a value to the CloudFormation Resource Metadata.
|
void |
addOverride(String path,
Object value)
(experimental) Adds an override to the synthesized CloudFormation resource.
|
void |
addPropertyDeletionOverride(String propertyPath)
(experimental) Adds an override that deletes the value of a property from the resource definition.
|
void |
addPropertyOverride(String propertyPath,
Object value)
(experimental) Adds an override to a resource property.
|
void |
applyRemovalPolicy()
(experimental) Sets the deletion policy of the resource based on the removal policy specified.
|
void |
applyRemovalPolicy(RemovalPolicy policy)
(experimental) Sets the deletion policy of the resource based on the removal policy specified.
|
void |
applyRemovalPolicy(RemovalPolicy policy,
RemovalPolicyOptions options)
(experimental) Sets the deletion policy of the resource based on the removal policy specified.
|
Reference |
getAtt(String attributeName)
(experimental) Returns a token for an runtime attribute of this resource.
|
ICfnResourceOptions |
getCfnOptions()
(experimental) Options for this resource, such as condition, update policy etc.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getCfnResourceType()
(experimental) AWS resource type.
|
Object |
getMetadata(String key)
(experimental) Retrieve a value value from the CloudFormation Resource Metadata.
|
protected Map<String,Object> |
getUpdatedProperites()
(experimental) Return properties modified after initiation.
|
static Boolean |
isCfnResource(software.constructs.IConstruct construct)
(experimental) Check whether the given construct is a CfnResource.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
protected Boolean |
shouldSynthesize()
(experimental) Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
|
String |
toString()
(experimental) Returns a string representation of this construct.
|
protected void |
validateProperties(Object _properties) |
getRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected CfnResource(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public CfnResource(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnResourceProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Experimental) @NotNull public static Boolean isCfnResource(@NotNull software.constructs.IConstruct construct)
construct - This parameter is required.@Stability(value=Experimental)
public void addDeletionOverride(@NotNull
String path)
path - The path of the value to delete. This parameter is required.@Stability(value=Experimental)
public void addDependsOn(@NotNull
CfnResource target)
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
target - This parameter is required.@Stability(value=Experimental)
public void addMetadata(@NotNull
String key,
@NotNull
Object value)
key - This parameter is required.value - This parameter is required.Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.@Stability(value=Experimental)
public void addOverride(@NotNull
String path,
@NotNull
Object value)
To add a
property override, either use addPropertyOverride or prefix path with
"Properties." (i.e. Properties.TopicName).
If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal . in the property name, prefix with a \. In most
programming languages you will need to write this as "\\." because the
\ itself will need to be escaped.
For example,
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
cfnResource.addOverride("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", asList("myattribute"));
cfnResource.addOverride("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE");
would add the overrides
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
path - - The path of the property, you can use dot notation to override values in complex types. This parameter is required.value - - The value. This parameter is required.@Stability(value=Experimental)
public void addPropertyDeletionOverride(@NotNull
String propertyPath)
propertyPath - The path to the property. This parameter is required.@Stability(value=Experimental)
public void addPropertyOverride(@NotNull
String propertyPath,
@NotNull
Object value)
Syntactic sugar for addOverride("Properties.<...>", value).
propertyPath - The path of the property. This parameter is required.value - The value. This parameter is required.@Stability(value=Experimental)
public void applyRemovalPolicy(@Nullable
RemovalPolicy policy,
@Nullable
RemovalPolicyOptions options)
policy - options - @Stability(value=Experimental)
public void applyRemovalPolicy(@Nullable
RemovalPolicy policy)
policy - @Stability(value=Experimental) public void applyRemovalPolicy()
@Stability(value=Experimental) @NotNull public Reference getAtt(@NotNull String attributeName)
Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility
in case there is no generated attribute.
attributeName - The name of the attribute. This parameter is required.@Stability(value=Experimental) @NotNull public Object getMetadata(@NotNull String key)
key - This parameter is required.Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.@Stability(value=Experimental) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
props - This parameter is required.@Stability(value=Experimental) @NotNull protected Boolean shouldSynthesize()
@Stability(value=Experimental) @NotNull public String toString()
toString in class software.constructs.Construct@Stability(value=Experimental)
protected void validateProperties(@NotNull
Object _properties)
_properties - This parameter is required.@Stability(value=Experimental) @NotNull public ICfnResourceOptions getCfnOptions()
@Stability(value=Experimental) @NotNull protected Map<String,Object> getCfnProperties()
@Stability(value=Experimental) @NotNull public String getCfnResourceType()
@Stability(value=Experimental) @NotNull protected Map<String,Object> getUpdatedProperites()
Resources that expose mutable properties should override this function to collect and return the properties object for this resource.
Copyright © 2021. All rights reserved.