Commit Graph

1318 Commits

Author SHA1 Message Date
Megan Marsh 12e1831b56 move common directory into packer plugin sdk 2020-11-12 14:44:02 -08:00
Megan Marsh 67e856aaca move steps and step configs from packer/common to packer/common/commonsteps 2020-11-11 15:05:08 -08:00
Megan Marsh 7be0cf428a create packer-plugin-sdk directory and begin moving the relevant folders into it. 2020-11-11 10:21:37 -08:00
Megan Marsh 3db40194af version files 2020-11-10 14:48:06 -08:00
Megan Marsh 8ecd16db81 regenerate code 2020-11-10 08:16:59 -08:00
Megan Marsh 2bf912bddf
Merge pull request #10203 from aleksandrserbin/feature/launch-template-tags
amazon-ebs: add tags to launch template
2020-11-09 09:14:02 -08:00
Megan Marsh 88e03280b6
Extract plugin-specific examples to plugin directories (#10228)
* move alicloud examples from common example directory to alicloud builder

* move amazon examples to amazon builder dir

* move examples into ansible provisioner directory

* move azure examples to builder dir

* move hyperone examples into builder directory

* move jdcloud builder examples into builder directory

* move tencent cloud examples into the builder directory

* move ucloud examples into ucloud builder directory
2020-11-09 12:17:41 +01:00
Megan Marsh efc117fb55
Merge pull request #10218 from hashicorp/clean_plugin_sdk
Clean plugin sdk
2020-11-06 12:35:23 -08:00
Megan Marsh 2d90ffe7a4 move GeneratedData struct and PlaceholderMsg to same package under common 2020-11-06 10:45:38 -08:00
Megan Marsh f13f3d4d5f fix single tag interpolation to allow golang template engine usage 2020-11-05 16:27:53 -08:00
Megan Marsh 7b57e28600 move localexec to common/shell-local dir since it is related to shelling out locally 2020-11-04 11:56:46 -08:00
Aleksandr Serbin 7cb8af1441 amazon: remove region from state for chroot builder 2020-11-03 22:28:19 +01:00
Aleksandr Serbin 8dab31b548 amazon: use spot tags for launch template tags
- use `spot_tags` instead of `run_tags` for launch template
- move region to `StepRunSpotInstance` from state
2020-11-03 22:16:00 +01:00
Aleksandr Serbin d561b404d6 amazon-ebs: add tags to launch template 2020-11-01 16:25:43 +01:00
Megan Marsh 845a10867e
Merge pull request #10003 from hashicorp/ssm_session_retry
Add retry mechanism to retry SSM session creation
2020-10-29 16:02:54 -07:00
Wilken Rivera 01d5e5ca76 test/amazon/ebs: Add acceptance test for Session Manager Interface connectivity
Test Results
```
...

2020/10/29 09:35:39 ui:     test: Starting session with SessionId: wilken-00bcfae4d314f54e7
2020/10/29 09:35:40 [DEBUG] TCP connection to SSH ip/port failed: dial tcp [::1]:8047: connect: connection refused
2020/10/29 09:35:40 ui:     test: Port 8047 opened for sessionId wilken-00bcfae4d314f54e7.
2020/10/29 09:35:45 [INFO] Attempting SSH connection to localhost:8047...
2020/10/29 09:35:45 [DEBUG] reconnecting to TCP connection for SSH
2020/10/29 09:35:45 ui:     test: Connection accepted for session wilken-00bcfae4d314f54e7.
2020/10/29 09:35:45 [DEBUG] handshaking with SSH
2020/10/29 09:35:45 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: invalid packet length, packet too large
2020/10/29 09:35:52 [INFO] Attempting SSH connection to localhost:8047...
2020/10/29 09:35:52 [DEBUG] reconnecting to TCP connection for SSH
2020/10/29 09:35:52 [DEBUG] handshaking with SSH
2020/10/29 09:35:52 [DEBUG] handshake complete!
2020/10/29 09:35:52 [DEBUG] Opening new ssh session
2020/10/29 09:35:53 [INFO] agent forwarding enabled
2020/10/29 09:35:53 ui: ==> test: Connected to SSH!
2020/10/29 09:35:53 Running the provision hook
2020/10/29 09:35:53 ui: ==> test: Stopping the source instance...
2020/10/29 09:35:53 ui:     test: Stopping instance
2020/10/29 09:35:54 ui: ==> test: Waiting for the instance to stop...
2020/10/29 09:36:25 ui: ==> test: Creating AMI packer-ssm-test-1603978447 from instance i-0853cb6186a3406d5
2020/10/29 09:36:25 ui:     test: AMI: ami-0868a41bbb2df77b3
2020/10/29 09:36:25 ui: ==> test: Waiting for AMI to become ready...
2020/10/29 09:37:59 ui: ==> test: Terminating the source AWS instance...
2020/10/29 09:37:59 ui error: ==> test: Bad exit status: -1
2020/10/29 09:38:15 ui: ==> test: Cleaning up any extra volumes...
2020/10/29 09:38:15 ui: ==> test: No volumes to clean up, skipping
2020/10/29 09:38:15 ui: ==> test: Deleting temporary security group...
2020/10/29 09:38:16 ui: ==> test: Deleting temporary keypair...
2020/10/29 09:38:16 Deregistering image ID (ami-0868a41bbb2df77b3) from region (us-east-1)
2020/10/29 09:38:17 Deregistered AMI id: ami-0868a41bbb2df77b3
2020/10/29 09:38:17 Deleted snapshot: snap-09602f15994bc9f51
--- PASS: TestBuilderAcc_SessionManagerInterface (249.87s)
PASS

```
2020-10-29 09:39:19 -04:00
Adrien Delorme aae1992649 remove default PauseBeforeSSM, this will have to be set manually 2020-10-29 13:38:03 +01:00
Adrien Delorme 6c45f04467 Delete ssm_mock_funcs.go 2020-10-29 13:37:44 +01:00
Adrien Delorme 5d06a6e6df rename file correctly 2020-10-29 13:26:09 +01:00
Adrien Delorme c6e2dd5538 remove unit test file for now, I think that an acceptance test will be easier here 2020-10-29 13:22:17 +01:00
Adrien Delorme a4bd744955 simplify things a bit more 2020-10-29 13:11:07 +01:00
Adrien Delorme aef3d24213 Update step_create_ssm_tunnel.go 2020-10-29 12:31:01 +01:00
Adrien Delorme f329cb5b93 simplify code 2020-10-29 12:18:41 +01:00
Adrien Delorme b058de072a move packer/builder/amazon/common.IsAWSErr to builder/amazon/common/awserrors.Matches
to avoid cyclic dependency issues
2020-10-29 12:02:41 +01:00
Adrien Delorme 8e355d0fe7 Move ssm code to its own ssm package and make it singlethreaded 2020-10-29 11:57:29 +01:00
Wilken Rivera 646b973bd3 Remove logic to retry a connection that reuses an existing SSM Session
After testing it was found that once an session is terminated via an
instance restart, console termination, or SSM agent restart. Any active
session will essentially be terminated and unusable. So knowing that it
is always best to start a new session and let the old one timeout get
terminated.
2020-10-28 06:36:23 -04:00
Wilken Rivera dff9cde775 Remove waitgroups 2020-10-28 06:36:23 -04:00
Wilken Rivera eb11009e2a Check for closed channels as opposed to using a separate closeRetry channel 2020-10-28 06:36:23 -04:00
sylviamoss aa73cc7d7e add close chan to avoid unwanted retries 2020-10-27 16:32:20 -04:00
sylviamoss 1f62249097 add retry terminated session chan 2020-10-27 16:32:20 -04:00
sylviamoss 8e3f3e514c improve logs 2020-10-27 16:32:20 -04:00
sylviamoss b2c7897f58 add WaitGroup to avoid data race 2020-10-27 16:32:20 -04:00
sylviamoss 1c2b469acd add retry channel to ssm driver 2020-10-27 16:32:19 -04:00
Adrien Delorme f5e037e8b4 Merge remote-tracking branch 'origin/master' into azr_selectable_temp_keygen_type_gcp 2020-10-26 15:47:29 +01:00
Megan Marsh 25f4e24772
Merge pull request #10150 from nshalman/nshalman/tag-snapshots
amazon/ebssurrogate: apply snapshot tags right when taking snapshot
2020-10-23 15:57:18 -07:00
Megan Marsh c0ce8a9414 rework fixer deprecation code so we know what plugins they relate to 2020-10-21 15:28:59 -07:00
Nahum Shalman 83a672f2c9 amazon/ebssurrogate: apply snapshot tags right when taking snapshot 2020-10-21 16:17:37 -04:00
Adrien Delorme 522d122858 regen all code 2020-10-21 12:04:10 +02:00
Adrien Delorme f51b231c17 Merge remote-tracking branch 'origin/master' into azr_selectable_temp_keygen_type_gcp 2020-10-20 16:39:01 +02:00
Megan Marsh b8e6e2c081
Merge pull request #10085 from 10000coins/f-aws-tenancy
builder/amazon: Support for source instance tenancy
2020-10-19 12:49:07 -07:00
Evan Pipho 608307cd1e Re-allow spot + tenancy. Validate tenancy is set to a usable value 2020-10-16 21:43:22 +00:00
Evan Pipho d5d1a8708e Add tests for Tenancy vs Spot Price 2020-10-16 21:43:22 +00:00
Evan Pipho 6967e02103 Add support for source instance tenancy to amazon builders 2020-10-16 21:43:22 +00:00
Adrien Delorme 54032d6c11 gen code and docs 2020-10-15 16:51:23 +02:00
Matt Rogers 15f97421e2
builder/amazon: Add io2 as a supported volume type
io2 volumes are new as of 2020-08-24. This adds support for specifying
them in a packer template and having the iops value specified take
effect.
2020-10-14 09:01:17 -05:00
Megan Marsh 4c0ac6917e switch to using aws base config, which means we're using code tested and maitnained by the terraform crowd. 2020-09-29 14:26:38 -07:00
Sylvia Moss 96e3def294
Add pause_before_ssm config to pause before establishing the Session Manager session (#9988) 2020-09-25 10:19:19 +02:00
Megan Marsh d66b358100
Merge pull request #9991 from hashicorp/b-amazon-ssm-infinite-loop
amazon/ssm_driver: Update log polling logic
2020-09-24 09:55:39 -07:00
Wilken Rivera 2f2b5683a2 amazon/ssm_driver: Update log polling logic
This change checks for closed iochans related to the log polling
function and will break out of the loop when both channels are closed.
Which is an indicator that the SSM session has been terminated by some
external process. This fixes an issue where Packer hangs, due to the
infinite loop, when an SSM session is killed outside of Packer.

Related to #9442
2020-09-24 10:19:37 -04:00
Megan Marsh 429d431365 Implement assume_role for Packer. This functionality is copied shamelessly
from the Terraform AWS provider
2020-09-23 13:18:26 -07:00