GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(cli): enable customized env resources while initialization by iamhopaul123 · Pull Request #1243 · aws/copilot-cli

This repository was archived by the owner on Jun 22, 2026. It is now read-only.

Conversation

@iamhopaul123

@iamhopaul123 iamhopaul123 commented Aug 7, 2020

Copy link
Copy Markdown
Contributor

Last part of #1192. Update env init UI to enable create customized env resources in an interactive way.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iamhopaul123
iamhopaul123 requested a review from efekarakus August 7, 2020 00:28
@iamhopaul123
iamhopaul123 requested a review from a team as a code owner August 7, 2020 00:28
@amazon-ecs-cli-v2-pr-manager
amazon-ecs-cli-v2-pr-manager requested a review from seongm-1 August 7, 2020 00:28
@iamhopaul123
iamhopaul123 removed the request for review from seongm-1 August 7, 2020 00:37
@iamhopaul123
chore(cli): UI changes to env init for customized env resources
438f3f9
@iamhopaul123
iamhopaul123 force-pushed the env-init/enable-customized-resources-ui-change branch from 68807a4 to 438f3f9 Compare August 7, 2020 00:50
efekarakus
efekarakus reviewed Aug 10, 2020
View reviewed changes

@efekarakus efekarakus left a comment

Copy link
Copy Markdown
Contributor

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.

Awesome, I can't wait for this to be merged :D

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/pkg/cli/validate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/validate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/validate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/term/selector/selector.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/term/selector/selector.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@efekarakus efekarakus changed the title chore(cli): UI changes to env init for cus tomized env resources feat(cli): enable customized env resources while initialization Aug 10, 2020
iamhopaul123 added 2 commits August 10, 2020 13:16
@iamhopaul123
Address feedback
b931d49
@iamhopaul123
Remove confirm for using default env config
764896e
@iamhopaul123
iamhopaul123 requested a review from a team August 10, 2020 20:42
iamhopaul123 added 2 commits August 10, 2020 13:52
@iamhopaul123
Remove showing ALB creation
fead332
@iamhopaul123
Fix method names and error name
c75084a
efekarakus
efekarakus approved these changes Aug 10, 2020
View reviewed changes

@efekarakus efekarakus left a comment

Copy link
Copy Markdown
Contributor

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.

Looks good! Only tiny things

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/pkg/cli/validate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/term/selector/ec2.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/env_init.go
if o.NoCustomResources {
return nil
}
adjustOrImport, err := o.prompt.SelectOne(

@efekarakus efekarakus Aug 10, 2020

Copy link
Copy Markdown
Contributor

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 should try to use the WithFinalMessage option while prompting to provide a consistent experience but, in this situation it's a bit tricky since the options are a bit verbose. Just something to keep in mind :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iamhopaul123 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread internal/pkg/cli/env_init.go
}
_, vpcCIDR, err := net.ParseCIDR(vpcCIDRString)
if err != nil {
return fmt.Errorf("parse VPC CIDR: %w", err)

@efekarakus efekarakus Aug 10, 2020

Copy link
Copy Markdown
Contributor

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.

should we include the input in the error msg? or is that returned by the std library already?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Aug 10, 2020

Copy link
Copy Markdown
Contributor Author

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.

i believe the input is included

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Aug 10, 2020

Copy link
Copy Markdown
Contributor Author

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.

Actually just carefully looked at it, this error ideally should never be triggered because we already have validation for the input. this is just because our Get method only return a string instead of IPNet method (we could make this change in the future), so that we need to parse the string to IPNet again...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iamhopaul123
Minor changes
78f0abe
@iamhopaul123
iamhopaul123 requested a review from a team August 10, 2020 22:32
kohidave
kohidave approved these changes Aug 11, 2020
View reviewed changes

@kohidave kohidave left a comment

Copy link
Copy Markdown
Contributor

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.

Looks great! One follow up we can do is include the name of the Subnets/VPCs - not just the IDs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

efekarakus and iamhopaul123 reacted with heart emoji
All reactions
  • ❤️ 2 reactions
Comment thread internal/pkg/aws/ec2/ec2.go
}

// ListVPC returns IDs of all VPCs.
func (c *EC2) ListVPC() ([]string, error) {

@kohidave kohidave Aug 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

One thing that might be nice to do is return a struct with the VPC ID and the value of the "Name" tag if it exists. This is what the console does.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iamhopaul123 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@iamhopaul123 iamhopaul123 Aug 11, 2020

Copy link
Copy Markdown
Contributor Author

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.

Looks great! One follow up we can do is include the name of the Subnets/VPCs - not just the IDs.

i'll cut an issue for it!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/pkg/aws/ec2/ec2.go

// ListVPCSubnets lists all subnets given a VPC ID.
func (c *EC2) ListVPCSubnets(vpcID string) (*Subnets, error) {
func (c *EC2) ListVPCSubnets(vpcID string, opts ...ListVPCSubnetsOpts) ([]string, error) {

@kohidave kohidave Aug 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Same advice regarding the "Name" tag - so that customers can see the names if they exist.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iamhopaul123 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@mergify
Merge branch 'master' into env-init/enable-customized-resources-ui-ch…
b16e6a5
…ange
@mergify
mergify Bot merged commit e9e3114 into aws:master Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@kohidave kohidave kohidave approved these changes
@efekarakus efekarakus efekarakus approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@iamhopaul123 @kohidave @efekarakus
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.