-
Notifications
You must be signed in to change notification settings - Fork 413
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
fix: allow multiple environments per VPC #2394
Changes from all commits
524454a
ad9f6f0
3f34ed9
f4b9a71
f1149c9
1b516e6
572ec3e
6bced2e
c20eb72
b3db3d5
6cc8758
6c55fb3
044fbf8
7b6a55f
8e6679e
106f111
760024f
88ee6a9
78573aa
09bcc28
5f844d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ type deploySvcOpts struct { | |
addons templater | ||
appCFN appResourcesGetter | ||
svcCFN cloudformation.CloudFormation | ||
envCFN envCFDescriber | ||
sessProvider sessionProvider | ||
envUpgradeCmd actionCommand | ||
appVersionGetter versionGetter | ||
|
@@ -259,6 +260,8 @@ func (o *deploySvcOpts) configureClients() error { | |
// CF client against env account profile AND target environment region | ||
o.svcCFN = cloudformation.New(envSession) | ||
|
||
o.envCFN = cloudformation.New(envSession) | ||
|
||
addonsSvc, err := addon.New(o.name) | ||
if err != nil { | ||
return fmt.Errorf("initiate addons service: %w", err) | ||
|
@@ -378,11 +381,20 @@ func (o *deploySvcOpts) manifest() (interface{}, error) { | |
return mft, nil | ||
} | ||
|
||
func envUsesLegacySvcDiscovery(cf envCFDescriber, app, env string) (bool, error) { | ||
return cf.EnvironmentUsesLegacySvcDiscovery(app, env) | ||
} | ||
|
||
func (o *deploySvcOpts) runtimeConfig(addonsURL string) (*stack.RuntimeConfig, error) { | ||
svcDiscovery, err := envUsesLegacySvcDiscovery(o.envCFN, o.appName, o.envName) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if !o.buildRequired { | ||
return &stack.RuntimeConfig{ | ||
AddonsTemplateURL: addonsURL, | ||
AdditionalTags: tags.Merge(o.targetApp.Tags, o.resourceTags), | ||
AddonsTemplateURL: addonsURL, | ||
AdditionalTags: tags.Merge(o.targetApp.Tags, o.resourceTags), | ||
LegacyServiceDiscovery: svcDiscovery, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this fits under Maybe we can push down the |
||
}, nil | ||
} | ||
resources, err := o.appCFN.GetAppResourcesByRegion(o.targetApp, o.targetEnvironment.Region) | ||
|
@@ -405,6 +417,7 @@ func (o *deploySvcOpts) runtimeConfig(addonsURL string) (*stack.RuntimeConfig, e | |
ImageTag: o.imageTag, | ||
Digest: o.imageDigest, | ||
}, | ||
LegacyServiceDiscovery: svcDiscovery, | ||
}, nil | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does copilot job use service discovery 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We inject the endpoint as an environment variable, so we still have to update this here.