#✅ - aws amplify deploy error

13 messages · Page 1 of 1 (latest)

gilded imp
#

BootstrapDetectionError: Unable to detect CDK bootstrap stack due to permission issues.

Resolution: Ensure that AWS credentials have an IAM policy that grants read access to 'arnawsssm:::parameter/cdk-bootstrap/*' SSM parameters.

Cause: amplify-d33tugq0dyhw9o-master-branch-45f18e99bf: This CDK deployment requires bootstrap stack version '6', but during the confirmation via SSM parameter /cdk-bootstrap/hnb659fds/version the following error occurred: AccessDeniedException: User: arnawssts::264748200621:assumed-role/AemiliaControlPlaneLambda-CodeBuildRole-WZ7YQ9FM4OVR/AWSCodeBuild-6bf55433-cd92-4cf9-aaa3-215a917afced is not authorized to perform: ssm:GetParameter on resource: arnawsssm:us-east-2:264748200621:parameter/cdk-bootstrap/hnb659fds/version because no identity-based policy allows the ssm:GetParameter action

pine pivot
#

@gilded imp issue appears to be similar to https://github.com/aws-amplify/amplify-backend/issues/2222
Could you verify if the Amplify App on the console does have service role attached under general setting?
https://github.com/aws-amplify/amplify-backend/issues/2222#issuecomment-2476765553

GitHub

Environment information System: OS: macOS 15.1 CPU: (11) arm64 Apple M3 Pro Memory: 111.02 MB / 18.00 GB Shell: /bin/zsh Binaries: Node: 22.11.0 - ~/Library/pnpm/node Yarn: undefined - undefined np...

gilded imp
#

Completed Backend Build

162
2024-11-20T11:00:25.880Z [INFO]: ## Starting Frontend Build
163

Starting phase: build

164

Executing command: npm run build

165
2024-11-20T11:00:26.147Z [INFO]: > [email protected] build
166

react-scripts build && mv build dist
167
2024-11-20T11:00:27.288Z [INFO]: Creating an optimized production build...
168
2024-11-20T11:00:27.955Z [INFO]: Failed to compile.
169
2024-11-20T11:00:27.955Z [INFO]: Module not found: Error: Can't resolve './amplify_outputs.json' in '/codebuild/output/src3365155142/src/eco-save-calculator/src'
170
2024-11-20T11:00:27.973Z [ERROR]: !!! Build failed
171
2024-11-20T11:00:27.973Z [ERROR]: !!! Error: Command failed with exit code 1
172
2024-11-20T11:00:27.973Z [INFO]: # Starting environment caching...
173
2024-11-20T11:00:27.974Z [INFO]: # Uploading environment cache artifact...
174
2024-11-20T11:00:28.053Z [INFO]: # Uploaded environment cache artifact
175
2024-11-20T11:00:28.053Z [INFO]: # Environment caching completed

pine pivot
#

@gilded imp did the backend build start? it does appear the backend build ran.
can you provide us the amplify.yml here?

this should typically contain

backend:
  phases:
    build:
      commands:
        - npm ci --prefer-offline
        - npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
gilded imp
#

Hey @pine pivot

#

version: 1
backend:
  phases:
    build:
      commands:
        - npm ci --cache .npm --prefer-offline --force
        # Backend build
        - echo "Starting backend build"
        - npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
        # Ensure amplify_outputs.json is in the right location for your build
        - cp src/amplify_outputs.json ./
        - cd src
frontend:
  phases:
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: dist
    files:
      - '/*'
  cache:
    paths:
      - node_modules/
/*  # Cache node_modules for both frontend and backend for faster builds
      - .npm/**/*  # Cache npm modules for frontend as well
 
environment:
  variables:
    GOOGLE_API_KEY: ${GOOGLE_API_KEY}
    REACT_APP_AWS_ACCESS_KEY_ID: ${REACT_APP_AWS_ACCESS_KEY_ID}
    REACT_APP_AWS_REGION: ${REACT_APP_AWS_REGION}
    REACT_APP_AWS_SECRET_ACCESS_KEY: ${REACT_APP_AWS_SECRET_ACCESS_KEY}

#

// src/config.js
export const GOOGLE_API_KEY = process.env.REACT_APP_GOOGLE_API_KEY;
export const AWS_CONFIG = {
    accessKeyId: process.env.REACT_APP_AWS_ACCESS_KEY_ID,
    region: process.env.REACT_APP_AWS_REGION,
    secretAccessKey: process.env.REACT_APP_AWS_SECRET_ACCESS_KEY,
};

#

How to access env variables during build

#

I got 404 and ses not working for me if I deploy and use

pine pivot
pine pivot
#

oops realized i never hit enter on this.

hey are you still running into the Unable to detect CDK bootstrap stack due to permission issues. error? it appears the backend build did deploy and generate the outputs file.
are you still running into deploy issues

gilded imp
#

No it’s resolved now

rigid agateBOT
#

✅ - aws amplify deploy error