aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

AWS::Amplify::App with backend environments support #873

Open emilioschepis opened 3 years ago

emilioschepis commented 3 years ago

2. Scope of request

Currently, CloudFormation support for Amplify apps revolves around "frontend" resources (AutoBranchCreationConfig,BuildSpec,Repository...).

This issue requests support for:

3. Expected behavior

It should be possible to define frontend branches (already supported), backend environments, and automatically associate the two.

5. Helpful Links to speed up research and evaluation

Current CloudFormation support: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Amplify.html AWS CLI commands for amplify: https://docs.aws.amazon.com/cli/latest/reference/amplify/index.html#cli-aws-amplify

6. Category (required) - Will help with tagging and be easier to find by other users to +1

Front-end Web & Mobile

7. Any additional context (optional)

This would ideally be used to expand AWS CDK's L1 and L2 constructs for AWS Amplify.

swaminator commented 3 years ago

@emilioschepis can i understand a bit more about your usecase? You could use the Amplify CLI to automatically provision the backend infrastructure and have the CF templates associated.

emilioschepis commented 3 years ago

Hi @swaminator , thank you for your reply. I think that the term "backend" could have been a bit misleading in this context. I do not need to define backend resources (like Auth, API, Storage...)

What i refer to is the "Backend Environment" that I can see from the Amplify console (i.e. dev):

Backend environment example

I would like to ideally define them in code. To give you an example of the desired use case in AWS CDK:

// Using the L2 construct for AWS Amplify
const amplifyApp = new amplify.App(this, "MyApplicationName", {});

// We can already create branches (AWS::Amplify::Branch)
const mainBranch = amplifyApp.addBranch("main", {});

// ⬇️ This is not currently an option, as CloudFormation does not support this resource ⬇️ 
const devEnvironment = amplifyApp.addBackendEnvironment("dev", {});
const prodEnvironment = amplifyApp.addBackendEnvironment("prod", {});

// It would be nice to also be able to connect the two, like we can do on the Amplify Console
// My guess is this would be an attribute of the AWS::Amplify::Branch definition
mainBranch.setBackendEnvironment(prodEnvironment);
brianterry commented 3 years ago

Thank you for submitting the issue. We are researching.

emilioschepis commented 3 years ago

Thank you @brianterry , I'll keep an eye on the issue.

johnf commented 7 months ago

I think this needs to add support for backendEnvironmentArn referenced in https://docs.aws.amazon.com/amplify/latest/APIReference/API_Branch.html