aws / aws/aws-cdk

aws_appconfig, cdk.Fn.import_value: Error: Missing required parameters for environment ARN: format should be /$/{applicationId}/environment//$/{environmentId}

Open
#31,580 12 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-appconfig @aws-cdk/core bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the bug

I am creating environment for my AWS App Config using
```
environment = app.add_environement(id, environment_name)
cdk.CfnOutput(self, "EnvArn", export_name="EnvArn", value=environment.environment_arn)
```

I am using static method which returns the environment using ARN:
```
env_arn = cdk.Fn.import_value("EnvArn")
env = Environment.from_environment_arn(scope, construct_id, environment_arn = env_arn)
```

but getting following error:
**@jsii/kernel.RuntimeError: Error: Missing required parameters for environment ARN: format should be /$/{applicationId}/environment//$/{environmentId}**

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Version

_No response_

### Expected Behavior

It should return environment

### Current Behavior

It is throwing error as mentioned

### Reproduction Steps

Create environment and try to import it as mentioned in the description

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.154.1

### Framework Version

_No response_

### Node.js Version

20.0.0

### OS

Windows

### Language

Python

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Python snippets using AWS CDK 2.154.1, focusing on Environment.from_environment_arn and the imported EnvArn value. Compare the expected environment ARN format with the value returned by cdk.Fn.import_value; done means the environment is returned without the missing-parameters error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.