Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: env deploy fails to update EnvManagerRole duplicated statement #5956

Open
davidPaymefy opened this issue Oct 18, 2024 · 0 comments
Open
Labels
type/bug Issues that are bugs.

Comments

@davidPaymefy
Copy link

Description:

copilot env deploy fails to update EnvManagerRole because it duplicates sid: PatchPutObjectsToArtifactBucket.

Details:

This environment was created with a much earlier copilot version around October 2021. Can't remember which specific version was.

current copilot version: v1.33.4

manifest:
name: prod
type: Environment

Observed result:

copilot cli response:

Name: prod
✘ Unable to update the environment's manager role with upload artifacts permission
✘ upload artifacts for environment prod: ensure env manager role has permissions to upload: update environment template with PutObject permissions: wait until stack example-prod update is complete: ResourceNotReady: failed waiting for successful resource state

CloudFromation stack events:

Captura de pantalla 2024-10-18 a les 15 34 52

Expected result:

I expect it to deploy the environment successfully.

Debugging:

From CloudTrail:

PatchPutObjectsToArtifactBucket statement is duplicated.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "s3:PutObject",
        "s3:PutObjectAcl"
      ],
      "Resource": [
        "arn:aws:s3:::stackset-example-infras-pipelinebuiltartifactbuc-1j0jzty5ft3op",
        "arn:aws:s3:::stackset-example-infras-pipelinebuiltartifactbuc-1j0jzty5ft3op/*"
      ],
      "Effect": "Allow",
      "Sid": "PatchPutObjectsToArtifactBucket"
    },
    {
      "Action": [
        "s3:PutObject",
        "s3:PutObjectAcl"
      ],
      "Resource": [
        "arn:aws:s3:::stackset-example-infras-pipelinebuiltartifactbuc-1j0jzty5ft3op",
        "arn:aws:s3:::stackset-example-infras-pipelinebuiltartifactbuc-1j0jzty5ft3op/*"
      ],
      "Effect": "Allow",
      "Sid": "PatchPutObjectsToArtifactBucket"
    },
    {
      "Action": [
        "logs:GetLogRecord",
        "logs:GetQueryResults",
        "logs:StartQuery",
        "logs:GetLogEvents",
        "logs:DescribeLogStreams",
        "logs:StopQuery",
        "logs:TestMetricFilter",
        "logs:FilterLogEvents",
        "logs:GetLogGroupFields",
        "logs:GetLogDelivery"
      ],
      "Resource": "*",
      "Effect": "Allow",
      "Sid": "CloudwatchLogs"
    },
    ...
@davidPaymefy davidPaymefy added the type/bug Issues that are bugs. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issues that are bugs.
Projects
None yet
Development

No branches or pull requests

1 participant