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

Feature/46 51 unified #54

Merged
merged 71 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c366c67
Merge pull request #2 from getndazn/feature/sync-with-upstream
hexionas Jun 17, 2019
37f13e2
PLAT-1652: Move bastions to use spot instances (#3)
carvalho-dazn Nov 15, 2019
1b7fbb2
Add unique target group name for bastion host elb
simonkey007 Apr 16, 2020
7434c78
Merge pull request #5 from getndazn/PLAT-3903/rds_proxy_accessible_th…
simonkey007 Apr 16, 2020
316033e
Use iam_instance_profile as block, not argument
May 27, 2020
743c05e
Merge pull request #8 from getndazn/fix-launch-profile
May 27, 2020
f4ca781
Add tags to aws_launch_template
May 28, 2020
5b060d6
Fix aws_launch_template
May 28, 2020
d0dfbd4
Fix aws_autoscaling_group - remove doubled $ from version
May 28, 2020
97c95c4
Merge pull request #9 from getndazn/fix-launch-template
May 28, 2020
70394c1
Remove hardcoded intance types from ASG
Jun 3, 2020
0930d52
Merge pull request #10 from getndazn/instance-types
Jun 3, 2020
fb410ab
Add name tag to instance tags for launch template
Jun 4, 2020
7438646
Merge pull request #11 from getndazn/name-tag
Jun 4, 2020
5087116
Delete network interface on instance termination
Jun 12, 2020
686f006
Merge pull request #12 from getndazn/delete-on-termination
Jun 12, 2020
034d800
Enable metrics collection on ASG
Jul 1, 2020
b20f4c3
Merge pull request #13 from getndazn/PLAT-4675/logs+metrics
Jul 1, 2020
3a55d5a
Allow instances to kill themselves via ASG custom health check
Jul 8, 2020
7d854d0
Merge pull request #14 from getndazn/PLAT-4678/perms-for-set-instance…
Jul 9, 2020
2ef9e82
Enable setting EBS size for bastion instance
Aug 3, 2020
22ca205
Merge pull request #15 from getndazn/ebs-size
Aug 3, 2020
3de07dc
Fix default name for ebs device
Aug 3, 2020
e4fb0fb
Merge pull request #16 from getndazn/ebs-device-name
Aug 3, 2020
3ca77ac
Change names for LB,launch_template,target_group,ASG
Aug 20, 2020
06f84a0
Merge pull request #17 from getndazn/names-changes
Aug 20, 2020
2d917d2
Fix name for target group
Aug 20, 2020
460345e
Merge pull request #18 from getndazn/tg-name-fix
Aug 20, 2020
f713d4e
experimental conditional output
Jan 10, 2022
d2cb2e0
WIP working to move away from template_file
joshuamkite Jan 10, 2022
95c2b55
WIP initial subsititution for template_file userdata
Jan 11, 2022
9c2f108
use bools once not comapre comparaitors
Jan 11, 2022
b73ab20
move all template tp template_file
Jan 11, 2022
37ccde2
initial working version with no template provider
joshuamkite Jan 11, 2022
562d73b
remove use of null provider and implement/enable provider default tag…
joshuamkite Jan 23, 2022
33a41e3
restore formatting after reflow
joshuamkite Jan 23, 2022
3152208
formatting; spelling
joshuamkite Jan 23, 2022
385e601
remove redundant provider spec
joshuamkite Jan 23, 2022
9aea8bc
remove redundany file
joshuamkite Jan 23, 2022
b092bec
terraform version
joshuamkite Jan 23, 2022
a98df87
update changelog
joshuamkite Jan 23, 2022
69354f8
readme: formatting; user data sectino
joshuamkite Jan 23, 2022
16b8136
resolve conflicts
joshuamkite Jan 27, 2022
4499394
Merge branch 'getndazn-master' into feature_46/launch_template_dazn
joshuamkite Jan 27, 2022
07cf1fd
restore dazn launch template tags
joshuamkite Jan 27, 2022
3694ded
experimental conditional output
Jan 10, 2022
6a4a0bd
WIP working to move away from template_file
joshuamkite Jan 10, 2022
3e295b4
WIP initial subsititution for template_file userdata
Jan 11, 2022
447ac24
use bools once not comapre comparaitors
Jan 11, 2022
6f0a60a
move all template tp template_file
Jan 11, 2022
f92312f
initial working version with no template provider
joshuamkite Jan 11, 2022
2b0518a
remove use of null provider and implement/enable provider default tag…
joshuamkite Jan 23, 2022
a273410
restore formatting after reflow
joshuamkite Jan 23, 2022
ad229d1
formatting; spelling
joshuamkite Jan 23, 2022
ac1b840
remove redundant provider spec
joshuamkite Jan 23, 2022
ac1fb16
remove redundany file
joshuamkite Jan 23, 2022
b2025b3
terraform version
joshuamkite Jan 23, 2022
8a466b6
update changelog
joshuamkite Jan 23, 2022
6924203
readme: formatting; user data sectino
joshuamkite Jan 23, 2022
89e25d8
merge conflicts
joshuamkite Jan 27, 2022
f75938d
revert inapproriate merge
joshuamkite Jan 27, 2022
fdc5299
Merge branch 'feature/46_51_unified' into issue_51/template_file
joshuamkite Jan 27, 2022
9560240
Merge pull request #53 from joshuamkite/issue_51/template_file
joshuamkite Jan 27, 2022
e6ed993
debug and polish for release 7.0
joshuamkite Jan 27, 2022
c8a4193
Merge branch 'feature/46_51_unified' of github.com:joshuamkite/terraf…
joshuamkite Jan 27, 2022
44b8b26
remove asg health suicide permissions as no use case case described i…
joshuamkite Feb 8, 2022
4b91a51
restore examples/full.../main.tf
joshuamkite Feb 8, 2022
9946874
update changelog
joshuamkite Feb 8, 2022
9e3fc05
move locals to lcals.tf
joshuamkite Feb 9, 2022
a9bb4e9
rename *.tpl to *.tftpl
joshuamkite Feb 9, 2022
7b08db8
changelog
joshuamkite Feb 9, 2022
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
3 changes: 3 additions & 0 deletions CHANGELOG/2020-05-27-fix-launch-profile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- type: fixed
m: Use iam_instance_profile as block, not argument
owner: mwieczorek
35 changes: 18 additions & 17 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,21 @@ resource "aws_launch_template" "bastion-service-host" {
key_name = var.bastion_service_host_key_name
user_data = data.template_cloudinit_config.config.rendered

iam_instance_profile = element(
concat(
aws_iam_instance_profile.bastion_service_assume_role_profile.*.arn,
aws_iam_instance_profile.bastion_service_profile.*.arn,
),
0,
)
iam_instance_profile {
name = element(
concat(
aws_iam_instance_profile.bastion_service_assume_role_profile.*.arn,
aws_iam_instance_profile.bastion_service_profile.*.arn,
),
0,
)
}

network_interfaces {
associate_public_ip_address = var.public_ip
security_groups = concat(
[aws_security_group.bastion_service.id],
var.security_groups_additional
security_groups = concat(
[aws_security_group.bastion_service.id],
var.security_groups_additional
)
}

Expand All @@ -69,11 +71,11 @@ data "null_data_source" "asg-tags" {
}

resource "aws_autoscaling_group" "bastion-service" {
availability_zones = data.aws_availability_zones.available.names
name_prefix = "${var.service_name}-asg"
max_size = var.asg_max
min_size = var.asg_min
desired_capacity = var.asg_desired
availability_zones = data.aws_availability_zones.available.names
name_prefix = "${var.service_name}-asg"
max_size = var.asg_max
min_size = var.asg_min
desired_capacity = var.asg_desired

mixed_instances_policy {
instances_distribution {
Expand Down Expand Up @@ -101,7 +103,7 @@ resource "aws_autoscaling_group" "bastion-service" {
}
}

vpc_zone_identifier = var.subnets_asg
vpc_zone_identifier = var.subnets_asg
target_group_arns = concat(
[aws_lb_target_group.bastion-service.arn],
aws_lb_target_group.bastion-host.*.arn
Expand Down Expand Up @@ -145,4 +147,3 @@ data "template_file" "sample_policies_for_parent_account" {
assume_role_arn = var.assume_role_arn
}
}