aws-amplify / aws-amplify/amplify-cli

Expose more AmplifyDependentResourcesAttributes for use with CDK

Open
#11,739 0 comments 0 reactions 0 assignees View on GitHub
extensibility feature-request p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Is this feature request related to a new or existing Amplify category?

New category

### Is this related to another service?

CDK, Hosting, API

### Describe the feature you'd like to request

Today, in my `amplify/backend/types` directory there's an auto generated file called `amplify-dependent-resources-ref.d.ts` which shows me all of the Amplify-generated resources that I can access from a custom CDK resource. I provided an example below.

```
export type AmplifyDependentResourcesAttributes = {
"api": {
"smwuserdata": {
"GraphQLAPIEndpointOutput": "string",
"GraphQLAPIIdOutput": "string"
}
},
"auth": {
"smwnextsite4ce569c9": {
"AppClientID": "string",
"AppClientIDWeb": "string",
"IdentityPoolId": "string",
"IdentityPoolName": "string",
"UserPoolArn": "string",
"UserPoolId": "string",
"UserPoolName": "string"
}
},
"function": {
"oncognitoconfirmation": {
"Arn": "string",
"LambdaExecutionRole": "string",
"LambdaExecutionRoleArn": "string",
"Name": "string",
"Region": "string"
},
},
"storage": {
"smwStravaAthleteIds": {
"Arn": "string",
"Name": "string",
"PartitionKeyName": "string",
"PartitionKeyType": "string",
"Region": "string",
"StreamArn": "string"
}
}
}
```

I'd love to see more items available in that list.

For example, today I don't see any attributes related to my Hosting resource even though I initially configured it with the CLI (and later completed everything in the aws console). It would be great if I could access the url that my site is hosted at programmatically with CDK.

Another example, I don't see the DynamoDB table that is backing my App Sync graphql API.

### Describe the solution you'd like

Expose additional resources within the `AmplifyDependentResourcesAttributes` file so they can be referenced in custom AWS resources created with CDK (https://docs.amplify.aws/cli/custom/cdk/)

### Describe alternatives you've considered

I hardcode values into CDK. This is clunky and prone to errors, and doesn't play nice with having multiple environments.

You can try to export additional values by altering the cloudformation-template. But you at still limited in terms of whatever can be added to that template. And you don't have access to the "hosting" resource template as far as I understand.

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.