801 Commits

Author SHA1 Message Date
Anthony Dong
2e989088e5 amazon-ebssurrogate: allow enabling ena/sr-iov on spot instances 2019-11-21 11:13:32 +01:00
Megan Marsh
0e2bdc8be6 forcibly prevent ephemeral drives from being created in the amazon-ebs builder, when no_ephemeral is set 2019-11-20 13:42:14 -08:00
DanHam
b40e5d90b6
builder/amazon/common/step_pre_validate: Return DescribeVpcs errors 2019-11-19 20:18:53 +00:00
nywilken
afb880c134 test/builder/amazon/common/step_pre_validate: Update DescribeVpcs mock
* Update condition to check for a empty VpcId
2019-11-19 14:48:07 -05:00
DanHam
074be9942d
Only validate the user has provided a subnet_id when vpc_id has been set 2019-11-19 14:09:58 +00:00
nywilken
f9f4726eff builder/amazon/step_pre_validate: Add check for non-default VPCs
Subnet information is only really needed when the specified `vpc_id` is
not the default VPC for the region where the builder is being executed.
This change uses the AWS API to determine if the VPC provided is a
non-default VPC and only validates the existence of a `subnet_id` if a
user has provided a non-default `vpc_id`.

Tests after change
```
> make test TEST=./builder/amazon/... TESTARGS='-count=1 -v -run=TestStepPreValidate_checkVpc'
...

=== RUN   TestStepPreValidate_checkVpc
=== RUN   TestStepPreValidate_checkVpc/DefaultVpc
=== RUN   TestStepPreValidate_checkVpc/NonDefaultVpcNoSubnet
=== RUN   TestStepPreValidate_checkVpc/NonDefaultVpcWithSubnet
=== RUN   TestStepPreValidate_checkVpc/SubnetWithNoVpc
=== RUN   TestStepPreValidate_checkVpc/NoVpcInformation
--- PASS: TestStepPreValidate_checkVpc (0.00s)
    --- PASS: TestStepPreValidate_checkVpc/DefaultVpc (0.00s)
    --- PASS: TestStepPreValidate_checkVpc/NonDefaultVpcNoSubnet (0.00s)
    --- PASS: TestStepPreValidate_checkVpc/NonDefaultVpcWithSubnet (0.00s)
    --- PASS: TestStepPreValidate_checkVpc/SubnetWithNoVpc (0.00s)
    --- PASS: TestStepPreValidate_checkVpc/NoVpcInformation (0.00s)
PASS

...
```
2019-11-18 16:44:09 -05:00
nywilken
488e539f63 builder/amazon: Add helper function for checking against AWSError
Replace all straight forward occurrences of `if err, ok := err.(awserr.Error)` with the `isAWSErr` helper function
2019-11-12 15:27:47 -05:00
Megan Marsh
6e2456d028 make error messaging around ResourceNotReady better, update docs with other possible issues (#8349) 2019-11-08 11:15:24 +01:00
cove
2898d66812
retry runinstances aws api that wasn't retried and could fail 2019-11-06 14:06:35 -08:00
Megan Marsh
6c704f7046 Revert "fix template imports"
This reverts commit 0e70e0e5a4c570790f7f253e69c6e09ed18e38d1.
2019-11-04 14:29:00 -08:00
Megan Marsh
517834d528 Revert "Revert "remove clean_ami_name and clean_image_name; complete the deprecation for these functions in favor of clean_resource_name""
This reverts commit 44f91c9afc1884132f4d4cc69ceb1e04f4e4664c.
2019-11-04 14:28:40 -08:00
Megan Marsh
fcb65ee422
Merge pull request #8307 from hashicorp/fix_8116
delete amazon import post-processor intermediary snapshots
2019-11-01 14:55:22 -07:00
Megan Marsh
e9e4c102e5 delete amazon import post-processor intermediary snapshots 2019-11-01 14:17:44 -07:00
Lars Lehtonen
d072079899
builder/amazon/common: remove dead test type and function mockEC2Conn_Modify_EBS.ModifyInstanceAttribute() 2019-10-31 12:38:32 -07:00
Lars Lehtonen
953be1603b
builder/amazon/common: remove dead test type and function mockEC2ConnSpot.DescribeSpotPriceHistory() 2019-10-31 12:34:11 -07:00
Lars Lehtonen
7a09f9c678
builder/amazon/common: remove dead test function fakeModifyEBSBackedInstanceState() 2019-10-31 12:22:10 -07:00
Lars Lehtonen
0a13b620d6
builder/amazon/common: remove dead test function StepModifyEBSBackedInstance_EnableAMIENASupport() 2019-10-31 12:19:28 -07:00
Lars Lehtonen
c74df8b652
builder/amazon/common: remove dead test function getMockConnSpot() 2019-10-31 12:15:53 -07:00
Lars Lehtonen
e5e2bfa83f
builder/amazon/common: remove nil check on slice, len() on nil slices is zero 2019-10-31 12:09:32 -07:00
Megan Marsh
6191b9c8c6
Merge pull request #8288 from hashicorp/fix_8271
add some extra layers of validation to make sure that people don't tr…
2019-10-30 10:41:52 -07:00
Megan Marsh
d084cd1895 Update builder/amazon/common/ami_config.go 2019-10-30 09:41:23 -07:00
Megan Marsh
e9f02e44cb add test to catch this case 2019-10-29 11:28:56 -07:00
Megan Marsh
7cf47fc463 add some extra layers of validation to make sure that people don't trip over magical encrypt_boot settings later in the build 2019-10-29 11:26:22 -07:00
Megan Marsh
e2283445f2 need to initialize variables scoped to the individual loop, because the address of k,v stay the same and that means we overwrite previous variables when assigning them to the struct directly. 2019-10-28 14:31:13 -07:00
Megan Marsh
7928b5b045 fix transcription error from when we moved to generated docs 2019-10-24 10:19:03 -07:00
Megan Marsh
b9245a402d add structure to its own struct to make generated code stop complaining 2019-10-23 10:46:42 -07:00
Megan Marsh
5614f307fb regerate code
generate flat FlatPolicyDocument
add PolicyDocument to generate command
2019-10-23 10:46:07 -07:00
Megan Marsh
d15f43e4eb
Merge pull request #8232 from hashicorp/artifact-tree
HCL2 configs - part one
2019-10-22 11:54:34 -07:00
Bernard Baltrusaitis
ec1d70dc44 adding required changes 2019-10-22 21:40:18 +11:00
Bernard Baltrusaitis
65d1447b64 adding formatting 2019-10-19 21:33:58 +11:00
Bernard Baltrusaitis
6e2146324f Merge branch 'master' of github.com:b-b3rn4rd/packer 2019-10-19 20:56:49 +11:00
Bernard Baltrusaitis
8b83cca064 adding temporary instance profile document policy 2019-10-19 20:56:18 +11:00
Adrien Delorme
078ba7c8c3 commit old code generation tool
for history
2019-10-15 12:56:42 +02:00
Adrien Delorme
221e72e9c3 builder.amazon.common: remove pointer (*) from []*string and map[*string]*string types
because they make hcl2/cty decoding panic
2019-10-15 12:56:41 +02:00
Megan Marsh
0e70e0e5a4 fix template imports 2019-10-14 13:22:06 -07:00
Megan Marsh
44f91c9afc Revert "remove clean_ami_name and clean_image_name; complete the deprecation for these functions in favor of clean_resource_name"
This reverts commit 0026792d2f60f03abc04239640065e967581310c.
2019-10-14 13:08:15 -07:00
Adrien Delorme
d4600a7716 fix go imports 2019-10-04 11:19:45 +02:00
Megan Marsh
0026792d2f remove clean_ami_name and clean_image_name; complete the deprecation for these functions in favor of clean_resource_name 2019-10-03 15:49:01 -07:00
Megan Marsh
e16fb19bfc don't abort on a single error if another availability zone was able to create the instance 2019-10-02 14:17:00 -07:00
Megan Marsh
eccf0fb51d update docs 2019-09-27 09:51:18 -07:00
Megan Marsh
e047b97bf7
Merge pull request #8162 from hashicorp/fix_8154
make sure amazon builders respect ssh_host option
2019-09-27 09:34:49 -07:00
Megan Marsh
ac6e7a4800 updates tests to validate that ssh_host value supplied in the template overrides all else 2019-09-27 09:19:23 -07:00
Adrien Delorme
941dc394f0 Update step_run_spot_instance.go 2019-09-27 13:04:52 +02:00
Adrien Delorme
d049284120
Update builder/amazon/common/step_run_spot_instance.go
remove unused code that might induce errors
2019-09-27 13:00:53 +02:00
Adrien Delorme
07e97e26de
step_run_source_instance.go: make sure we use the right ShouldRetry error 2019-09-27 12:57:55 +02:00
Megan Marsh
c722009159 we only need one describeInstances call, not 3, and it should be wrapped in a retry 2019-09-26 15:47:01 -07:00
Megan Marsh
e47059aaca put retry around describeinstances call in amazon 2019-09-26 14:49:28 -07:00
Megan Marsh
31bb1e818f fix tests 2019-09-26 13:02:11 -07:00
Megan Marsh
0cbd3ff0f3 make sure amazon builders respect ssh_host option 2019-09-26 12:30:04 -07:00
Megan Marsh
72d393c95a update docs to show a use case for block device mappings 2019-09-25 16:48:04 -07:00