- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试做一些看起来相当合乎逻辑和直接的事情。
我正在使用 AWS CDK 来配置 ecr 存储库:
repository = ecr.Repository(
self,
id="Repo",
repository_name=ecr_repo_name,
removal_policy=core.RemovalPolicy.DESTROY
)
然后我有一个 Dockerfile,它位于我的项目的根目录中,我试图将其推送到部署中的同一个 ECR 存储库。
assets = DockerImageAsset(
self,
"S3_text_image",
directory=str(Path(__file__).parent.parent),
repository_name=ecr_repo_name
)
部署正常并继续进行,并创建了 ECR 存储库,但镜像被推送到默认位置
aws-cdk/assets
如何让部署将我的 Dockerfile 发送到我希望它存在的确切 ECR 存储库?
最佳答案
AWS CDK 弃用了 repositoryName
属性(property)在 DockerImageAsset
. GitHub 上有几个问题引用了这个问题。见 this comment来自其中一位开发人员:
At the moment the CDK comes with 2 asset systems:
The legacy one (currently still the default), where you get to specify a repositoryName per asset, and the CLI will create and push to whatever ECR repository you name.
The new one (will become the default in the future), where a single ECR repository will be created by doing cdk bootstrap and all images will be pushed into it. The CLI will not create the repository any more, it must already exist. IIRC this was done to limit the permissions required for deployments. @eladb, can you help me remember why we chose to do it this way?
Use Case
I would like to use this feature to completely deploy my local image source code to ECR for me using an ECR repo that I have previously created in my CDK app or more importantly outside the app using an arn. The biggest problem is that the image cannot be completely abstracted into the assets repo because of auditing and semantic versioning.
关于amazon-web-services - aws cdk 将镜像推送到 ECR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67392204/
我正在尝试引用几个子网来创建 ec2 实例,但我有点卡住了。 假设我有这个: const vpc = new Vpc(this, 'gwc-vpc', { cidr: "10.20.
我们正在使用 AWS CDK 来创建我们的无服务器 REST API。但是,有大量端点,有时我们必须销毁和重新部署我们的堆栈。为了防止 REST API URL 随每次部署而更改,我计划在一个堆栈中创
我看到了各种使用 AWS CDK 的示例,其中一些使用 aws-cdk-lib,另一些使用 @aws-cdk/core。这些之间有什么区别,什么时候应该使用一个或另一个? 最佳答案 aws-cdk-l
我看到了各种使用 AWS CDK 的示例,其中一些使用 aws-cdk-lib,另一些使用 @aws-cdk/core。这些之间有什么区别,什么时候应该使用一个或另一个? 最佳答案 aws-cdk-l
我是 CDK 的新手,需要了解高级构造与低级构造之间的区别。谁能用简单的话解释一下:) 热烈的问候。 最佳答案 CDK 旨在让任何人都能轻松创建具有预配置默认值的组件。这意味着您可以(使用更高级别的构
我不想使用我的默认 aws 配置文件和帐户进行 cdk 开发 所以我创建了一个新帐户和一个新的个人资料 cdkprof使用 aws configure --profile cdkprof . 我已经在
我有一个在 cdk.context.json 中存储一些键值的用例,但是如果 cdk.context.json 不存在或者它不包含我希望 CDK 回退到其他代码来发现的键值(value)。 例如,假设
我创建了一个将部署在多个区域的 CDK 堆栈。其中一种构造只能部署在一个地区。在 Cloudformation 中,我只是向资源添加一个条件,但我还没有找到一种方法来对 CDK 构造做类似的事情。 可
以下CDK代码 const queue = new sqs.Queue(this, 'my-sqs-queue', { visibilityTimeout: cdk.Duratio
Use an AWS CloudFormation Parameter AWS CDK 的部分提到了如何自定义您的 AWS CloudFormation 模板。指的是云形成模板 .我想将参数添加到我的
@aws-cdk/pipelines 的文档似乎表明可以使用 codePipeline Prop 将 CDK 管道添加到现有的@aws-cdk/aws-codepipeline/Pipeline:ht
我遇到了一个问题,我们想要确保在 CloudFormation 资源的命名中遵循一些约定。这个想法是我们使用 CDK Aspects来处理资源。一个简单的例子: export class Bucket
我正在寻找一种方法来指定我的项目中堆栈的部署顺序。 我知道我可以添加依赖项,但是这些堆栈不相互依赖,我可能想稍后删除一些。 我有一个服务框架,每个其他堆栈(例如 rds)都需要这些服务框架。这些都是在
是否可以使用 AWS CDK CLI 以某种方式获取另一个堆栈所依赖的堆栈列表?例如,给定一个类似于以下内容的堆栈列表: const app = new App(); const alphaStack
我正在使用 CDK Python API 定义 Glue 爬虫,但是,CDK 生成的模板在爬虫资源中包含空的“目标” block 。 我一直没能找到一个例子来模仿。我试过改变目标对象的定义,但对象定义
我们正在开发一个多账户 CDK 应用程序,并在 CodeBuild 上进行持续部署。我们知道 CDK authentication issues所以我们使用 $ aws sts assume-role
aws-cdk 允许您合成一个堆栈 - 这会产生许多文件 - 包括 .template.json 文件。 可以在没有 aws-cdk 工具的情况下部署这个 .template.json 文件吗?还是设
是否可以使用 aws-cdk 部署到 localstack? 想过从无服务器切换到 cdk,但除了 aws SAM 之外找不到任何其他本地测试选项。 最佳答案 我现在正在应对同样的挑战。我得到的方法是
我的 CDK 堆栈包含太多参数(子网 ID、API URL),无法在命令行中指定。所以我想将它们保存在单独的文件中,例如 dev.properties 或 prod.json。来自 cdk.json
我的 CDK 堆栈包含太多参数(子网 ID、API URL),无法在命令行中指定。所以我想将它们保存在单独的文件中,例如 dev.properties 或 prod.json。来自 cdk.json
我是一名优秀的程序员,十分优秀!