cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

`AWS::Amplify::App` - Support for specifying a `buildImage`

Open david-perez opened this issue 2 years ago • 1 comments

Name of the resource

AWS::Amplify::App

Resource name

No response

Description

Currently, one is able to specify custom build images (e.g. from ECR) in which to run the build spec of an AWS Amplify application using the AWS Console: https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html

However, there is no way to do so in CFN: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-app.html#cfn-amplify-app-buildspec. You can specify the buildSpec, but not the buildImage.

And hence no way to do so in the CDK: https://github.com/aws/aws-cdk/issues/15016

Other Details

No response

david-perez avatar Aug 30 '22 23:08 david-perez

I recently had a similar question (#1140), and there seems to be an environment variable called _CUSTOM_IMAGE. I haven't tried it yet, though.

dbartholomae avatar Aug 31 '22 19:08 dbartholomae

Hi @david-perez , apologies for the delay here. @dbartholomae is correct, you can actually set the custom image as an environment variable _CUSTOM_IMAGE with a value of your ECR registry. In CloudFormation, this would be something like

MyApp:
  Type : AWS::Amplify::App
  Properties:
      EnvironmentVariables:
          - Name: _CUSTOM_IMAGE
            Value: 1234.ecr.aws/foo/build-image.al2-20220929223003

ferdingler avatar Sep 30 '22 17:09 ferdingler

While _CUSTOM_IMAGE works, it's not documented: https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html

david-perez avatar Oct 03 '22 08:10 david-perez

+1

dannylinden avatar Dec 12 '23 10:12 dannylinden