class CfnModelPackage (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Sagemaker.CfnModelPackage |
Java | software.amazon.awscdk.services.sagemaker.CfnModelPackage |
Python | aws_cdk.aws_sagemaker.CfnModelPackage |
TypeScript | @aws-cdk/aws-sagemaker » CfnModelPackage |
Implements
IConstruct
, IConstruct
, IDependable
, IInspectable
A CloudFormation AWS::SageMaker::ModelPackage
.
A versioned model that can be deployed for SageMaker inference.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as sagemaker from '@aws-cdk/aws-sagemaker';
declare const modelInput: any;
const cfnModelPackage = new sagemaker.CfnModelPackage(this, 'MyCfnModelPackage', /* all optional props */ {
additionalInferenceSpecificationDefinition: {
containers: [{
image: 'image',
// the properties below are optional
containerHostname: 'containerHostname',
environment: {
environmentKey: 'environment',
},
framework: 'framework',
frameworkVersion: 'frameworkVersion',
imageDigest: 'imageDigest',
modelDataUrl: 'modelDataUrl',
modelInput: modelInput,
nearestModelName: 'nearestModelName',
productId: 'productId',
}],
name: 'name',
// the properties below are optional
description: 'description',
supportedContentTypes: ['supportedContentTypes'],
supportedRealtimeInferenceInstanceTypes: ['supportedRealtimeInferenceInstanceTypes'],
supportedResponseMimeTypes: ['supportedResponseMimeTypes'],
supportedTransformInstanceTypes: ['supportedTransformInstanceTypes'],
},
additionalInferenceSpecifications: [{
containers: [{
image: 'image',
// the properties below are optional
containerHostname: 'containerHostname',
environment: {
environmentKey: 'environment',
},
framework: 'framework',
frameworkVersion: 'frameworkVersion',
imageDigest: 'imageDigest',
modelDataUrl: 'modelDataUrl',
modelInput: modelInput,
nearestModelName: 'nearestModelName',
productId: 'productId',
}],
name: 'name',
// the properties below are optional
description: 'description',
supportedContentTypes: ['supportedContentTypes'],
supportedRealtimeInferenceInstanceTypes: ['supportedRealtimeInferenceInstanceTypes'],
supportedResponseMimeTypes: ['supportedResponseMimeTypes'],
supportedTransformInstanceTypes: ['supportedTransformInstanceTypes'],
}],
additionalInferenceSpecificationsToAdd: [{
containers: [{
image: 'image',
// the properties below are optional
containerHostname: 'containerHostname',
environment: {
environmentKey: 'environment',
},
framework: 'framework',
frameworkVersion: 'frameworkVersion',
imageDigest: 'imageDigest',
modelDataUrl: 'modelDataUrl',
modelInput: modelInput,
nearestModelName: 'nearestModelName',
productId: 'productId',
}],
name: 'name',
// the properties below are optional
description: 'description',
supportedContentTypes: ['supportedContentTypes'],
supportedRealtimeInferenceInstanceTypes: ['supportedRealtimeInferenceInstanceTypes'],
supportedResponseMimeTypes: ['supportedResponseMimeTypes'],
supportedTransformInstanceTypes: ['supportedTransformInstanceTypes'],
}],
approvalDescription: 'approvalDescription',
certifyForMarketplace: false,
clientToken: 'clientToken',
createdBy: {
domainId: 'domainId',
userProfileArn: 'userProfileArn',
userProfileName: 'userProfileName',
},
customerMetadataProperties: {
customerMetadataPropertiesKey: 'customerMetadataProperties',
},
domain: 'domain',
driftCheckBaselines: {
bias: {
configFile: {
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
contentType: 'contentType',
},
postTrainingConstraints: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
preTrainingConstraints: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
explainability: {
configFile: {
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
contentType: 'contentType',
},
constraints: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
modelDataQuality: {
constraints: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
statistics: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
modelQuality: {
constraints: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
statistics: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
},
environment: {
environmentKey: 'environment',
},
inferenceSpecification: {
containers: [{
image: 'image',
// the properties below are optional
containerHostname: 'containerHostname',
environment: {
environmentKey: 'environment',
},
framework: 'framework',
frameworkVersion: 'frameworkVersion',
imageDigest: 'imageDigest',
modelDataUrl: 'modelDataUrl',
modelInput: modelInput,
nearestModelName: 'nearestModelName',
productId: 'productId',
}],
supportedContentTypes: ['supportedContentTypes'],
supportedResponseMimeTypes: ['supportedResponseMimeTypes'],
// the properties below are optional
supportedRealtimeInferenceInstanceTypes: ['supportedRealtimeInferenceInstanceTypes'],
supportedTransformInstanceTypes: ['supportedTransformInstanceTypes'],
},
lastModifiedBy: {
domainId: 'domainId',
userProfileArn: 'userProfileArn',
userProfileName: 'userProfileName',
},
lastModifiedTime: 'lastModifiedTime',
metadataProperties: {
commitId: 'commitId',
generatedBy: 'generatedBy',
projectId: 'projectId',
repository: 'repository',
},
modelApprovalStatus: 'modelApprovalStatus',
modelMetrics: {
bias: {
postTrainingReport: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
preTrainingReport: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
report: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
explainability: {
report: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
modelDataQuality: {
constraints: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
statistics: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
modelQuality: {
constraints: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
statistics: {
contentType: 'contentType',
s3Uri: 's3Uri',
// the properties below are optional
contentDigest: 'contentDigest',
},
},
},
modelPackageDescription: 'modelPackageDescription',
modelPackageGroupName: 'modelPackageGroupName',
modelPackageName: 'modelPackageName',
modelPackageStatusDetails: {
validationStatuses: [{
name: 'name',
status: 'status',
// the properties below are optional
failureReason: 'failureReason',
}],
// the properties below are optional
imageScanStatuses: [{
name: 'name',
status: 'status',
// the properties below are optional
failureReason: 'failureReason',
}],
},
modelPackageStatusItem: {
name: 'name',
status: 'status',
// the properties below are optional
failureReason: 'failureReason',
},
modelPackageVersion: 123,
samplePayloadUrl: 'samplePayloadUrl',
sourceAlgorithmSpecification: {
sourceAlgorithms: [{
algorithmName: 'algorithmName',
// the properties below are optional
modelDataUrl: 'modelDataUrl',
}],
},
tags: [{
key: 'key',
value: 'value',
}],
task: 'task',
validationSpecification: {
validationProfiles: [{
profileName: 'profileName',
transformJobDefinition: {
transformInput: {
dataSource: {
s3DataSource: {
s3DataType: 's3DataType',
s3Uri: 's3Uri',
},
},
// the properties below are optional
compressionType: 'compressionType',
contentType: 'contentType',
splitType: 'splitType',
},
transformOutput: {
s3OutputPath: 's3OutputPath',
// the properties below are optional
accept: 'accept',
assembleWith: 'assembleWith',
kmsKeyId: 'kmsKeyId',
},
transformResources: {
instanceCount: 123,
instanceType: 'instanceType',
// the properties below are optional
volumeKmsKeyId: 'volumeKmsKeyId',
},
// the properties below are optional
batchStrategy: 'batchStrategy',
environment: {
environmentKey: 'environment',
},
maxConcurrentTransforms: 123,
maxPayloadInMb: 123,
},
}],
validationRole: 'validationRole',
},
});
Initializer
new CfnModelPackage(scope: Construct, id: string, props?: CfnModelPackageProps)
Parameters
- scope
Construct
— - scope in which this resource is defined. - id
string
— - scoped id of the resource. - props
Cfn
— - resource properties.Model Package Props
Create a new AWS::SageMaker::ModelPackage
.
Construct Props
Name | Type | Description |
---|---|---|
additional | IResolvable | Additional | A structure of additional Inference Specification. |
additional | IResolvable | IResolvable | Additional [] | An array of additional Inference Specification objects. |
additional | IResolvable | IResolvable | Additional [] | An array of additional Inference Specification objects to be added to the existing array. |
approval | string | A description provided when the model approval is set. |
certify | boolean | IResolvable | Whether the model package is to be certified to be listed on AWS Marketplace. |
client | string | A unique token that guarantees that the call to this API is idempotent. |
created | IResolvable | User | Information about the user who created or modified an experiment, trial, trial component, lineage group, or project. |
customer | IResolvable | { [string]: string } | The metadata properties for the model package. |
domain? | string | The machine learning domain of your model package and its components. |
drift | IResolvable | Drift | Represents the drift check baselines that can be used when the model monitor is set using the model package. |
environment? | IResolvable | { [string]: string } | The environment variables to set in the Docker container. |
inference | IResolvable | Inference | Defines how to perform inference generation after a training job is run. |
last | IResolvable | User | Information about the user who created or modified an experiment, trial, trial component, lineage group, or project. |
last | string | The last time the model package was modified. |
metadata | IResolvable | Metadata | Metadata properties of the tracking entity, trial, or trial component. |
model | string | The approval status of the model. This can be one of the following values. |
model | IResolvable | Model | Metrics for the model. |
model | string | The description of the model package. |
model | string | The model group to which the model belongs. |
model | string | The name of the model. |
model | IResolvable | Model | Specifies the validation and image scan statuses of the model package. |
model | IResolvable | Model | Represents the overall status of a model package. |
model | number | The version number of a versioned model. |
sample | string | The Amazon Simple Storage Service path where the sample payload are stored. |
source | IResolvable | Source | A list of algorithms that were used to create a model package. |
tags? | Cfn [] | A list of the tags associated with the model package. |
task? | string | The machine learning task your model package accomplishes. |
validation | IResolvable | Validation | Specifies batch transform jobs that SageMaker runs to validate your model package. |
additionalInferenceSpecificationDefinition?
Type:
IResolvable
|
Additional
(optional)
A structure of additional Inference Specification.
Additional Inference Specification specifies details about inference jobs that can be run with models based on this model package
additionalInferenceSpecifications?
Type:
IResolvable
|
IResolvable
|
Additional
[]
(optional)
An array of additional Inference Specification objects.
additionalInferenceSpecificationsToAdd?
Type:
IResolvable
|
IResolvable
|
Additional
[]
(optional)
An array of additional Inference Specification objects to be added to the existing array.
The total number of additional Inference Specification objects cannot exceed 15. Each additional Inference Specification object specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.
approvalDescription?
Type:
string
(optional)
A description provided when the model approval is set.
certifyForMarketplace?
Type:
boolean |
IResolvable
(optional)
Whether the model package is to be certified to be listed on AWS Marketplace.
For information about listing model packages on AWS Marketplace, see List Your Algorithm or Model Package on AWS Marketplace .
clientToken?
Type:
string
(optional)
A unique token that guarantees that the call to this API is idempotent.
createdBy?
Type:
IResolvable
|
User
(optional)
Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.
customerMetadataProperties?
Type:
IResolvable
| { [string]: string }
(optional)
The metadata properties for the model package.
domain?
Type:
string
(optional)
The machine learning domain of your model package and its components.
Common machine learning domains include computer vision and natural language processing.
driftCheckBaselines?
Type:
IResolvable
|
Drift
(optional)
Represents the drift check baselines that can be used when the model monitor is set using the model package.
environment?
Type:
IResolvable
| { [string]: string }
(optional)
The environment variables to set in the Docker container.
Each key and value in the Environment
string to string map can have length of up to 1024. We support up to 16 entries in the map.
inferenceSpecification?
Type:
IResolvable
|
Inference
(optional)
Defines how to perform inference generation after a training job is run.
lastModifiedBy?
Type:
IResolvable
|
User
(optional)
Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.
lastModifiedTime?
Type:
string
(optional)
The last time the model package was modified.
metadataProperties?
Type:
IResolvable
|
Metadata
(optional)
Metadata properties of the tracking entity, trial, or trial component.
modelApprovalStatus?
Type:
string
(optional)
The approval status of the model. This can be one of the following values.
APPROVED
- The model is approvedREJECTED
- The model is rejected.PENDING_MANUAL_APPROVAL
- The model is waiting for manual approval.
modelMetrics?
Type:
IResolvable
|
Model
(optional)
Metrics for the model.
modelPackageDescription?
Type:
string
(optional)
The description of the model package.
modelPackageGroupName?
Type:
string
(optional)
The model group to which the model belongs.
modelPackageName?
Type:
string
(optional)
The name of the model.
modelPackageStatusDetails?
Type:
IResolvable
|
Model
(optional)
Specifies the validation and image scan statuses of the model package.
modelPackageStatusItem?
Type:
IResolvable
|
Model
(optional)
Represents the overall status of a model package.
modelPackageVersion?
Type:
number
(optional)
The version number of a versioned model.
samplePayloadUrl?
Type:
string
(optional)
The Amazon Simple Storage Service path where the sample payload are stored.
This path must point to a single gzip compressed tar archive (.tar.gz suffix).
sourceAlgorithmSpecification?
Type:
IResolvable
|
Source
(optional)
A list of algorithms that were used to create a model package.
tags?
Type:
Cfn
[]
(optional)
A list of the tags associated with the model package.
For more information, see Tagging AWS resources in the AWS General Reference Guide .
task?
Type:
string
(optional)
The machine learning task your model package accomplishes.
Common machine learning tasks include object detection and image classification.
validationSpecification?
Type:
IResolvable
|
Validation
(optional)
Specifies batch transform jobs that SageMaker runs to validate your model package.
Properties
Name | Type | Description |
---|---|---|
attr | string | The time that the model package was created. |
attr | string | The Amazon Resource Name (ARN) of the model package. |
attr | string | The status of the model package. This can be one of the following values. |
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
logical | string | The logical ID for this CloudFormation stack element. |
node | Construct | The construct tree node associated with this construct. |
ref | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
stack | Stack | The stack in which this element is defined. |
tags | Tag | A list of the tags associated with the model package. |
additional | IResolvable | Additional | A structure of additional Inference Specification. |
additional | IResolvable | IResolvable | Additional [] | An array of additional Inference Specification objects. |
additional | IResolvable | IResolvable | Additional [] | An array of additional Inference Specification objects to be added to the existing array. |
approval | string | A description provided when the model approval is set. |
certify | boolean | IResolvable | Whether the model package is to be certified to be listed on AWS Marketplace. |
client | string | A unique token that guarantees that the call to this API is idempotent. |
created | IResolvable | User | Information about the user who created or modified an experiment, trial, trial component, lineage group, or project. |
customer | IResolvable | { [string]: string } | The metadata properties for the model package. |
domain? | string | The machine learning domain of your model package and its components. |
drift | IResolvable | Drift | Represents the drift check baselines that can be used when the model monitor is set using the model package. |
environment? | IResolvable | { [string]: string } | The environment variables to set in the Docker container. |
inference | IResolvable | Inference | Defines how to perform inference generation after a training job is run. |
last | IResolvable | User | Information about the user who created or modified an experiment, trial, trial component, lineage group, or project. |
last | string | The last time the model package was modified. |
metadata | IResolvable | Metadata | Metadata properties of the tracking entity, trial, or trial component. |
model | string | The approval status of the model. This can be one of the following values. |
model | IResolvable | Model | Metrics for the model. |
model | string | The description of the model package. |
model | string | The model group to which the model belongs. |
model | string | The name of the model. |
model | IResolvable | Model | Specifies the validation and image scan statuses of the model package. |
model | IResolvable | Model | Represents the overall status of a model package. |
model | number | The version number of a versioned model. |
sample | string | The Amazon Simple Storage Service path where the sample payload are stored. |
source | IResolvable | Source | A list of algorithms that were used to create a model package. |
task? | string | The machine learning task your model package accomplishes. |
validation | IResolvable | Validation | Specifies batch transform jobs that SageMaker runs to validate your model package. |
static CFN_RESOURCE_TYPE_NAME | string | The CloudFormation resource type name for this resource class. |
attrCreationTime
Type:
string
The time that the model package was created.
attrModelPackageArn
Type:
string
The Amazon Resource Name (ARN) of the model package.
attrModelPackageStatus
Type:
string
The status of the model package. This can be one of the following values.
PENDING
- The model package creation is pending.IN_PROGRESS
- The model package is in the process of being created.COMPLETED
- The model package was successfully created.FAILED
- The model package creation failed.DELETING
- The model package is in the process of being deleted.
cfnOptions
Type:
ICfn
Options for this resource, such as condition, update policy etc.
cfnProperties
Type:
{ [string]: any }
cfnResourceType
Type:
string
AWS resource type.
creationStack
Type:
string[]
logicalId
Type:
string
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId)
.
node
Type:
Construct
The construct tree node associated with this construct.
ref
Type:
string
Return a string that will be resolved to a CloudFormation { Ref }
for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through Lazy.any({ produce: resource.ref })
.
stack
Type:
Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
tags
Type:
Tag
A list of the tags associated with the model package.
For more information, see Tagging AWS resources in the AWS General Reference Guide .
additionalInferenceSpecificationDefinition?
Type:
IResolvable
|
Additional
(optional)
A structure of additional Inference Specification.
Additional Inference Specification specifies details about inference jobs that can be run with models based on this model package
additionalInferenceSpecifications?
Type:
IResolvable
|
IResolvable
|
Additional
[]
(optional)
An array of additional Inference Specification objects.
additionalInferenceSpecificationsToAdd?
Type:
IResolvable
|
IResolvable
|
Additional
[]
(optional)
An array of additional Inference Specification objects to be added to the existing array.
The total number of additional Inference Specification objects cannot exceed 15. Each additional Inference Specification object specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.
approvalDescription?
Type:
string
(optional)
A description provided when the model approval is set.
certifyForMarketplace?
Type:
boolean |
IResolvable
(optional)
Whether the model package is to be certified to be listed on AWS Marketplace.
For information about listing model packages on AWS Marketplace, see List Your Algorithm or Model Package on AWS Marketplace .
clientToken?
Type:
string
(optional)
A unique token that guarantees that the call to this API is idempotent.
createdBy?
Type:
IResolvable
|
User
(optional)
Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.
customerMetadataProperties?
Type:
IResolvable
| { [string]: string }
(optional)
The metadata properties for the model package.
domain?
Type:
string
(optional)
The machine learning domain of your model package and its components.
Common machine learning domains include computer vision and natural language processing.
driftCheckBaselines?
Type:
IResolvable
|
Drift
(optional)
Represents the drift check baselines that can be used when the model monitor is set using the model package.
environment?
Type:
IResolvable
| { [string]: string }
(optional)
The environment variables to set in the Docker container.
Each key and value in the Environment
string to string map can have length of up to 1024. We support up to 16 entries in the map.
inferenceSpecification?
Type:
IResolvable
|
Inference
(optional)
Defines how to perform inference generation after a training job is run.
lastModifiedBy?
Type:
IResolvable
|
User
(optional)
Information about the user who created or modified an experiment, trial, trial component, lineage group, or project.
lastModifiedTime?
Type:
string
(optional)
The last time the model package was modified.
metadataProperties?
Type:
IResolvable
|
Metadata
(optional)
Metadata properties of the tracking entity, trial, or trial component.
modelApprovalStatus?
Type:
string
(optional)
The approval status of the model. This can be one of the following values.
APPROVED
- The model is approvedREJECTED
- The model is rejected.PENDING_MANUAL_APPROVAL
- The model is waiting for manual approval.
modelMetrics?
Type:
IResolvable
|
Model
(optional)
Metrics for the model.
modelPackageDescription?
Type:
string
(optional)
The description of the model package.
modelPackageGroupName?
Type:
string
(optional)
The model group to which the model belongs.
modelPackageName?
Type:
string
(optional)
The name of the model.
modelPackageStatusDetails?
Type:
IResolvable
|
Model
(optional)
Specifies the validation and image scan statuses of the model package.
modelPackageStatusItem?
Type:
IResolvable
|
Model
(optional)
Represents the overall status of a model package.
modelPackageVersion?
Type:
number
(optional)
The version number of a versioned model.
samplePayloadUrl?
Type:
string
(optional)
The Amazon Simple Storage Service path where the sample payload are stored.
This path must point to a single gzip compressed tar archive (.tar.gz suffix).
sourceAlgorithmSpecification?
Type:
IResolvable
|
Source
(optional)
A list of algorithms that were used to create a model package.
task?
Type:
string
(optional)
The machine learning task your model package accomplishes.
Common machine learning tasks include object detection and image classification.
validationSpecification?
Type:
IResolvable
|
Validation
(optional)
Specifies batch transform jobs that SageMaker runs to validate your model package.
static CFN_RESOURCE_TYPE_NAME
Type:
string
The CloudFormation resource type name for this resource class.
Methods
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
override | Overrides the auto-generated logical ID with a specific ID. |
to | Returns a string representation of this construct. |
protected render |
addDeletionOverride(path)
public addDeletionOverride(path: string): void
Parameters
- path
string
— The path of the value to delete.
Syntactic sugar for addOverride(path, undefined)
.
addDependsOn(target)
public addDependsOn(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
addMetadata(key, value)
public addMetadata(key: string, value: any): void
Parameters
- key
string
- value
any
Add a value to the CloudFormation Resource Metadata.
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.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
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.)
addOverride(path, value)
public addOverride(path: string, value: any): void
Parameters
- path
string
— - The path of the property, you can use dot notation to override values in complex types. - value
any
— - The value.
Adds an override to the synthesized CloudFormation resource.
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,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
would add the overrides
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
The value
argument to addOverride
will not be processed or translated
in any way. Pass raw JSON values in here with the correct capitalization
for CloudFormation. If you pass CDK classes or structs, they will be
rendered with lowercased key names, and CloudFormation will reject the
template.
addPropertyDeletionOverride(propertyPath)
public addPropertyDeletionOverride(propertyPath: string): void
Parameters
- propertyPath
string
— The path to the property.
Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)
public addPropertyOverride(propertyPath: string, value: any): void
Parameters
- propertyPath
string
— The path of the property. - value
any
— The value.
Adds an override to a resource property.
Syntactic sugar for addOverride("Properties.<...>", value)
.
applyRemovalPolicy(policy?, options?)
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
Parameters
- policy
Removal
Policy - options
Removal
Policy Options
Sets the deletion policy of the resource based on the removal policy specified.
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
).
getAtt(attributeName)
public getAtt(attributeName: string): Reference
Parameters
- attributeName
string
— The name of the attribute.
Returns
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. resource.arn
), but this can be used for future compatibility
in case there is no generated attribute.
getMetadata(key)
public getMetadata(key: string): any
Parameters
- key
string
Returns
any
Retrieve a value value from the CloudFormation Resource Metadata.
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.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
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.)
inspect(inspector)
public inspect(inspector: TreeInspector): void
Parameters
- inspector
Tree
— - tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
overrideLogicalId(newLogicalId)
public overrideLogicalId(newLogicalId: string): void
Parameters
- newLogicalId
string
— The new logical ID to use for this stack element.
Overrides the auto-generated logical ID with a specific ID.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected renderProperties(props)
protected renderProperties(props: { [string]: any }): { [string]: any }
Parameters
- props
{ [string]: any }
Returns
{ [string]: any }