Commit Graph

39 Commits

Author SHA1 Message Date
Peter Rifel e0555bb431
Remove unused json field tags from terraform structs 2021-12-24 14:17:23 -06:00
Peter Rifel 0bcd39e905
Add IPv6 IMDS terraform support
This requires bumping the minimum aws provider version to the version that includes the support
2021-09-16 20:02:03 -05:00
Peter Rifel c9f810d57e
Support terraform 0.12+'s filebase64() in json output
Originally the JSON output was meant as a bridge between the 0.11 and 0.12 support.
Now that we've dropped support for 0.11, we can use filebase64() instead of encoding the userdata in the file ourselves.
2021-05-19 17:42:50 -05:00
Ciprian Hacman cedbe1f360 Add initial support for configuring IPv6 with AWS 2021-05-19 06:21:07 +03:00
John Gardiner Myers 57dec35f68 Split out TerraformWriter 2021-05-02 21:54:46 -07:00
John Gardiner Myers 7921a5bd7e Separate TerraformTarget.AddFile() into two receivers 2021-05-02 16:47:33 -07:00
Peter Rifel ce51ec44bc
Use new CPUCredits IG spec field in launch templates 2021-03-02 22:54:29 -06:00
Ciprian Hacman a7bb949936 Add possibility to set volume throughput for gp3 volumes 2021-01-05 13:18:32 +02:00
Justin SB 1945a656a0 Remove deprecated ResourceHolder
Cleaning up what is now dead code.
2020-12-19 23:15:37 -05:00
Justin SB 45d11ba12c Replace (some) deprecated ResourceHolder with Resource
This removes more of the deprecated type, but it also simplifies
refactoring the GCE InstanceTemplate.
2020-12-19 09:51:43 -05:00
Bharath Vedartham cebe171805 Explicitly specify http_endpoint in launch_template terraform
http_endpoint has to be explicitly specified in the metadata_options block
of the launch template terraform according to issue
https://github.com/hashicorp/terraform-provider-aws/issues/12564
2020-12-10 01:37:15 +05:30
Kubernetes Prow Robot bee16c052d
Merge pull request #10324 from bharath-123/feature/aws-imdv2
Add support for AWS IMDS v2
2020-12-07 22:55:11 -08:00
Ciprian Hacman 265bf4d106 Add option for setting the volume encryption key in AWS 2020-12-08 07:08:09 +02:00
Bharath Vedartham 7f6e125733 Add support for aws ec2 instance metadata v2
A new field is add to the InstanceGroup spec with 2 sub fields,
HTTPPutResponseHopLimit and HTTPTokens. These fields enable the user
to disable IMDv1 for instances within an instance group.

By default, both IMDv1 and IMDv2 are enabled in instances in an instance group.
2020-12-07 02:57:02 +05:30
Ciprian Hacman 0c3e3784c8 Use LaunchTemplate name instead of name_prefix for Terraform 2020-11-09 21:40:36 +02:00
Ciprian Hacman 32658075d3 Fix disabling spot instances when using launch templates 2020-11-08 19:11:45 +02:00
Ciprian Hacman b5e4b7ad48 Add missing instance monitoring for CF and TF 2020-11-04 16:15:00 +02:00
Barry Melbourne 84417c330b Set minimum Terraform version to 0.12.26/0.13.0 2020-10-28 20:24:41 +00:00
John Gardiner Myers f92d486197 Remove dependency of TerraformJSON feature flag 2020-10-25 10:49:59 -07:00
Ciprian Hacman 2880e22bce Add flag for root volume encryption 2020-08-21 18:31:21 +03:00
Peter Rifel 69f2c71cc3
Add tag support to AWS launch templates
In addition to TagSpecifications which allow tagging of instances and volumes, launch templates support tags of their own.

This adds the usual tags to LTs, as seen in the kubernetes.tf additions. Cloudformation does not yet support it [0], so only "api" and "terraform" targets are updated.

[0] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html
2020-07-07 22:43:45 -05:00
Peter Rifel c5882446c8
Only store launchtemplate userdata in plaintext for terraform 0.12+ 2020-06-16 17:16:41 -05:00
Peter Rifel 964d402eb5
Store terraform launchtemplate userdata in plaintext rather than b64
This makes it easier to grok the userdata contents
2020-06-16 16:53:49 -05:00
Martin Tomes c66180bc58 Added support for instance interruption behavior 2020-04-29 14:53:17 +02:00
Peter Rifel 04a5ead08e Add cty field tags to Terraform structs 2020-04-05 21:18:02 -05:00
Kubernetes Prow Robot 759e24a490
Merge pull request #8802 from thejasbabu/feature/spot-block
Add support for Spot block in launch template
2020-04-01 10:15:27 -07:00
Thejas B dda8dc3f37 Add support for Spot block in launch template
- Launch configuration does not support the field SpotDurationInMinutes which is used to reserve the spot instances, but however Launch Template does
2020-03-31 20:07:01 +05:30
Peter Rifel ee86488d98 Don't set terraform's user_data if it is an empty string
Bastion hosts have no user_data by default.
This is not valid in terraform, based on the error messages reported here [0]

The Terraform provider code says user_data is optional for both LaunchConfigurations and LaunchTemplates [1] [2]

This change prevents the user_data property from being added to aws_launch_configuration and aws_launch_template resources unless the string is not empty.

[0] https://travis-ci.org/github/kubernetes/kops/jobs/662472020
[1] 04d24f80f3/aws/resource_aws_launch_configuration.go (L74-L76)
[2] 04d24f80f3/aws/resource_aws_launch_template.go (L510-L512)
2020-03-31 09:33:16 -05:00
Ciprian Hacman fb68aae41f
Apply suggestions from code review #1
Co-Authored-By: John Gardiner Myers <jgmyers@proofpoint.com>
2020-03-16 19:48:19 +02:00
Ciprian Hacman 59a6b065a0 Add root volume tags for CF and TF targets 2020-03-16 18:41:39 +02:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Ryan Bonham 1c4775a46c We are not deleting the primary ENI for private networks on termination, which will run accounts our of ENIs. 2019-06-04 21:39:17 -05:00
Taehyun Kim ddf79be176 fix terraform spot_options key 2019-05-15 23:38:50 +09:00
Rodrigo Menezes d931c1ff60 defer the base64 encoding so that users get usable diffs 2019-04-07 14:31:45 -07:00
Rodrigo Menezes 9a44778eab When a network interface is provided, the security groups must be a part of it. 2019-04-07 14:17:13 -07:00
Rodrigo Menezes 63b7a9d4d9 Add launch template to use 2019-04-07 14:17:13 -07:00
Rohith 74af751dc6 - fixing up the conflicts post the additional volumes merge 2019-02-04 14:15:16 +00:00
Rohith ff25209381 - fixing up the terraform render to use the correct format for the device mappings (was using the launchconfiguration ones) 2019-02-04 12:00:04 +00:00
Rohith e2574f3938 - splitting out the code per target
- adding some unit testing for the terraform render
- adding the terraform render, updating the autoscaling and creating the launchtemplate
2019-02-04 12:00:04 +00:00