Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environments with a domain cannot be initialized after v0.6.0 #1662

Closed
efekarakus opened this issue Nov 11, 2020 · 0 comments · Fixed by #1663
Closed

Environments with a domain cannot be initialized after v0.6.0 #1662

efekarakus opened this issue Nov 11, 2020 · 0 comments · Fixed by #1663
Assignees
Labels
type/bug Issues that are bugs.

Comments

@efekarakus
Copy link
Contributor

efekarakus commented Nov 11, 2020

Description

After upgrading to v0.6.0, I initialized an application with the domain name flag:

$ copilot app init --domain domain.com

And then I tried to create an environment with the default VPC configuration:

$ copilot env init

However, I received the following error:

✘ Failed to accept changes for the test environment.

✘ check if changeset is empty: create change set copilot-3eebf082-52de-4746-8344-b4494b067bae for stack nginx-app-test: ValidationError: Template format error: Unresolved resource dependencies [PublicLoadBalancer, DefaultHTTPTargetGroup] in the Resources block of the template
	status code: 400, request id: 22d3d606-56b0-424c-9b72-c7fc2d291f64: describe change set copilot-3eebf082-52de-4746-8344-b4494b067bae for stack nginx-app-test: ValidationError: Stack [nginx-app-test] does not exist
	status code: 400, request id: 6020e4b2-9c4a-4ae0-892e-36e3cf7bbad8

Why?

I believe this is happening because of the following resource:

HTTPSListener:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn: HTTPSCert
Condition: DelegateDNS
Properties:

The ALB does not exist by default anymore and the DelegateDNS condition evaluates to true trying to create an HTTPSListener:

DelegateDNS:
!Not [!Equals [ !Ref AppDNSName, "" ]]

Possible fixes

One way of fixing this issue is to limit the HTTPSListenerRule creation if DelegateDNS and CreateALB evaluates to true.

@efekarakus efekarakus added the type/bug Issues that are bugs. label Nov 11, 2020
@efekarakus efekarakus self-assigned this Nov 11, 2020
efekarakus added a commit to efekarakus/copilot-cli that referenced this issue Nov 11, 2020
@mergify mergify bot closed this as completed in #1663 Nov 12, 2020
mergify bot pushed a commit that referenced this issue Nov 12, 2020
Fixes #1662

Although not visible here, the [diff](https://diff.corp.amazon.com/compare/2az4ioz9 ) between v1.0.1 and v1.0.0 for the env template is just the condition for the HTTPSListener resource: 
```
 -     Condition: DelegateDNS 
 +     Condition: ExportHTTPSListener 
```

I'll investigate how we can add e2e tests for apps initialized with a domain.

_By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
thrau pushed a commit to localstack/copilot-cli-local that referenced this issue Dec 9, 2022
…1663)

Fixes aws#1662

Although not visible here, the [diff](https://diff.corp.amazon.com/compare/2az4ioz9 ) between v1.0.1 and v1.0.0 for the env template is just the condition for the HTTPSListener resource: 
```
 -     Condition: DelegateDNS 
 +     Condition: ExportHTTPSListener 
```

I'll investigate how we can add e2e tests for apps initialized with a domain.

_By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issues that are bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant