Skip to content

Commit

Permalink
Merge pull request #104 from rackspace-infrastructure-automation/amz2023
Browse files Browse the repository at this point in the history
Replace Amazon 2022 with 2023
  • Loading branch information
stevengorrell committed Apr 5, 2023
2 parents 25f2f7f + b5c6498 commit 3e8ddb5
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ locals {
amazon2 = local.defaults["diagnostic_packages"]["amazon"]
amazoneks = local.defaults["diagnostic_packages"]["amazon"]
amazonecs = local.defaults["diagnostic_packages"]["amazon"]
amazon2022 = local.defaults["diagnostic_packages"]["amazon"]
amazon2023 = local.defaults["diagnostic_packages"]["amazon"]
rhel7 = local.defaults["diagnostic_packages"]["rhel"]
rhel8 = local.defaults["diagnostic_packages"]["rhel"]
centos7 = local.defaults["diagnostic_packages"]["rhel"]
Expand All @@ -217,7 +217,7 @@ locals {

user_data_map = {
amazon2 = "amazon_linux_userdata.sh"
amazon2022 = "amazon_linux_userdata.sh"
amazon2023 = "amazon_linux_userdata.sh"
centos7 = "rhel_centos_7_userdata.sh"
rhel7 = "rhel_centos_7_userdata.sh"
rhel8 = "rhel_centos_8_userdata.sh"
Expand All @@ -233,7 +233,7 @@ locals {

ebs_device_map = {
amazon2 = "/dev/sdf"
amazon2022 = "/dev/sdf"
amazon2023 = "/dev/sdf"
centos7 = "/dev/sdf"
rhel7 = "/dev/sdf"
rhel8 = "/dev/sdf"
Expand Down Expand Up @@ -268,7 +268,7 @@ locals {

nfs_packages = {
amazon2 = "nfs-utils"
amazon2022 = "nfs-utils"
amazon2023 = "nfs-utils"
centos7 = "nfs-utils"
ubuntu18 = "nfs-kernel-server rpcbind nfs-common nfs4-acl-tools"
ubuntu20 = "nfs-kernel-server rpcbind nfs-common nfs4-acl-tools"
Expand Down Expand Up @@ -296,7 +296,7 @@ EOF

ami_owner_mapping = {
amazon2 = "137112412989"
amazon2022 = "137112412989"
amazon2023 = "137112412989"
centos7 = "125523088429"
rhel7 = "309956199498"
rhel8 = "309956199498"
Expand All @@ -312,7 +312,7 @@ EOF

ami_name_mapping = {
amazon2 = "amzn2-ami-hvm-2.0.*-ebs"
amazon2022 = "al2022-ami-2022*-kernel-*-x86_64"
amazon2023 = "al2023-ami-2023*-kernel-*-x86_64"
centos7 = "CentOS Linux 7 x86_64 - *"
rhel7 = "RHEL-7.*_HVM-*x86_64*"
rhel8 = "RHEL-8.*_HVM-*x86_64*"
Expand All @@ -329,7 +329,7 @@ EOF
# Any custom AMI filters for a given OS can be added in this mapping
image_filter = {
amazon2 = []
amazon2022 = []
amazon2023 = []
rhel7 = []
rhel8 = []
centos7 = []
Expand Down
45 changes: 45 additions & 0 deletions tests/test1/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,48 @@ module "ar_r53" {

tags = local.tags
}

module "ec2_ar_amazon2023_no_codedeploy" {
source = "../../module"

ec2_os = "amazon2023"
instance_count = 1
subnets = module.vpc.public_subnets
security_groups = [module.vpc.default_sg]
key_pair = "CircleCI"
instance_type = "t2.micro"
name = "${random_string.res_name.result}-ar_amazon2023_noncodedeploy"
install_codedeploy_agent = false
enable_ebs_optimization = false
tenancy = "default"
backup_tag_value = "False"
detailed_monitoring = true
ssm_patching_group = "Group1Patching"
primary_ebs_volume_size = 60
primary_ebs_volume_iops = 0
primary_ebs_volume_type = "gp2"
secondary_ebs_volume_size = 60
secondary_ebs_volume_iops = 0
secondary_ebs_volume_type = "gp2"
encrypt_secondary_ebs_volume = false

environment = "Development"
instance_role_managed_policy_arns = ["arn:aws:iam::aws:policy/AmazonEC2FullAccess", "arn:aws:iam::aws:policy/service-role/AmazonEC2SpotFleetRole", "arn:aws:iam::aws:policy/CloudWatchActionsEC2Access"]
perform_ssm_inventory_tag = true
cloudwatch_log_retention = 30
ssm_association_refresh_rate = "rate(1 day)"
notification_topic = ""
disable_api_termination = false
t2_unlimited_mode = "standard"
creation_policy_timeout = "20m"
cw_cpu_high_operator = "GreaterThanThreshold"
cw_cpu_high_threshold = 90
cw_cpu_high_evaluations = 15
cw_cpu_high_period = 60
eip_allocation_id_count = 1
eip_allocation_id_list = [aws_eip.test_eip_2.id]

ebs_volume_tags = local.tags

tags = local.tags
}

0 comments on commit 3e8ddb5

Please sign in to comment.