sidpalas / devops-directive-terraform-course

Companion repo for complete Terraform course
994 stars 1.62k forks source link

[Bugfix] Fix deployment logic #4

Closed sidpalas closed 3 years ago

sidpalas commented 3 years ago

Fix filtering across branches and releases

github-actions[bot] commented 3 years ago

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan ```terraform module.web_app.aws_security_group.instances: Refreshing state... [id=sg-0e5282feeb11a97bd] module.web_app.aws_security_group.alb: Refreshing state... [id=sg-07653b2e478d5e0f0] module.web_app.aws_db_instance.db_instance: Refreshing state... [id=terraform-20210528001018168500000001] module.web_app.aws_s3_bucket.bucket: Refreshing state... [id=devops-directive-web-app-data-staging] module.web_app.aws_security_group_rule.allow_alb_all_outbound: Refreshing state... [id=sgrule-953668356] module.web_app.aws_security_group_rule.allow_alb_http_inbound: Refreshing state... [id=sgrule-2076740809] module.web_app.aws_security_group_rule.allow_http_inbound: Refreshing state... [id=sgrule-2525436985] module.web_app.aws_instance.instance_2: Refreshing state... [id=i-008d94b65cb170bae] module.web_app.aws_instance.instance_1: Refreshing state... [id=i-07137c2fe387b4bff] module.web_app.aws_lb_target_group.instances: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118] module.web_app.aws_lb.load_balancer: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:loadbalancer/app/web-app-staging-web-app-lb/9f2c3d2df52a350f] module.web_app.aws_lb_listener.http: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:listener/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1] module.web_app.aws_route53_record.root: Refreshing state... [id=Z05397741ZZ7VVPSPNX5P_staging.mysuperawesomesite.com_A] module.web_app.aws_lb_listener_rule.instances: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:listener-rule/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1/f5cbdcc7cd2e70af] module.web_app.aws_lb_target_group_attachment.instance_2: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118-20210528001041420100000002] module.web_app.aws_lb_target_group_attachment.instance_1: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118-20210528001051433400000003] Note: Objects have changed outside of Terraform Terraform detected the following changes made outside of Terraform since the last "terraform apply": # module.web_app.aws_lb_target_group.instances has been changed ~ resource "aws_lb_target_group" "instances" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118" name = "web-app-staging-tg" + tags = {} # (13 unchanged attributes hidden) # (2 unchanged blocks hidden) } # module.web_app.aws_instance.instance_1 has been changed ~ resource "aws_instance" "instance_1" { id = "i-07137c2fe387b4bff" + tags = {} # (29 unchanged attributes hidden) # (5 unchanged blocks hidden) } # module.web_app.aws_db_instance.db_instance has been changed ~ resource "aws_db_instance" "db_instance" { + enabled_cloudwatch_logs_exports = [] id = "terraform-20210528001018168500000001" name = "stagingmydb" + security_group_names = [] + tags = {} # (49 unchanged attributes hidden) } # module.web_app.aws_security_group_rule.allow_alb_all_outbound has been changed ~ resource "aws_security_group_rule" "allow_alb_all_outbound" { id = "sgrule-953668356" + ipv6_cidr_blocks = [] + prefix_list_ids = [] # (7 unchanged attributes hidden) } # module.web_app.aws_security_group_rule.allow_http_inbound has been changed ~ resource "aws_security_group_rule" "allow_http_inbound" { id = "sgrule-2525436985" + ipv6_cidr_blocks = [] + prefix_list_ids = [] # (7 unchanged attributes hidden) } # module.web_app.aws_lb_listener.http has been changed ~ resource "aws_lb_listener" "http" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:listener/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1" + tags = {} # (5 unchanged attributes hidden) # (1 unchanged block hidden) } # module.web_app.aws_security_group.alb has been changed ~ resource "aws_security_group" "alb" { ~ egress = [ + { + cidr_blocks = [ + "0.0.0.0/0", ] + description = "" + from_port = 0 + ipv6_cidr_blocks = [] + prefix_list_ids = [] + protocol = "-1" + security_groups = [] + self = false + to_port = 0 }, ] id = "sg-07653b2e478d5e0f0" ~ ingress = [ + { + cidr_blocks = [ + "0.0.0.0/0", ] + description = "" + from_port = 80 + ipv6_cidr_blocks = [] + prefix_list_ids = [] + protocol = "tcp" + security_groups = [] + self = false + to_port = 80 }, ] name = "web-app-staging-alb-security-group" + tags = {} # (6 unchanged attributes hidden) } # module.web_app.aws_security_group_rule.allow_alb_http_inbound has been changed ~ resource "aws_security_group_rule" "allow_alb_http_inbound" { id = "sgrule-2076740809" + ipv6_cidr_blocks = [] + prefix_list_ids = [] # (7 unchanged attributes hidden) } # module.web_app.aws_s3_bucket.bucket has been changed ~ resource "aws_s3_bucket" "bucket" { id = "devops-directive-web-app-data-staging" + tags = {} # (10 unchanged attributes hidden) # (2 unchanged blocks hidden) } # module.web_app.aws_instance.instance_2 has been changed ~ resource "aws_instance" "instance_2" { id = "i-008d94b65cb170bae" + tags = {} # (29 unchanged attributes hidden) # (5 unchanged blocks hidden) } # module.web_app.aws_lb.load_balancer has been changed ~ resource "aws_lb" "load_balancer" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:loadbalancer/app/web-app-staging-web-app-lb/9f2c3d2df52a350f" name = "web-app-staging-web-app-lb" + tags = {} # (15 unchanged attributes hidden) # (7 unchanged blocks hidden) } # module.web_app.aws_route53_record.root has been changed ~ resource "aws_route53_record" "root" { id = "Z05397741ZZ7VVPSPNX5P_staging.mysuperawesomesite.com_A" name = "staging.mysuperawesomesite.com" + records = [] + ttl = 0 # (3 unchanged attributes hidden) # (1 unchanged block hidden) } # module.web_app.aws_lb_listener_rule.instances has been changed ~ resource "aws_lb_listener_rule" "instances" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:listener-rule/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1/f5cbdcc7cd2e70af" + tags = {} # (4 unchanged attributes hidden) # (2 unchanged blocks hidden) } # module.web_app.aws_security_group.instances has been changed ~ resource "aws_security_group" "instances" { id = "sg-0e5282feeb11a97bd" ~ ingress = [ + { + cidr_blocks = [ + "0.0.0.0/0", ] + description = "" + from_port = 8080 + ipv6_cidr_blocks = [] + prefix_list_ids = [] + protocol = "tcp" + security_groups = [] + self = false + to_port = 8080 }, ] name = "web-app-staging-instance-security-group" + tags = {} # (7 unchanged attributes hidden) } Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes. ───────────────────────────────────────────────────────────────────────────── No changes. Your infrastructure matches the configuration. Your configuration already matches the changes detected above. If you'd like to update the Terraform state to match, create and apply a refresh-only plan: terraform apply -refresh-only ```

Pusher: @sidpalas, Action: pull_request

github-actions[bot] commented 3 years ago

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan ```terraform module.web_app.aws_security_group.alb: Refreshing state... [id=sg-07653b2e478d5e0f0] module.web_app.aws_s3_bucket.bucket: Refreshing state... [id=devops-directive-web-app-data-staging] module.web_app.aws_security_group.instances: Refreshing state... [id=sg-0e5282feeb11a97bd] module.web_app.aws_db_instance.db_instance: Refreshing state... [id=terraform-20210528001018168500000001] module.web_app.aws_instance.instance_2: Refreshing state... [id=i-008d94b65cb170bae] module.web_app.aws_security_group_rule.allow_http_inbound: Refreshing state... [id=sgrule-2525436985] module.web_app.aws_instance.instance_1: Refreshing state... [id=i-07137c2fe387b4bff] module.web_app.aws_security_group_rule.allow_alb_all_outbound: Refreshing state... [id=sgrule-953668356] module.web_app.aws_security_group_rule.allow_alb_http_inbound: Refreshing state... [id=sgrule-2076740809] module.web_app.aws_lb_target_group.instances: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118] module.web_app.aws_lb.load_balancer: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:loadbalancer/app/web-app-staging-web-app-lb/9f2c3d2df52a350f] module.web_app.aws_lb_listener.http: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:listener/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1] module.web_app.aws_lb_target_group_attachment.instance_2: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118-20210528001041420100000002] module.web_app.aws_lb_target_group_attachment.instance_1: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118-20210528001051433400000003] module.web_app.aws_lb_listener_rule.instances: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:917774925227:listener-rule/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1/f5cbdcc7cd2e70af] module.web_app.aws_route53_record.root: Refreshing state... [id=Z05397741ZZ7VVPSPNX5P_staging.mysuperawesomesite.com_A] Note: Objects have changed outside of Terraform Terraform detected the following changes made outside of Terraform since the last "terraform apply": # module.web_app.aws_security_group.alb has been changed ~ resource "aws_security_group" "alb" { ~ egress = [ + { + cidr_blocks = [ + "0.0.0.0/0", ] + description = "" + from_port = 0 + ipv6_cidr_blocks = [] + prefix_list_ids = [] + protocol = "-1" + security_groups = [] + self = false + to_port = 0 }, ] id = "sg-07653b2e478d5e0f0" ~ ingress = [ + { + cidr_blocks = [ + "0.0.0.0/0", ] + description = "" + from_port = 80 + ipv6_cidr_blocks = [] + prefix_list_ids = [] + protocol = "tcp" + security_groups = [] + self = false + to_port = 80 }, ] name = "web-app-staging-alb-security-group" + tags = {} # (6 unchanged attributes hidden) } # module.web_app.aws_instance.instance_2 has been changed ~ resource "aws_instance" "instance_2" { id = "i-008d94b65cb170bae" + tags = {} # (29 unchanged attributes hidden) # (5 unchanged blocks hidden) } # module.web_app.aws_db_instance.db_instance has been changed ~ resource "aws_db_instance" "db_instance" { + enabled_cloudwatch_logs_exports = [] id = "terraform-20210528001018168500000001" name = "stagingmydb" + security_group_names = [] + tags = {} # (49 unchanged attributes hidden) } # module.web_app.aws_s3_bucket.bucket has been changed ~ resource "aws_s3_bucket" "bucket" { id = "devops-directive-web-app-data-staging" + tags = {} # (10 unchanged attributes hidden) # (2 unchanged blocks hidden) } # module.web_app.aws_lb_target_group.instances has been changed ~ resource "aws_lb_target_group" "instances" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:targetgroup/web-app-staging-tg/abe32606c9eb9118" name = "web-app-staging-tg" + tags = {} # (13 unchanged attributes hidden) # (2 unchanged blocks hidden) } # module.web_app.aws_route53_record.root has been changed ~ resource "aws_route53_record" "root" { id = "Z05397741ZZ7VVPSPNX5P_staging.mysuperawesomesite.com_A" name = "staging.mysuperawesomesite.com" + records = [] + ttl = 0 # (3 unchanged attributes hidden) # (1 unchanged block hidden) } # module.web_app.aws_security_group.instances has been changed ~ resource "aws_security_group" "instances" { id = "sg-0e5282feeb11a97bd" ~ ingress = [ + { + cidr_blocks = [ + "0.0.0.0/0", ] + description = "" + from_port = 8080 + ipv6_cidr_blocks = [] + prefix_list_ids = [] + protocol = "tcp" + security_groups = [] + self = false + to_port = 8080 }, ] name = "web-app-staging-instance-security-group" + tags = {} # (7 unchanged attributes hidden) } # module.web_app.aws_security_group_rule.allow_alb_http_inbound has been changed ~ resource "aws_security_group_rule" "allow_alb_http_inbound" { id = "sgrule-2076740809" + ipv6_cidr_blocks = [] + prefix_list_ids = [] # (7 unchanged attributes hidden) } # module.web_app.aws_security_group_rule.allow_alb_all_outbound has been changed ~ resource "aws_security_group_rule" "allow_alb_all_outbound" { id = "sgrule-953668356" + ipv6_cidr_blocks = [] + prefix_list_ids = [] # (7 unchanged attributes hidden) } # module.web_app.aws_instance.instance_1 has been changed ~ resource "aws_instance" "instance_1" { id = "i-07137c2fe387b4bff" + tags = {} # (29 unchanged attributes hidden) # (5 unchanged blocks hidden) } # module.web_app.aws_lb_listener.http has been changed ~ resource "aws_lb_listener" "http" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:listener/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1" + tags = {} # (5 unchanged attributes hidden) # (1 unchanged block hidden) } # module.web_app.aws_security_group_rule.allow_http_inbound has been changed ~ resource "aws_security_group_rule" "allow_http_inbound" { id = "sgrule-2525436985" + ipv6_cidr_blocks = [] + prefix_list_ids = [] # (7 unchanged attributes hidden) } # module.web_app.aws_lb_listener_rule.instances has been changed ~ resource "aws_lb_listener_rule" "instances" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:listener-rule/app/web-app-staging-web-app-lb/9f2c3d2df52a350f/5b7f505ab13325e1/f5cbdcc7cd2e70af" + tags = {} # (4 unchanged attributes hidden) # (2 unchanged blocks hidden) } # module.web_app.aws_lb.load_balancer has been changed ~ resource "aws_lb" "load_balancer" { id = "arn:aws:elasticloadbalancing:us-east-1:917774925227:loadbalancer/app/web-app-staging-web-app-lb/9f2c3d2df52a350f" name = "web-app-staging-web-app-lb" + tags = {} # (15 unchanged attributes hidden) # (7 unchanged blocks hidden) } Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes. ───────────────────────────────────────────────────────────────────────────── No changes. Your infrastructure matches the configuration. Your configuration already matches the changes detected above. If you'd like to update the Terraform state to match, create and apply a refresh-only plan: terraform apply -refresh-only ```

Pusher: @sidpalas, Action: pull_request