Skip to content

Commit 1ec9edd

Browse files
authored
docs(deployment): document DNS Query Log Config replacement cascade (#270)
Add a 'Known deployment issues' section to DEPLOYMENT_GUIDE.md documenting the UPDATE_FAILED that hits stacks deployed before #222 (tag-exclusion fix) when they pick up the fix on a subsequent deploy. Both resolution paths covered: - Option A (recommended): manual disassociate + delete via Route53 console - Option B: comment-out DnsFirewall, deploy, uncomment, redeploy Closes #269
1 parent bc94972 commit 1ec9edd

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

docs/guides/DEPLOYMENT_GUIDE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,46 @@ Triggers via `workflow_run` when `build.yml` completes successfully. The pipelin
161161
- **Allowlist compute types**: Edit `ALLOWED_COMPUTE_TYPES` in `deploy.yml`.
162162
- **Deploy via PR label**: Add the `deploy:<type>` label to a PR (e.g., `deploy:agentcore`).
163163

164+
## Known deployment issues
165+
166+
### DNS Query Log Config replacement cascade (upgrading from pre-v0.5)
167+
168+
**Affects:** Stacks deployed *before* the tag-exclusion fix ([#222](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/pull/222)). Stacks created after this fix are not affected.
169+
170+
**Symptom:** `UPDATE_FAILED` on `AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation` with error `InvalidRequest: Cannot create association — one already exists for this VPC`.
171+
172+
**Root cause:** The `ResolverQueryLoggingConfig` resource is *create-only* in CloudFormation — any property change (including Tags) triggers a full replacement. Pre-fix stacks have `github:sha` and other tags on this resource. Although the new code excludes it from future tag applications, CloudFormation still attempts to *remove* the now-excluded tags from the existing resource during the update, triggering the replacement cascade:
173+
174+
1. Config is replaced → new physical resource ID
175+
2. Association detects `ResolverQueryLogConfigId` changed → triggers its own replacement
176+
3. CloudFormation attempts Create-before-Delete on the association → Route53 Resolver rejects (one association per VPC) → `InvalidRequest`
177+
178+
**Resolution — choose one:**
179+
180+
#### Option A: Manual disassociation via AWS Console (recommended)
181+
182+
1. Open the [Route 53 Resolver console](https://console.aws.amazon.com/route53resolver/home#/query-logging)
183+
2. Select the query logging configuration named `agent-dns-query-log`
184+
3. Under **Associated VPCs**, disassociate the VPC
185+
4. Delete the query logging configuration
186+
5. Run `mise //cdk:deploy` (or `cdk deploy`) — CloudFormation will recreate both resources without tags
187+
188+
#### Option B: Two-phase deploy (comment-out / re-add)
189+
190+
1. In `cdk/src/stacks/agent.ts`, comment out the `DnsFirewall` construct instantiation (~line 197):
191+
```typescript
192+
// new DnsFirewall(this, 'DnsFirewall', {
193+
// vpc: agentVpc.vpc,
194+
// additionalAllowedDomains: additionalDomains,
195+
// observationMode: true,
196+
// });
197+
```
198+
2. Deploy: `mise //cdk:deploy` — this deletes the query log config, association, firewall rules, and related resources
199+
3. Uncomment the `DnsFirewall` block
200+
4. Deploy again: `mise //cdk:deploy` — resources are recreated cleanly without tags
201+
202+
Option B is more disruptive (two deploys, brief DNS logging gap) but requires no console access.
203+
164204
## Related docs
165205

166206
- [Quick start](./QUICK_START.md) -- Zero-to-first-PR in 6 steps.

docs/src/content/docs/getting-started/Deployment-guide.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,46 @@ Triggers via `workflow_run` when `build.yml` completes successfully. The pipelin
165165
- **Allowlist compute types**: Edit `ALLOWED_COMPUTE_TYPES` in `deploy.yml`.
166166
- **Deploy via PR label**: Add the `deploy:<type>` label to a PR (e.g., `deploy:agentcore`).
167167

168+
## Known deployment issues
169+
170+
### DNS Query Log Config replacement cascade (upgrading from pre-v0.5)
171+
172+
**Affects:** Stacks deployed *before* the tag-exclusion fix ([#222](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/pull/222)). Stacks created after this fix are not affected.
173+
174+
**Symptom:** `UPDATE_FAILED` on `AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation` with error `InvalidRequest: Cannot create association — one already exists for this VPC`.
175+
176+
**Root cause:** The `ResolverQueryLoggingConfig` resource is *create-only* in CloudFormation — any property change (including Tags) triggers a full replacement. Pre-fix stacks have `github:sha` and other tags on this resource. Although the new code excludes it from future tag applications, CloudFormation still attempts to *remove* the now-excluded tags from the existing resource during the update, triggering the replacement cascade:
177+
178+
1. Config is replaced → new physical resource ID
179+
2. Association detects `ResolverQueryLogConfigId` changed → triggers its own replacement
180+
3. CloudFormation attempts Create-before-Delete on the association → Route53 Resolver rejects (one association per VPC) → `InvalidRequest`
181+
182+
**Resolution — choose one:**
183+
184+
#### Option A: Manual disassociation via AWS Console (recommended)
185+
186+
1. Open the [Route 53 Resolver console](https://console.aws.amazon.com/route53resolver/home#/query-logging)
187+
2. Select the query logging configuration named `agent-dns-query-log`
188+
3. Under **Associated VPCs**, disassociate the VPC
189+
4. Delete the query logging configuration
190+
5. Run `mise //cdk:deploy` (or `cdk deploy`) — CloudFormation will recreate both resources without tags
191+
192+
#### Option B: Two-phase deploy (comment-out / re-add)
193+
194+
1. In `cdk/src/stacks/agent.ts`, comment out the `DnsFirewall` construct instantiation (~line 197):
195+
```typescript
196+
// new DnsFirewall(this, 'DnsFirewall', {
197+
// vpc: agentVpc.vpc,
198+
// additionalAllowedDomains: additionalDomains,
199+
// observationMode: true,
200+
// });
201+
```
202+
2. Deploy: `mise //cdk:deploy` — this deletes the query log config, association, firewall rules, and related resources
203+
3. Uncomment the `DnsFirewall` block
204+
4. Deploy again: `mise //cdk:deploy` — resources are recreated cleanly without tags
205+
206+
Option B is more disruptive (two deploys, brief DNS logging gap) but requires no console access.
207+
168208
## Related docs
169209

170210
- [Quick start](/getting-started/quick-start) -- Zero-to-first-PR in 6 steps.

0 commit comments

Comments
 (0)