aws / aws/aws-cdk

AppConfig: Get latest deployed configuration

Open
#29,162 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-appconfig effort/medium feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Add a command to AppConfig to retrieve a deployed configuration during CDK synthesize step.

### Use Case

I have a CDK application that deploys stacks like this:

```typescript
const clients = [/*...*/]

clients.forEach( client => new ClientShop(app, `${client.name}-shop`, { client } ) )
```

**Problem**

For now `clients` is an array stored in code. The `clients` information is managed by another team. So, every time they want to modify it, they need to open a ticket.

**Goal**

I want to give them the ability to edit themselves the information of `client` using an AWS resource. This will allow me to change the CDK application to this:

```typescript
// 👇
const clients = new GetClientsFromConfig(app, 'config')

clients.forEach( client => new ClientShop(app, `${client.name}-shop`, { client } ) )
```

This would separate the logic from data with a good user experience.

### Proposed Solution

One option would be to implement it similar to the static method SSM [fromStringParameterAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.StringParameter.html#static-fromwbrstringwbrparameterwbrattributesscope-id-attrs).

### Other Information

Options I considered to deploy the `clients` and read from `GetClientsFromConfig`:

- **AppConfig**: It has the best user experience and allows to validate the configuration. But, I can't find a way to read a deployed configuration in a Stack in my CDK app `const config = deployment.readFromLastVersion(/*...*/)` (do not exist)
- **DynamoDB**: Less intuitive and still can't find method to read from within CDK
- **SSM Parameter Store**: Can read from CDK, but is not so intuitive and error prone to the other team to manage its content
- **S3**: Easy to setup, hard for users to configure

I am still open to other solutions, if they exist.
But, as far as I gather AppConfig would be the best alternative.

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.128.0

### Environment details (OS name and version, etc.)

MacOS Apple M1 Pro

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the AWS AppConfig service and the CDK pattern referenced by SSM StringParameter.fromStringParameterAttributes. Compare the requested synth-time lookup with the AppConfig, DynamoDB, SSM Parameter Store, and S3 options described in the issue. Done means an agreed implementation can retrieve the latest deployed configuration during CDK synthesis with suitable validation and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.