Open guitarrapc opened 2 months ago
set Push = false
for pulumi preview
, and Push = true
for pulumi up
. This can be archived by Deployment.Instance.IsDryRun
.
// before
var image = new Pulumi.DockerBuild.Image($"dummy-image", new()
{
Push = true, // cause error when ECR is not yet created on preview.
// any other parameters
};
// after
var image = new Pulumi.DockerBuild.Image($"dummy-image", new()
{
Push = !Deployment.Instance.IsDryRun, // Deployment.Instance.IsDryRun will be true on `pulumi preview` = true, false on `pulumi up`.
// any other parameters
};
Seems relate to https://github.com/pulumi/pulumi-docker-build/issues/252. If this is by design, please close this issue.
What happened?
Pulumi.DockerBuild.Image
shows an error onpulumi preview
when the ECR repository has not yet been created, but it does create the repository at the same time the docker build is performed. However,pulumi preview
succeeds if the ECR repository already exists. SincePulumi.Docker.Image
can preview even when the ECR and Docker are created at the same time, is this by design, or am I missing something?Error meesage.
Example
pulumi preview
failure sample.pulumi preview
success sample, just changed Tags not usePulumi.Ouput.Apply
and change to literal.Output of
pulumi about
Additional context
Example code is logically same as official api-docs https://www.pulumi.com/registry/packages/docker-build/api-docs/image/ do.
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).