Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@aws-cdk/aws-ecr
Advanced tools
@aws-cdk/aws-ecr is an AWS Cloud Development Kit (CDK) library that allows you to define and manage Amazon Elastic Container Registry (ECR) resources using code. ECR is a fully managed Docker container registry that makes it easy to store, manage, and deploy Docker container images.
Create a new ECR Repository
This code sample demonstrates how to create a new ECR repository named 'my-repo' using the AWS CDK.
const ecr = require('@aws-cdk/aws-ecr');
const cdk = require('@aws-cdk/core');
class MyStack extends cdk.Stack {
constructor(scope, id, props) {
super(scope, id, props);
new ecr.Repository(this, 'MyRepository', {
repositoryName: 'my-repo'
});
}
}
const app = new cdk.App();
new MyStack(app, 'MyStack');
Add lifecycle policy to ECR Repository
This code sample demonstrates how to add a lifecycle policy to an ECR repository to retain only the last 5 images with the 'prod' tag.
const ecr = require('@aws-cdk/aws-ecr');
const cdk = require('@aws-cdk/core');
class MyStack extends cdk.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const repository = new ecr.Repository(this, 'MyRepository', {
repositoryName: 'my-repo'
});
repository.addLifecycleRule({
tagPrefixList: ['prod'],
maxImageCount: 5
});
}
}
const app = new cdk.App();
new MyStack(app, 'MyStack');
Grant permissions to a user
This code sample demonstrates how to grant pull permissions to an IAM user for an ECR repository.
const ecr = require('@aws-cdk/aws-ecr');
const iam = require('@aws-cdk/aws-iam');
const cdk = require('@aws-cdk/core');
class MyStack extends cdk.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const repository = new ecr.Repository(this, 'MyRepository', {
repositoryName: 'my-repo'
});
const user = new iam.User(this, 'MyUser');
repository.grantPull(user);
}
}
const app = new cdk.App();
new MyStack(app, 'MyStack');
The aws-sdk package is the official AWS SDK for JavaScript, which provides a comprehensive set of tools for interacting with AWS services, including ECR. Unlike @aws-cdk/aws-ecr, which is used for defining infrastructure as code, aws-sdk is used for making API calls to AWS services.
The serverless framework is a toolkit for deploying and operating serverless architectures. It supports various AWS services, including ECR, for managing container images. While @aws-cdk/aws-ecr focuses on infrastructure as code, serverless provides a higher-level abstraction for deploying serverless applications.
Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services, including AWS ECR. Terraform and @aws-cdk/aws-ecr both serve the purpose of defining cloud infrastructure, but Terraform is cloud-agnostic and can be used with multiple cloud providers.
This module is part of the AWS Cloud Development Kit project.
0.9.0 -- 2018-09-10
The headliners of this release are .NET support, and a wealth of commits by external contributors who are stepping up to fix the CDK for their use cases! Thanks all for the effort put into this release!
cdk init
template for C# projects ([@mpiroc] in #617, #643).addBuildToPipeline
on Project ([@skinny85] in 783dcb3).addToPipeline
on Repository ([@skinny85] in #616).InstanceSize.Nano
([@rix0rrr] in #581)extractMetric()
helper function ([@rix0rrr] in #676).addToPipeline
on Bucket ([@skinny85] in c8b7a49)..ref
attributes ([@rix0rrr] in #627).any
to Arn
, for example) to reduce typing mistakes ([@rix0rrr] in #629).export()/import()
capabilities ([@rix0rrr] in #630).QueueRef.encryptionMasterKey
readonly ([@RomainMuller] in #650).cdk init
([@rix0rrr] in #587).@aws-cdk/cfnspec: Updated [CloudFormation resource specification] to v2.6.0
([@RomainMuller] in #594)
New AWS Construct Library
@aws-cdk/aws-sagemaker
supports AWS::SageMaker resourcesNew Resource Types
Attribute Changes
Property Changes
AWS::AppSync::DataSource HttpConfig (added)
AWS::DAX::Cluster SSESpecification (added)
AWS::DynamoDB::Table Stream (added)
AWS::DynamoDB::Table AutoScalingSupport (added)
AWS::EC2::VPCEndpoint IsPrivateDnsEnabled (added)
AWS::EC2::VPCEndpoint SecurityGroupIds (added)
AWS::EC2::VPCEndpoint SubnetIds (added)
AWS::EC2::VPCEndpoint VPCEndpointType (added)
AWS::EC2::VPCEndpoint RouteTableIds.DuplicatesAllowed (deleted)
AWS::EC2::VPCPeeringConnection PeerRegion (added)
AWS::EFS::FileSystem ProvisionedThroughputInMibps (added)
AWS::EFS::FileSystem ThroughputMode (added)
AWS::EMR::Cluster KerberosAttributes (added)
AWS::Glue::Classifier JsonClassifier (added)
AWS::Glue::Classifier XMLClassifier (added)
AWS::Glue::Crawler Configuration (added)
AWS::Lambda::Lambda DLQConfigurationSupport (added)
AWS::Neptune::DBInstance DBSubnetGroupName.UpdateType (changed)
AWS::SNS::Subscription DeliveryPolicy (added)
AWS::SNS::Subscription FilterPolicy (added)
AWS::SNS::Subscription RawMessageDelivery (added)
AWS::SNS::Subscription Region (added)
AWS::SQS::Queue Tags (added)
AWS::ServiceDiscovery::Service HealthCheckCustomConfig (added)
Property Type Changes
AWS::AppSync::DataSource.HttpConfig (added)
AWS::DAX::Cluster.SSESpecification (added)
AWS::EMR::Cluster.KerberosAttributes (added)
AWS::Glue::Classifier.JsonClassifier (added)
AWS::Glue::Classifier.XMLClassifier (added)
AWS::ServiceDiscovery::Service.HealthCheckCustomConfig (added)
AWS::CloudFront::Distribution.CacheBehavior FieldLevelEncryptionId (added)
AWS::CloudFront::Distribution.DefaultCacheBehavior FieldLevelEncryptionId (added)
AWS::CodeBuild::Project.Artifacts EncryptionDisabled (added)
AWS::CodeBuild::Project.Artifacts OverrideArtifactName (added)
AWS::CodeBuild::Project.Environment Certificate (added)
AWS::CodeBuild::Project.Source ReportBuildStatus (added)
AWS::ServiceDiscovery::Service.DnsConfig RoutingPolicy (added)
AWS::WAF::WebACL.ActivatedRule Action.Required (changed)
@aws-cdk/cfnspec: Updated Serverless Application Model (SAM) Resource Specification ([@RomainMuller] in #594)
Property Changes
Property Type Changes
AWS::Serverless::Function.SQSEvent (added)
AWS::Serverless::Function.EventSource Properties.Types (changed)
FAQs
The CDK Construct Library for AWS::ECR
The npm package @aws-cdk/aws-ecr receives a total of 178,297 weekly downloads. As such, @aws-cdk/aws-ecr popularity was classified as popular.
We found that @aws-cdk/aws-ecr 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
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.