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

ebs: skip_create_ami skips prevalidation of AMI name (#409) #412

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions builder/common/step_pre_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type StepPreValidate struct {
DestAmiName string
ForceDeregister bool
AMISkipBuildRegion bool
AMISkipCreateImage bool
VpcId string
SubnetId string
HasSubnetFilter bool
Expand Down Expand Up @@ -89,6 +90,11 @@ func (s *StepPreValidate) Run(ctx context.Context, state multistep.StateBag) mul
return multistep.ActionContinue
}

if s.AMISkipCreateImage {
ui.Say("skip_create_ami was set; not prevalidating AMI name")
return multistep.ActionContinue
}

ec2conn := state.Get("ec2").(*ec2.EC2)

// Validate VPC settings for non-default VPCs
Expand Down
1 change: 1 addition & 0 deletions builder/ebs/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
DestAmiName: b.config.AMIName,
ForceDeregister: b.config.AMIForceDeregister,
AMISkipBuildRegion: b.config.AMISkipBuildRegion,
AMISkipCreateImage: b.config.AMISkipCreateImage,
VpcId: b.config.VpcId,
SubnetId: b.config.SubnetId,
HasSubnetFilter: !b.config.SubnetFilter.Empty(),
Expand Down