
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@aws-cdk/aws-cloudformation
Advanced tools
This module is part of the AWS Cloud Development Kit project.
This module contains Actions that allows you to deploy to CloudFormation from AWS CodePipeline.
For example, the following code fragment defines a pipeline that automatically deploys a CloudFormation template directly from a CodeCommit repository, with a manual approval step in between to confirm the changes:
example Pipeline to deploy CloudFormation
See the AWS documentation for more details about using CloudFormation in CodePipeline.
This package defines the following actions:
replaceOnFailure
is set to true
, in which case it will be destroyed and recreated).Custom Resources are CloudFormation resources that are implemented by arbitrary user code. They can do arbitrary lookups or modifications during a CloudFormation synthesis run.
You will typically use Lambda to implement a Construct implemented as a
Custom Resource (though SNS topics can be used as well). Your Lambda function
will be sent a CREATE
, UPDATE
or DELETE
message, depending on the
CloudFormation life cycle, and can return any number of output values which
will be available as attributes of your Construct. In turn, those can
be used as input to other Constructs in your model.
In general, consumers of your Construct will not need to care whether it is implemented in term of other CloudFormation resources or as a custom resource.
Note: when implementing your Custom Resource using a Lambda, use
a SingletonLambda
so that even if your custom resource is instantiated
multiple times, the Lambda will only get uploaded once.
Sample of a Custom Resource that copies files into an S3 bucket during deployment
(implementation of actual copy.py
operation elided).
interface CopyOperationProps {
sourceBucket: IBucket;
targetBucket: IBucket;
}
class CopyOperation extends Construct {
constructor(parent: Construct, name: string, props: DemoResourceProps) {
super(parent, name);
const lambdaProvider = new SingletonLambda(this, 'Provider', {
uuid: 'f7d4f730-4ee1-11e8-9c2d-fa7ae01bbebc',
code: new LambdaInlineCode(resources['copy.py']),
handler: 'index.handler',
timeout: 60,
runtime: LambdaRuntime.Python3,
});
new CustomResource(this, 'Resource', {
lambdaProvider,
properties: {
sourceBucketArn: props.sourceBucket.bucketArn,
targetBucketArn: props.targetBucket.bucketArn,
}
});
}
}
More examples are in the example
directory, including an example of how to use
the cfnresponse
module that is provided for you by CloudFormation.
See the following section of the docs on details to write Custom Resources:
0.10.0 (2018-09-27)
This release introduces a better way to "escape" L2 constructs in case of missing features by adding the ability to add arbitrary overrides for resource properties:
const bucket = new s3.Bucket(this, 'L2Bucket');
// access L1
const bucketResource = bucket.findChild('Resource') as s3.cloudformation.BucketResource;
// strongly-typed overrides
bucketResource.propertyOverrides.bucketName = 'amzn-s3-demo-bucket';
// weakly-typed overrides
bucketResource.addPropertyOverride('BucketName', 'amzn-s3-demo-bucket1');
TagManager
has changed. initialTags
is now passed inside a props object.@aws-cdk/util
is no longer available@aws-cdk/cfnspec: Updated [CloudFormation resource specification] to v2.8.0
([@RomainMuller] in #767)
New Construct Libraries
@aws-cdk/aws-amazonmq
@aws-cdk/aws-iot1click
New Resource Types
Attribute Changes
Property Changes
AWS::ApiGateway::Deployment DeploymentCanarySettings (added)
AWS::ApiGateway::Method AuthorizationScopes (added)
AWS::ApiGateway::Stage AccessLogSetting (added)
AWS::ApiGateway::Stage CanarySetting (added)
AWS::AutoScaling::AutoScalingGroup LaunchTemplate (added)
AWS::CodeBuild::Project LogsConfig (added)
AWS::CodeBuild::Project SecondaryArtifacts (added)
AWS::CodeBuild::Project SecondarySources (added)
AWS::CodeDeploy::DeploymentGroup Ec2TagSet (added)
AWS::CodeDeploy::DeploymentGroup OnPremisesTagSet (added)
AWS::EC2::FlowLog LogDestination (added)
AWS::EC2::FlowLog LogDestinationType (added)
AWS::EC2::FlowLog DeliverLogsPermissionArn.Required (changed)
AWS::EC2::FlowLog LogGroupName.Required (changed)
AWS::EC2::VPCEndpoint IsPrivateDnsEnabled (deleted)
AWS::EC2::VPCEndpoint PrivateDnsEnabled (added)
AWS::EC2::VPCEndpoint RouteTableIds.DuplicatesAllowed (added)
AWS::EC2::VPCEndpoint SecurityGroupIds.DuplicatesAllowed (added)
AWS::EC2::VPCEndpoint SubnetIds.DuplicatesAllowed (added)
AWS::EC2::VPCEndpoint VPCEndpointType.UpdateType (changed)
AWS::ECS::Service SchedulingStrategy (added)
AWS::ECS::Service ServiceRegistries.UpdateType (changed)
AWS::ElastiCache::ReplicationGroup NodeGroupConfiguration.UpdateType (changed)
AWS::ElastiCache::ReplicationGroup NumNodeGroups.UpdateType (changed)
AWS::RDS::DBCluster EngineMode (added)
AWS::RDS::DBCluster ScalingConfiguration (added)
AWS::SageMaker::NotebookInstance LifecycleConfigName.UpdateType (changed)
Property Type Changes
AWS::ApiGateway::Deployment.AccessLogSetting (added)
AWS::ApiGateway::Deployment.CanarySetting (added)
AWS::ApiGateway::Deployment.DeploymentCanarySettings (added)
AWS::ApiGateway::Stage.AccessLogSetting (added)
AWS::ApiGateway::Stage.CanarySetting (added)
AWS::AutoScaling::AutoScalingGroup.LaunchTemplateSpecification (added)
AWS::CodeBuild::Project.CloudWatchLogsConfig (added)
AWS::CodeBuild::Project.LogsConfig (added)
AWS::CodeBuild::Project.S3LogsConfig (added)
AWS::CodeDeploy::DeploymentGroup.EC2TagSet (added)
AWS::CodeDeploy::DeploymentGroup.EC2TagSetListObject (added)
AWS::CodeDeploy::DeploymentGroup.OnPremisesTagSet (added)
AWS::CodeDeploy::DeploymentGroup.OnPremisesTagSetListObject (added)
AWS::EC2::SpotFleet.ClassicLoadBalancer (added)
AWS::EC2::SpotFleet.ClassicLoadBalancersConfig (added)
AWS::EC2::SpotFleet.FleetLaunchTemplateSpecification (added)
AWS::EC2::SpotFleet.LaunchTemplateConfig (added)
AWS::EC2::SpotFleet.LaunchTemplateOverrides (added)
AWS::EC2::SpotFleet.LoadBalancersConfig (added)
AWS::EC2::SpotFleet.TargetGroup (added)
AWS::EC2::SpotFleet.TargetGroupsConfig (added)
AWS::ECS::TaskDefinition.DockerVolumeConfiguration (added)
AWS::ECS::TaskDefinition.RepositoryCredentials (added)
AWS::ECS::TaskDefinition.Tmpfs (added)
AWS::Events::Rule.SqsParameters (added)
AWS::RDS::DBCluster.ScalingConfiguration (added)
AWS::ApiGateway::Deployment.StageDescription AccessLogSetting (added)
AWS::ApiGateway::Deployment.StageDescription CanarySetting (added)
AWS::ApiGateway::Method.Integration ConnectionId (added)
AWS::ApiGateway::Method.Integration ConnectionType (added)
AWS::ApiGateway::Method.Integration TimeoutInMillis (added)
AWS::ApiGateway::UsagePlan.ApiStage Throttle (added)
AWS::CodeBuild::Project.Artifacts ArtifactIdentifier (added)
AWS::CodeBuild::Project.Source SourceIdentifier (added)
AWS::CodeBuild::Project.VpcConfig SecurityGroupIds.Required (changed)
AWS::CodeBuild::Project.VpcConfig Subnets.Required (changed)
AWS::CodeBuild::Project.VpcConfig VpcId.Required (changed)
AWS::CodeDeploy::DeploymentGroup.EC2TagFilter Key.Documentation (changed)
AWS::CodeDeploy::DeploymentGroup.EC2TagFilter Type.Documentation (changed)
AWS::CodeDeploy::DeploymentGroup.EC2TagFilter Value.Documentation (changed)
AWS::CodeDeploy::DeploymentGroup.TagFilter Key.Documentation (changed)
AWS::CodeDeploy::DeploymentGroup.TagFilter Type.Documentation (changed)
AWS::CodeDeploy::DeploymentGroup.TagFilter Value.Documentation (changed)
AWS::EC2::SpotFleet.SpotFleetRequestConfigData InstanceInterruptionBehavior (added)
AWS::EC2::SpotFleet.SpotFleetRequestConfigData LaunchTemplateConfigs (added)
AWS::EC2::SpotFleet.SpotFleetRequestConfigData LoadBalancersConfig (added)
AWS::EC2::SpotFleet.SpotPlacement Tenancy (added)
AWS::ECS::Service.ServiceRegistry ContainerName (added)
AWS::ECS::Service.ServiceRegistry ContainerPort (added)
AWS::ECS::Service.ServiceRegistry Port.UpdateType (changed)
AWS::ECS::Service.ServiceRegistry RegistryArn.UpdateType (changed)
AWS::ECS::TaskDefinition.ContainerDefinition RepositoryCredentials (added)
AWS::ECS::TaskDefinition.LinuxParameters SharedMemorySize (added)
AWS::ECS::TaskDefinition.LinuxParameters Tmpfs (added)
AWS::ECS::TaskDefinition.Volume DockerVolumeConfiguration (added)
AWS::ElastiCache::ReplicationGroup.NodeGroupConfiguration NodeGroupId (added)
AWS::Events::Rule.Target SqsParameters (added)
AWS::RDS::OptionGroup.OptionConfiguration OptionSettings.DuplicatesAllowed (added)
AWS::RDS::OptionGroup.OptionConfiguration OptionSettings.ItemType (added)
AWS::RDS::OptionGroup.OptionConfiguration OptionSettings.Type (changed)
FAQs
The CDK Construct Library for AWS::CloudFormation
The npm package @aws-cdk/aws-cloudformation receives a total of 69,773 weekly downloads. As such, @aws-cdk/aws-cloudformation popularity was classified as popular.
We found that @aws-cdk/aws-cloudformation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.