aws / aws/aws-cdk

cdk deploy should support querying stacks by stackName and not just by artifact IDs

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

Description

I set stackName to HarvestStack, but when I do cdk deploy HarvestStack, it fails

![image](https://user-images.githubusercontent.com/1034890/83837862-f1821f80-a73a-11ea-8344-b2fd9a12518c.png)

![image](https://user-images.githubusercontent.com/1034890/83837776-baac0980-a73a-11ea-8720-738ed3a42373.png)

### Reproduction Steps
I am using a nested stack

```
const networkingStack = new NetworkingStack(app, 'NetworkingStack', {
env: {
region: process.env.CDK_DEFAULT_REGION,
account: settingsForEnv.accountId
},
environmentName,
...settingsForEnv
})

const harvestStack = new HarvestStack(networkingStack, 'HarvestStack', {
stackName: 'HarvestStack',
env: {
region: process.env.CDK_DEFAULT_REGION,
account: settingsForEnv.accountId
},
environmentName,
...settingsForEnv,
vpc: networkingStack.vpc,
certificate: networkingStack.certificate,
hostedZone: networkingStack.hostedZone,
alarmSNSTopic: networkingStack.alarmSNSTopic
})
```

### Error Log

### Environment

- **CLI Version :** 1.44.0 (build 1cd832b)
- **Framework Version:** 1.44.0 (build 1cd832b)
- **Node.js Version:** v12.6
- **OS :** MacOS
- **Language (Version):** Typescript

### Other

---

This is :bug: Bug Report

Contributor guide

Open the contributing guide

Research direction

Reproduce the nested-stack case by running `cdk deploy HarvestStack` with the example configuration, then trace the CLI's stack-selection path to see where artifact IDs are matched. Done means `cdk deploy` accepts the configured `stackName` as well as an artifact ID and preserves existing deployment behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.