Skip to content

#58 [terraform] cloudwatch用のVPCエンドポイント作成-2 #63

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

Merged

Conversation

lazmond3
Copy link
Owner

@lazmond3 lazmond3 commented May 8, 2021

@lazmond3
Copy link
Owner Author

lazmond3 commented May 8, 2021

.build

@github-actions
Copy link

github-actions bot commented May 8, 2021

start :app:jib build....
CI URL: https://github.com/lazmond3/line-bot-sample2/actions/runs/823210354

@github-actions
Copy link

github-actions bot commented May 8, 2021

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan
module.rds.aws_rds_cluster_parameter_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_cluster.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:cluster/line-bot-sample2]
module.vpc.aws_vpc.main: Refreshing state... [id=vpc-0b9c9dcab97f3491c]
module.route53.aws_acm_certificate.main: Refreshing state... [id=arn:aws:acm:ap-northeast-1:554506578892:certificate/06e7b54e-fc23-4c2b-8939-aabde5bbb683]
module.ecr-app.aws_ecr_repository.main: Refreshing state... [id=line-bot-sample2-app]
module.rds.aws_key_pair.mmm2: Refreshing state... [id=mmm2]
module.rds.aws_ssm_parameter.database_password_secret: Refreshing state... [id=MYSQL_PASSWORD]
module.ecs.aws_cloudwatch_log_group.line-bot-sample2: Refreshing state... [id=/aws/ecs/line-bot-sample2]
module.ecs.aws_iam_role.ecs_task_execution_role: Refreshing state... [id=EcsTaskRole-line-bot-sample2]
module.ecs.aws_iam_role_policy_attachment.ecs_task_execution_role_policy_for_ecr: Refreshing state... [id=EcsTaskRole-line-bot-sample2-20210429021106029600000001]
module.ecs.aws_iam_role_policy.cloudwatch_logs: Refreshing state... [id=EcsTaskRole-line-bot-sample2:cloudwatch_logs]
module.route53.aws_route53_record.validations["line-bot-sample2.moikilo00.net"]: Refreshing state... [id=Z04052072YGY8CIREK2A2__9423f2f8b78ae3bdeb3548f1bea69efa.line-bot-sample2.moikilo00.net._CNAME]
module.route53.aws_acm_certificate_validation.main: Refreshing state... [id=2021-04-27 09:08:01 +0000 UTC]
module.rds.aws_iam_role_policy.mysql_db_password_policy_secretsmanager: Refreshing state... [id=EcsTaskRole-line-bot-sample2:password-policy-mysql_db_password_policy_secretsmanager]
module.vpc.aws_subnet.privates[1]: Refreshing state... [id=subnet-071a11b51c485b0b1]
module.vpc.aws_subnet.publics[1]: Refreshing state... [id=subnet-0a3c585bbf6bba58b]
module.vpc.aws_subnet.privates[0]: Refreshing state... [id=subnet-0d00944d99dfe3fb9]
module.vpc.aws_subnet.privates[2]: Refreshing state... [id=subnet-02c271aaae088ea4b]
module.alb.aws_security_group.alb: Refreshing state... [id=sg-0829c8222f3c2e3f0]
module.vpc.aws_route_table.public: Refreshing state... [id=rtb-0833e5cbb3feed7c4]
module.vpc.aws_route_table.privates[0]: Refreshing state... [id=rtb-0b7249501f7f39f80]
module.vpc.aws_route_table.privates[1]: Refreshing state... [id=rtb-0a31ed301afa10c9e]
module.vpc.aws_route_table.privates[2]: Refreshing state... [id=rtb-0f70a7f400318b4fa]
module.vpc.aws_internet_gateway.main: Refreshing state... [id=igw-0db9d7fef1d452a9f]
module.vpc.aws_subnet.publics[2]: Refreshing state... [id=subnet-03c288199d18a8e45]
module.vpc.aws_subnet.publics[0]: Refreshing state... [id=subnet-0bb63a2f82ac5687b]
module.alb.aws_lb_target_group.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:targetgroup/line-bot-sample2-target-group/85c2e8b8911549f7]
module.rds.aws_security_group.ec2_private_nat_to_global: Refreshing state... [id=sg-0d5ed516513b6a83c]
module.ecr-app.aws_vpc_endpoint.s3: Refreshing state... [id=vpce-05f06bcd8be5135ea]
module.ecr-app.aws_security_group.vpc_endpoint: Refreshing state... [id=sg-096192166d6f9cd8b]
module.ecs.aws_security_group.ecs: Refreshing state... [id=sg-071dd337cfbbbb50d]
module.rds.aws_security_group.this: Refreshing state... [id=sg-08ac515ab6e8ebdf7]
module.vpc.aws_route.public: Refreshing state... [id=r-rtb-0833e5cbb3feed7c41080289494]
module.rds.aws_security_group.ec2_private: Refreshing state... [id=sg-086f3ab5fea1aa2b9]
module.rds.aws_security_group.mysql_to_private: Refreshing state... [id=sg-0200472868087adb3]
module.rds.aws_security_group.example: Refreshing state... [id=sg-06bdc7be2c94a7cf0]
module.rds.aws_security_group.vpc_endpoint_rds: Refreshing state... [id=sg-0ce678efdd64b44e5]
module.rds.aws_security_group.ec2_public_bastian: Refreshing state... [id=sg-0ca95d51ffe6d8894]
module.vpc.aws_route_table_association.privates[2]: Refreshing state... [id=rtbassoc-0c7b9baba708642b6]
module.vpc.aws_route_table_association.privates[1]: Refreshing state... [id=rtbassoc-0a74d87da37cd4c32]
module.vpc.aws_route_table_association.privates[0]: Refreshing state... [id=rtbassoc-0840d58339cd83f90]
module.vpc.aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-05e859eb1301e09d1]
module.vpc.aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0dfdb12fab7d4006a]
module.vpc.aws_route_table_association.public[2]: Refreshing state... [id=rtbassoc-0f51279304586a58e]
module.rds.aws_security_group_rule.mysql: Refreshing state... [id=sgrule-581596504]
module.ecr-app.aws_vpc_endpoint.ssm: Refreshing state... [id=vpce-0685661311e6eb46b]
module.rds.aws_db_subnet_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecr-app.aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-0aa2aa645cd78c54a]
module.ecr-app.aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-0aada49a067e44d0b]
module.ecr-app.aws_vpc_endpoint.ecr_dkr: Refreshing state... [id=vpce-060745b09df69e96a]
module.alb.aws_lb.this: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:loadbalancer/app/line-bot-sample2/2d23d36ec59ecb9b]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[1]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea46037175]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[2]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea2941716146]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[0]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea3530383921]
module.rds.aws_security_group_rule.out_all: Refreshing state... [id=sgrule-3986439656]
module.rds.aws_vpc_endpoint.rds: Refreshing state... [id=vpce-08152a4039ea057bd]
module.rds.aws_security_group_rule.in_ssh: Refreshing state... [id=sgrule-1848129182]
module.rds.aws_security_group_rule.in_icmp: Refreshing state... [id=sgrule-4046640019]
module.rds.aws_rds_cluster.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.alb.aws_lb_listener.http_to_https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/cb9619fbb54169cb]
module.route53.aws_route53_record.main: Refreshing state... [id=Z04052072YGY8CIREK2A2_line-bot-sample2.moikilo00.net_A]
module.alb.aws_lb_listener.https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261]
module.alb.aws_lb_listener_rule.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener-rule/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261/d135b6a132b7b048]
module.rds.aws_rds_cluster_instance.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_task_definition.main: Refreshing state... [id=line-bot-sample2-task-definition]
module.ecs.aws_ecs_service.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.ecr-app.aws_vpc_endpoint.cloudwatch_logs will be created
  + resource "aws_vpc_endpoint" "cloudwatch_logs" {
      + arn                   = (known after apply)
      + cidr_blocks           = (known after apply)
      + dns_entry             = (known after apply)
      + id                    = (known after apply)
      + network_interface_ids = (known after apply)
      + owner_id              = (known after apply)
      + policy                = (known after apply)
      + prefix_list_id        = (known after apply)
      + private_dns_enabled   = true
      + requester_managed     = (known after apply)
      + route_table_ids       = (known after apply)
      + security_group_ids    = [
          + "sg-096192166d6f9cd8b",
        ]
      + service_name          = "com.amazonaws.ap-northeast-1.logs"
      + state                 = (known after apply)
      + subnet_ids            = [
          + "subnet-02c271aaae088ea4b",
          + "subnet-071a11b51c485b0b1",
          + "subnet-0d00944d99dfe3fb9",
        ]
      + tags_all              = (known after apply)
      + vpc_endpoint_type     = "Interface"
      + vpc_id                = "vpc-0b9c9dcab97f3491c"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Pusher: @lazmond3, Action: pull_request

@github-actions
Copy link

github-actions bot commented May 8, 2021

.build の結果を表示する。

./gradlew :app:jib 📖success

Show Jib Result

@lazmond3
Copy link
Owner Author

lazmond3 commented May 8, 2021

.deploy

@github-actions
Copy link

github-actions bot commented May 8, 2021

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan
module.vpc.aws_vpc.main: Refreshing state... [id=vpc-0b9c9dcab97f3491c]
module.rds.aws_rds_cluster_parameter_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_cloudwatch_log_group.line-bot-sample2: Refreshing state... [id=/aws/ecs/line-bot-sample2]
module.ecr-app.aws_ecr_repository.main: Refreshing state... [id=line-bot-sample2-app]
module.route53.aws_acm_certificate.main: Refreshing state... [id=arn:aws:acm:ap-northeast-1:554506578892:certificate/06e7b54e-fc23-4c2b-8939-aabde5bbb683]
module.rds.aws_key_pair.mmm2: Refreshing state... [id=mmm2]
module.ecs.aws_ecs_cluster.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:cluster/line-bot-sample2]
module.rds.aws_ssm_parameter.database_password_secret: Refreshing state... [id=MYSQL_PASSWORD]
module.ecs.aws_iam_role.ecs_task_execution_role: Refreshing state... [id=EcsTaskRole-line-bot-sample2]
module.ecs.aws_iam_role_policy.cloudwatch_logs: Refreshing state... [id=EcsTaskRole-line-bot-sample2:cloudwatch_logs]
module.ecs.aws_iam_role_policy_attachment.ecs_task_execution_role_policy_for_ecr: Refreshing state... [id=EcsTaskRole-line-bot-sample2-20210429021106029600000001]
module.route53.aws_route53_record.validations["line-bot-sample2.moikilo00.net"]: Refreshing state... [id=Z04052072YGY8CIREK2A2__9423f2f8b78ae3bdeb3548f1bea69efa.line-bot-sample2.moikilo00.net._CNAME]
module.rds.aws_iam_role_policy.mysql_db_password_policy_secretsmanager: Refreshing state... [id=EcsTaskRole-line-bot-sample2:password-policy-mysql_db_password_policy_secretsmanager]
module.route53.aws_acm_certificate_validation.main: Refreshing state... [id=2021-04-27 09:08:01 +0000 UTC]
module.alb.aws_lb_target_group.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:targetgroup/line-bot-sample2-target-group/85c2e8b8911549f7]
module.vpc.aws_route_table.public: Refreshing state... [id=rtb-0833e5cbb3feed7c4]
module.ecr-app.aws_security_group.vpc_endpoint: Refreshing state... [id=sg-096192166d6f9cd8b]
module.vpc.aws_route_table.privates[1]: Refreshing state... [id=rtb-0a31ed301afa10c9e]
module.ecr-app.aws_vpc_endpoint.s3: Refreshing state... [id=vpce-05f06bcd8be5135ea]
module.ecs.aws_security_group.ecs: Refreshing state... [id=sg-071dd337cfbbbb50d]
module.alb.aws_security_group.alb: Refreshing state... [id=sg-0829c8222f3c2e3f0]
module.vpc.aws_subnet.privates[2]: Refreshing state... [id=subnet-02c271aaae088ea4b]
module.vpc.aws_route_table.privates[0]: Refreshing state... [id=rtb-0b7249501f7f39f80]
module.rds.aws_security_group.this: Refreshing state... [id=sg-08ac515ab6e8ebdf7]
module.vpc.aws_subnet.privates[0]: Refreshing state... [id=subnet-0d00944d99dfe3fb9]
module.vpc.aws_subnet.privates[1]: Refreshing state... [id=subnet-071a11b51c485b0b1]
module.vpc.aws_route_table.privates[2]: Refreshing state... [id=rtb-0f70a7f400318b4fa]
module.vpc.aws_internet_gateway.main: Refreshing state... [id=igw-0db9d7fef1d452a9f]
module.vpc.aws_subnet.publics[2]: Refreshing state... [id=subnet-03c288199d18a8e45]
module.vpc.aws_subnet.publics[0]: Refreshing state... [id=subnet-0bb63a2f82ac5687b]
module.vpc.aws_subnet.publics[1]: Refreshing state... [id=subnet-0a3c585bbf6bba58b]
module.rds.aws_security_group.ec2_public_bastian: Refreshing state... [id=sg-0ca95d51ffe6d8894]
module.rds.aws_security_group.ec2_private: Refreshing state... [id=sg-086f3ab5fea1aa2b9]
module.rds.aws_security_group.example: Refreshing state... [id=sg-06bdc7be2c94a7cf0]
module.rds.aws_security_group.mysql_to_private: Refreshing state... [id=sg-0200472868087adb3]
module.rds.aws_security_group.vpc_endpoint_rds: Refreshing state... [id=sg-0ce678efdd64b44e5]
module.rds.aws_security_group.ec2_private_nat_to_global: Refreshing state... [id=sg-0d5ed516513b6a83c]
module.rds.aws_security_group_rule.mysql: Refreshing state... [id=sgrule-581596504]
module.vpc.aws_route.public: Refreshing state... [id=r-rtb-0833e5cbb3feed7c41080289494]
module.vpc.aws_route_table_association.privates[1]: Refreshing state... [id=rtbassoc-0a74d87da37cd4c32]
module.vpc.aws_route_table_association.privates[2]: Refreshing state... [id=rtbassoc-0c7b9baba708642b6]
module.vpc.aws_route_table_association.privates[0]: Refreshing state... [id=rtbassoc-0840d58339cd83f90]
module.vpc.aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-05e859eb1301e09d1]
module.vpc.aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0dfdb12fab7d4006a]
module.vpc.aws_route_table_association.public[2]: Refreshing state... [id=rtbassoc-0f51279304586a58e]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[1]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea46037175]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[2]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea2941716146]
module.rds.aws_db_subnet_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[0]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea3530383921]
module.ecr-app.aws_vpc_endpoint.ssm: Refreshing state... [id=vpce-0685661311e6eb46b]
module.ecr-app.aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-0aa2aa645cd78c54a]
module.ecr-app.aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-0aada49a067e44d0b]
module.rds.aws_security_group_rule.in_icmp: Refreshing state... [id=sgrule-4046640019]
module.rds.aws_security_group_rule.out_all: Refreshing state... [id=sgrule-3986439656]
module.ecr-app.aws_vpc_endpoint.ecr_dkr: Refreshing state... [id=vpce-060745b09df69e96a]
module.rds.aws_security_group_rule.in_ssh: Refreshing state... [id=sgrule-1848129182]
module.rds.aws_vpc_endpoint.rds: Refreshing state... [id=vpce-08152a4039ea057bd]
module.alb.aws_lb.this: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:loadbalancer/app/line-bot-sample2/2d23d36ec59ecb9b]
module.rds.aws_rds_cluster.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.route53.aws_route53_record.main: Refreshing state... [id=Z04052072YGY8CIREK2A2_line-bot-sample2.moikilo00.net_A]
module.alb.aws_lb_listener.https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261]
module.alb.aws_lb_listener.http_to_https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/cb9619fbb54169cb]
module.alb.aws_lb_listener_rule.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener-rule/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261/d135b6a132b7b048]
module.rds.aws_rds_cluster_instance.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_task_definition.main: Refreshing state... [id=line-bot-sample2-task-definition]
module.ecs.aws_ecs_service.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.ecr-app.aws_vpc_endpoint.cloudwatch_logs will be created
  + resource "aws_vpc_endpoint" "cloudwatch_logs" {
      + arn                   = (known after apply)
      + cidr_blocks           = (known after apply)
      + dns_entry             = (known after apply)
      + id                    = (known after apply)
      + network_interface_ids = (known after apply)
      + owner_id              = (known after apply)
      + policy                = (known after apply)
      + prefix_list_id        = (known after apply)
      + private_dns_enabled   = true
      + requester_managed     = (known after apply)
      + route_table_ids       = (known after apply)
      + security_group_ids    = [
          + "sg-096192166d6f9cd8b",
        ]
      + service_name          = "com.amazonaws.ap-northeast-1.logs"
      + state                 = (known after apply)
      + subnet_ids            = [
          + "subnet-02c271aaae088ea4b",
          + "subnet-071a11b51c485b0b1",
          + "subnet-0d00944d99dfe3fb9",
        ]
      + tags_all              = (known after apply)
      + vpc_endpoint_type     = "Interface"
      + vpc_id                = "vpc-0b9c9dcab97f3491c"
    }

  # module.ecs.aws_ecs_service.main will be updated in-place
  ~ resource "aws_ecs_service" "main" {
        id                                 = "arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2"
        name                               = "line-bot-sample2"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:ap-northeast-1:554506578892:task-definition/line-bot-sample2-task-definition:18" -> (known after apply)
        # (14 unchanged attributes hidden)




        # (4 unchanged blocks hidden)
    }

  # module.ecs.aws_ecs_task_definition.main must be replaced
-/+ resource "aws_ecs_task_definition" "main" {
      ~ arn                      = "arn:aws:ecs:ap-northeast-1:554506578892:task-definition/line-bot-sample2-task-definition:18" -> (known after apply)
      ~ container_definitions    = jsonencode(
          ~ [ # forces replacement
              ~ {
                  - cpu              = 0 -> null
                  ~ environment      = [
                      ~ {
                          ~ value = "0.0.1-c79103e" -> "0.0.1-f58bf90"
                            # (1 unchanged element hidden)
                        },
                        {
                            name  = "DB_ADDRESS"
                            value = "linebot-sample2-rds-mysql.cluster-cdx787qeoakd.ap-northeast-1.rds.amazonaws.com"
                        },
                        # (3 unchanged elements hidden)
                    ]
                  - essential        = true -> null
                  ~ image            = "554506578892.dkr.ecr.ap-northeast-1.amazonaws.com/line-bot-sample2-app:0.0.1-c79103e" -> "554506578892.dkr.ecr.ap-northeast-1.amazonaws.com/line-bot-sample2-app:0.0.1-f58bf90"
                  - mountPoints      = [] -> null
                  ~ portMappings     = [
                      ~ {
                          - protocol      = "tcp" -> null
                            # (2 unchanged elements hidden)
                        },
                    ]
                  - volumesFrom      = [] -> null
                    # (3 unchanged elements hidden)
                } # forces replacement,
            ]
        )
      ~ id                       = "line-bot-sample2-task-definition" -> (known after apply)
      ~ revision                 = 18 -> (known after apply)
      - tags                     = {} -> null
      ~ tags_all                 = {} -> (known after apply)
        # (6 unchanged attributes hidden)
    }

Plan: 2 to add, 1 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Pusher: @lazmond3, Action: pull_request

@lazmond3
Copy link
Owner Author

lazmond3 commented May 8, 2021

.deploy

最初にコメントを投稿するようにした
@github-actions
Copy link

github-actions bot commented May 8, 2021

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan
module.rds.aws_rds_cluster_parameter_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.route53.aws_acm_certificate.main: Refreshing state... [id=arn:aws:acm:ap-northeast-1:554506578892:certificate/06e7b54e-fc23-4c2b-8939-aabde5bbb683]
module.rds.aws_key_pair.mmm2: Refreshing state... [id=mmm2]
module.rds.aws_ssm_parameter.database_password_secret: Refreshing state... [id=MYSQL_PASSWORD]
module.vpc.aws_vpc.main: Refreshing state... [id=vpc-0b9c9dcab97f3491c]
module.ecs.aws_ecs_cluster.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:cluster/line-bot-sample2]
module.ecs.aws_cloudwatch_log_group.line-bot-sample2: Refreshing state... [id=/aws/ecs/line-bot-sample2]
module.ecr-app.aws_ecr_repository.main: Refreshing state... [id=line-bot-sample2-app]
module.ecs.aws_iam_role.ecs_task_execution_role: Refreshing state... [id=EcsTaskRole-line-bot-sample2]
module.ecs.aws_iam_role_policy_attachment.ecs_task_execution_role_policy_for_ecr: Refreshing state... [id=EcsTaskRole-line-bot-sample2-20210429021106029600000001]
module.ecs.aws_iam_role_policy.cloudwatch_logs: Refreshing state... [id=EcsTaskRole-line-bot-sample2:cloudwatch_logs]
module.route53.aws_route53_record.validations["line-bot-sample2.moikilo00.net"]: Refreshing state... [id=Z04052072YGY8CIREK2A2__9423f2f8b78ae3bdeb3548f1bea69efa.line-bot-sample2.moikilo00.net._CNAME]
module.rds.aws_iam_role_policy.mysql_db_password_policy_secretsmanager: Refreshing state... [id=EcsTaskRole-line-bot-sample2:password-policy-mysql_db_password_policy_secretsmanager]
module.route53.aws_acm_certificate_validation.main: Refreshing state... [id=2021-04-27 09:08:01 +0000 UTC]
module.vpc.aws_route_table.public: Refreshing state... [id=rtb-0833e5cbb3feed7c4]
module.vpc.aws_internet_gateway.main: Refreshing state... [id=igw-0db9d7fef1d452a9f]
module.vpc.aws_route_table.privates[2]: Refreshing state... [id=rtb-0f70a7f400318b4fa]
module.vpc.aws_subnet.privates[0]: Refreshing state... [id=subnet-0d00944d99dfe3fb9]
module.vpc.aws_subnet.privates[2]: Refreshing state... [id=subnet-02c271aaae088ea4b]
module.vpc.aws_subnet.publics[0]: Refreshing state... [id=subnet-0bb63a2f82ac5687b]
module.vpc.aws_subnet.privates[1]: Refreshing state... [id=subnet-071a11b51c485b0b1]
module.vpc.aws_route_table.privates[0]: Refreshing state... [id=rtb-0b7249501f7f39f80]
module.vpc.aws_route_table.privates[1]: Refreshing state... [id=rtb-0a31ed301afa10c9e]
module.ecs.aws_security_group.ecs: Refreshing state... [id=sg-071dd337cfbbbb50d]
module.vpc.aws_subnet.publics[2]: Refreshing state... [id=subnet-03c288199d18a8e45]
module.vpc.aws_subnet.publics[1]: Refreshing state... [id=subnet-0a3c585bbf6bba58b]
module.alb.aws_security_group.alb: Refreshing state... [id=sg-0829c8222f3c2e3f0]
module.rds.aws_security_group.mysql_to_private: Refreshing state... [id=sg-0200472868087adb3]
module.alb.aws_lb_target_group.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:targetgroup/line-bot-sample2-target-group/85c2e8b8911549f7]
module.rds.aws_security_group.ec2_private: Refreshing state... [id=sg-086f3ab5fea1aa2b9]
module.rds.aws_security_group.ec2_private_nat_to_global: Refreshing state... [id=sg-0d5ed516513b6a83c]
module.rds.aws_security_group.example: Refreshing state... [id=sg-06bdc7be2c94a7cf0]
module.rds.aws_security_group.vpc_endpoint_rds: Refreshing state... [id=sg-0ce678efdd64b44e5]
module.rds.aws_security_group.this: Refreshing state... [id=sg-08ac515ab6e8ebdf7]
module.rds.aws_security_group.ec2_public_bastian: Refreshing state... [id=sg-0ca95d51ffe6d8894]
module.ecr-app.aws_vpc_endpoint.s3: Refreshing state... [id=vpce-05f06bcd8be5135ea]
module.vpc.aws_route.public: Refreshing state... [id=r-rtb-0833e5cbb3feed7c41080289494]
module.ecr-app.aws_security_group.vpc_endpoint: Refreshing state... [id=sg-096192166d6f9cd8b]
module.vpc.aws_route_table_association.privates[1]: Refreshing state... [id=rtbassoc-0a74d87da37cd4c32]
module.vpc.aws_route_table_association.privates[0]: Refreshing state... [id=rtbassoc-0840d58339cd83f90]
module.vpc.aws_route_table_association.privates[2]: Refreshing state... [id=rtbassoc-0c7b9baba708642b6]
module.rds.aws_security_group_rule.mysql: Refreshing state... [id=sgrule-581596504]
module.rds.aws_security_group_rule.in_ssh: Refreshing state... [id=sgrule-1848129182]
module.vpc.aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-05e859eb1301e09d1]
module.vpc.aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0dfdb12fab7d4006a]
module.vpc.aws_route_table_association.public[2]: Refreshing state... [id=rtbassoc-0f51279304586a58e]
module.rds.aws_security_group_rule.in_icmp: Refreshing state... [id=sgrule-4046640019]
module.rds.aws_security_group_rule.out_all: Refreshing state... [id=sgrule-3986439656]
module.rds.aws_vpc_endpoint.rds: Refreshing state... [id=vpce-08152a4039ea057bd]
module.rds.aws_db_subnet_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.alb.aws_lb.this: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:loadbalancer/app/line-bot-sample2/2d23d36ec59ecb9b]
module.ecr-app.aws_vpc_endpoint.ecr_dkr: Refreshing state... [id=vpce-060745b09df69e96a]
module.ecr-app.aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-0aa2aa645cd78c54a]
module.ecr-app.aws_vpc_endpoint.ssm: Refreshing state... [id=vpce-0685661311e6eb46b]
module.ecr-app.aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-0aada49a067e44d0b]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[0]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea3530383921]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[1]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea46037175]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[2]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea2941716146]
module.rds.aws_rds_cluster.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.alb.aws_lb_listener.http_to_https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/cb9619fbb54169cb]
module.alb.aws_lb_listener.https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261]
module.route53.aws_route53_record.main: Refreshing state... [id=Z04052072YGY8CIREK2A2_line-bot-sample2.moikilo00.net_A]
module.alb.aws_lb_listener_rule.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener-rule/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261/d135b6a132b7b048]
module.rds.aws_rds_cluster_instance.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_task_definition.main: Refreshing state... [id=line-bot-sample2-task-definition]
module.ecs.aws_ecs_service.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.ecr-app.aws_vpc_endpoint.cloudwatch_logs will be created
  + resource "aws_vpc_endpoint" "cloudwatch_logs" {
      + arn                   = (known after apply)
      + cidr_blocks           = (known after apply)
      + dns_entry             = (known after apply)
      + id                    = (known after apply)
      + network_interface_ids = (known after apply)
      + owner_id              = (known after apply)
      + policy                = (known after apply)
      + prefix_list_id        = (known after apply)
      + private_dns_enabled   = true
      + requester_managed     = (known after apply)
      + route_table_ids       = (known after apply)
      + security_group_ids    = [
          + "sg-096192166d6f9cd8b",
        ]
      + service_name          = "com.amazonaws.ap-northeast-1.logs"
      + state                 = (known after apply)
      + subnet_ids            = [
          + "subnet-02c271aaae088ea4b",
          + "subnet-071a11b51c485b0b1",
          + "subnet-0d00944d99dfe3fb9",
        ]
      + tags_all              = (known after apply)
      + vpc_endpoint_type     = "Interface"
      + vpc_id                = "vpc-0b9c9dcab97f3491c"
    }

  # module.ecs.aws_ecs_service.main will be updated in-place
  ~ resource "aws_ecs_service" "main" {
        id                                 = "arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2"
        name                               = "line-bot-sample2"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:ap-northeast-1:554506578892:task-definition/line-bot-sample2-task-definition:18" -> (known after apply)
        # (14 unchanged attributes hidden)




        # (4 unchanged blocks hidden)
    }

  # module.ecs.aws_ecs_task_definition.main must be replaced
-/+ resource "aws_ecs_task_definition" "main" {
      ~ arn                      = "arn:aws:ecs:ap-northeast-1:554506578892:task-definition/line-bot-sample2-task-definition:18" -> (known after apply)
      ~ container_definitions    = jsonencode(
          ~ [ # forces replacement
              ~ {
                  - cpu              = 0 -> null
                  ~ environment      = [
                      ~ {
                          ~ value = "0.0.1-c79103e" -> "0.0.1-f58bf90"
                            # (1 unchanged element hidden)
                        },
                        {
                            name  = "DB_ADDRESS"
                            value = "linebot-sample2-rds-mysql.cluster-cdx787qeoakd.ap-northeast-1.rds.amazonaws.com"
                        },
                        # (3 unchanged elements hidden)
                    ]
                  - essential        = true -> null
                  ~ image            = "554506578892.dkr.ecr.ap-northeast-1.amazonaws.com/line-bot-sample2-app:0.0.1-c79103e" -> "554506578892.dkr.ecr.ap-northeast-1.amazonaws.com/line-bot-sample2-app:0.0.1-f58bf90"
                  - mountPoints      = [] -> null
                  ~ portMappings     = [
                      ~ {
                          - protocol      = "tcp" -> null
                            # (2 unchanged elements hidden)
                        },
                    ]
                  - volumesFrom      = [] -> null
                    # (3 unchanged elements hidden)
                } # forces replacement,
            ]
        )
      ~ id                       = "line-bot-sample2-task-definition" -> (known after apply)
      ~ revision                 = 18 -> (known after apply)
      - tags                     = {} -> null
      ~ tags_all                 = {} -> (known after apply)
        # (6 unchanged attributes hidden)
    }

Plan: 2 to add, 1 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Pusher: @lazmond3, Action: pull_request

@lazmond3
Copy link
Owner Author

lazmond3 commented May 8, 2021

.deploy

@github-actions
Copy link

github-actions bot commented May 8, 2021

@github-actions
Copy link

github-actions bot commented May 8, 2021

start terraform apply....
CI URL: https://github.com/lazmond3/line-bot-sample2/actions/runs/823233210

@lazmond3
Copy link
Owner Author

lazmond3 commented May 8, 2021

Any way to checkout PR from issue_comment event? · Issue #
これを参考にして修正

@github-actions
Copy link

github-actions bot commented May 8, 2021

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan
module.vpc.aws_vpc.main: Refreshing state... [id=vpc-0b9c9dcab97f3491c]
module.ecs.aws_cloudwatch_log_group.line-bot-sample2: Refreshing state... [id=/aws/ecs/line-bot-sample2]
module.ecr-app.aws_ecr_repository.main: Refreshing state... [id=line-bot-sample2-app]
module.rds.aws_ssm_parameter.database_password_secret: Refreshing state... [id=MYSQL_PASSWORD]
module.rds.aws_rds_cluster_parameter_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_cluster.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:cluster/line-bot-sample2]
module.route53.aws_acm_certificate.main: Refreshing state... [id=arn:aws:acm:ap-northeast-1:554506578892:certificate/06e7b54e-fc23-4c2b-8939-aabde5bbb683]
module.rds.aws_key_pair.mmm2: Refreshing state... [id=mmm2]
module.ecs.aws_iam_role.ecs_task_execution_role: Refreshing state... [id=EcsTaskRole-line-bot-sample2]
module.ecs.aws_iam_role_policy.cloudwatch_logs: Refreshing state... [id=EcsTaskRole-line-bot-sample2:cloudwatch_logs]
module.ecs.aws_iam_role_policy_attachment.ecs_task_execution_role_policy_for_ecr: Refreshing state... [id=EcsTaskRole-line-bot-sample2-20210429021106029600000001]
module.route53.aws_route53_record.validations["line-bot-sample2.moikilo00.net"]: Refreshing state... [id=Z04052072YGY8CIREK2A2__9423f2f8b78ae3bdeb3548f1bea69efa.line-bot-sample2.moikilo00.net._CNAME]
module.route53.aws_acm_certificate_validation.main: Refreshing state... [id=2021-04-27 09:08:01 +0000 UTC]
module.rds.aws_iam_role_policy.mysql_db_password_policy_secretsmanager: Refreshing state... [id=EcsTaskRole-line-bot-sample2:password-policy-mysql_db_password_policy_secretsmanager]
module.vpc.aws_route_table.privates[2]: Refreshing state... [id=rtb-0f70a7f400318b4fa]
module.vpc.aws_subnet.privates[0]: Refreshing state... [id=subnet-0d00944d99dfe3fb9]
module.vpc.aws_route_table.privates[0]: Refreshing state... [id=rtb-0b7249501f7f39f80]
module.vpc.aws_subnet.privates[1]: Refreshing state... [id=subnet-071a11b51c485b0b1]
module.vpc.aws_subnet.publics[0]: Refreshing state... [id=subnet-0bb63a2f82ac5687b]
module.vpc.aws_subnet.privates[2]: Refreshing state... [id=subnet-02c271aaae088ea4b]
module.vpc.aws_route_table.public: Refreshing state... [id=rtb-0833e5cbb3feed7c4]
module.vpc.aws_internet_gateway.main: Refreshing state... [id=igw-0db9d7fef1d452a9f]
module.alb.aws_lb_target_group.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:targetgroup/line-bot-sample2-target-group/85c2e8b8911549f7]
module.vpc.aws_route_table.privates[1]: Refreshing state... [id=rtb-0a31ed301afa10c9e]
module.vpc.aws_subnet.publics[1]: Refreshing state... [id=subnet-0a3c585bbf6bba58b]
module.vpc.aws_subnet.publics[2]: Refreshing state... [id=subnet-03c288199d18a8e45]
module.alb.aws_security_group.alb: Refreshing state... [id=sg-0829c8222f3c2e3f0]
module.rds.aws_security_group.this: Refreshing state... [id=sg-08ac515ab6e8ebdf7]
module.ecr-app.aws_security_group.vpc_endpoint: Refreshing state... [id=sg-096192166d6f9cd8b]
module.rds.aws_security_group.ec2_public_bastian: Refreshing state... [id=sg-0ca95d51ffe6d8894]
module.rds.aws_security_group.mysql_to_private: Refreshing state... [id=sg-0200472868087adb3]
module.rds.aws_security_group.ec2_private_nat_to_global: Refreshing state... [id=sg-0d5ed516513b6a83c]
module.rds.aws_security_group.vpc_endpoint_rds: Refreshing state... [id=sg-0ce678efdd64b44e5]
module.rds.aws_security_group.example: Refreshing state... [id=sg-06bdc7be2c94a7cf0]
module.rds.aws_security_group.ec2_private: Refreshing state... [id=sg-086f3ab5fea1aa2b9]
module.ecs.aws_security_group.ecs: Refreshing state... [id=sg-071dd337cfbbbb50d]
module.ecr-app.aws_vpc_endpoint.s3: Refreshing state... [id=vpce-05f06bcd8be5135ea]
module.vpc.aws_route.public: Refreshing state... [id=r-rtb-0833e5cbb3feed7c41080289494]
module.vpc.aws_route_table_association.privates[0]: Refreshing state... [id=rtbassoc-0840d58339cd83f90]
module.vpc.aws_route_table_association.privates[1]: Refreshing state... [id=rtbassoc-0a74d87da37cd4c32]
module.vpc.aws_route_table_association.privates[2]: Refreshing state... [id=rtbassoc-0c7b9baba708642b6]
module.rds.aws_security_group_rule.mysql: Refreshing state... [id=sgrule-581596504]
module.vpc.aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-05e859eb1301e09d1]
module.vpc.aws_route_table_association.public[2]: Refreshing state... [id=rtbassoc-0f51279304586a58e]
module.vpc.aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0dfdb12fab7d4006a]
module.ecr-app.aws_vpc_endpoint.ecr_dkr: Refreshing state... [id=vpce-060745b09df69e96a]
module.rds.aws_security_group_rule.in_icmp: Refreshing state... [id=sgrule-4046640019]
module.rds.aws_security_group_rule.in_ssh: Refreshing state... [id=sgrule-1848129182]
module.rds.aws_db_subnet_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.rds.aws_security_group_rule.out_all: Refreshing state... [id=sgrule-3986439656]
module.ecr-app.aws_vpc_endpoint.ssm: Refreshing state... [id=vpce-0685661311e6eb46b]
module.ecr-app.aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-0aa2aa645cd78c54a]
module.ecr-app.aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-0aada49a067e44d0b]
module.rds.aws_vpc_endpoint.rds: Refreshing state... [id=vpce-08152a4039ea057bd]
module.alb.aws_lb.this: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:loadbalancer/app/line-bot-sample2/2d23d36ec59ecb9b]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[2]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea2941716146]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[1]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea46037175]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[0]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea3530383921]
module.rds.aws_rds_cluster.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.alb.aws_lb_listener.https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261]
module.route53.aws_route53_record.main: Refreshing state... [id=Z04052072YGY8CIREK2A2_line-bot-sample2.moikilo00.net_A]
module.alb.aws_lb_listener.http_to_https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/cb9619fbb54169cb]
module.alb.aws_lb_listener_rule.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener-rule/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261/d135b6a132b7b048]
module.rds.aws_rds_cluster_instance.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_task_definition.main: Refreshing state... [id=line-bot-sample2-task-definition]
module.ecs.aws_ecs_service.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.ecr-app.aws_vpc_endpoint.cloudwatch_logs will be created
  + resource "aws_vpc_endpoint" "cloudwatch_logs" {
      + arn                   = (known after apply)
      + cidr_blocks           = (known after apply)
      + dns_entry             = (known after apply)
      + id                    = (known after apply)
      + network_interface_ids = (known after apply)
      + owner_id              = (known after apply)
      + policy                = (known after apply)
      + prefix_list_id        = (known after apply)
      + private_dns_enabled   = true
      + requester_managed     = (known after apply)
      + route_table_ids       = (known after apply)
      + security_group_ids    = [
          + "sg-096192166d6f9cd8b",
        ]
      + service_name          = "com.amazonaws.ap-northeast-1.logs"
      + state                 = (known after apply)
      + subnet_ids            = [
          + "subnet-02c271aaae088ea4b",
          + "subnet-071a11b51c485b0b1",
          + "subnet-0d00944d99dfe3fb9",
        ]
      + tags_all              = (known after apply)
      + vpc_endpoint_type     = "Interface"
      + vpc_id                = "vpc-0b9c9dcab97f3491c"
    }

  # module.ecs.aws_ecs_service.main will be updated in-place
  ~ resource "aws_ecs_service" "main" {
        id                                 = "arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2"
        name                               = "line-bot-sample2"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:ap-northeast-1:554506578892:task-definition/line-bot-sample2-task-definition:19" -> (known after apply)
        # (14 unchanged attributes hidden)




        # (4 unchanged blocks hidden)
    }

  # module.ecs.aws_ecs_task_definition.main will be created
  + resource "aws_ecs_task_definition" "main" {
      + arn                      = (known after apply)
      + container_definitions    = jsonencode(
            [
              + {
                  + environment      = [
                      + {
                          + name  = "CONTAINER_TAG"
                          + value = "0.0.1-f58bf90"
                        },
                      + {
                          + name  = "DB_ADDRESS"
                          + value = "linebot-sample2-rds-mysql.cluster-cdx787qeoakd.ap-northeast-1.rds.amazonaws.com"
                        },
                      + {
                          + name  = "DB_DATABASE"
                          + value = "linebotsample2database"
                        },
                      + {
                          + name  = "DB_PORT"
                          + value = "3306"
                        },
                      + {
                          + name  = "DB_USER"
                          + value = "user"
                        },
                    ]
                  + image            = "554506578892.dkr.ecr.ap-northeast-1.amazonaws.com/line-bot-sample2-app:0.0.1-f58bf90"
                  + logConfiguration = {
                      + logDriver = "awslogs"
                      + options   = {
                          + awslogs-group         = "/ecs/line-bot-sample2/log-example"
                          + awslogs-region        = "ap-northeast-1"
                          + awslogs-stream-prefix = "ecs"
                        }
                    }
                  + name             = "line-bot-sample2-app"
                  + portMappings     = [
                      + {
                          + containerPort = 8080
                          + hostPort      = 8080
                        },
                    ]
                  + secrets          = [
                      + {
                          + name      = "DB_PASSWORD"
                          + valueFrom = "arn:aws:ssm:ap-northeast-1:554506578892:parameter/MYSQL_PASSWORD"
                        },
                    ]
                },
            ]
        )
      + cpu                      = "256"
      + execution_role_arn       = "arn:aws:iam::554506578892:role/EcsTaskRole-line-bot-sample2"
      + family                   = "line-bot-sample2-task-definition"
      + id                       = (known after apply)
      + memory                   = "512"
      + network_mode             = "awsvpc"
      + requires_compatibilities = [
          + "FARGATE",
        ]
      + revision                 = (known after apply)
      + tags_all                 = (known after apply)
    }

Plan: 2 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Pusher: @lazmond3, Action: pull_request

…eckout PR from event? · Issue #](actions/checkout#331) こちらのものを利用した
@github-actions
Copy link

github-actions bot commented May 8, 2021

.deploy の結果を表示する。

Terraform apply 📖success

Show Apply Result
module.rds.aws_ssm_parameter.database_password_secret: Refreshing state... [id=MYSQL_PASSWORD]
module.vpc.aws_vpc.main: Refreshing state... [id=vpc-0b9c9dcab97f3491c]
module.ecs.aws_cloudwatch_log_group.line-bot-sample2: Refreshing state... [id=/aws/ecs/line-bot-sample2]
module.route53.aws_acm_certificate.main: Refreshing state... [id=arn:aws:acm:ap-northeast-1:554506578892:certificate/06e7b54e-fc23-4c2b-8939-aabde5bbb683]
module.ecs.aws_ecs_cluster.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:cluster/line-bot-sample2]
module.ecr-app.aws_ecr_repository.main: Refreshing state... [id=line-bot-sample2-app]
module.rds.aws_rds_cluster_parameter_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.rds.aws_key_pair.mmm2: Refreshing state... [id=mmm2]
module.ecs.aws_iam_role.ecs_task_execution_role: Refreshing state... [id=EcsTaskRole-line-bot-sample2]
module.ecs.aws_iam_role_policy_attachment.ecs_task_execution_role_policy_for_ecr: Refreshing state... [id=EcsTaskRole-line-bot-sample2-20210429021106029600000001]
module.ecs.aws_iam_role_policy.cloudwatch_logs: Refreshing state... [id=EcsTaskRole-line-bot-sample2:cloudwatch_logs]
module.route53.aws_route53_record.validations["line-bot-sample2.moikilo00.net"]: Refreshing state... [id=Z04052072YGY8CIREK2A2__9423f2f8b78ae3bdeb3548f1bea69efa.line-bot-sample2.moikilo00.net._CNAME]
module.route53.aws_acm_certificate_validation.main: Refreshing state... [id=2021-04-27 09:08:01 +0000 UTC]
module.rds.aws_iam_role_policy.mysql_db_password_policy_secretsmanager: Refreshing state... [id=EcsTaskRole-line-bot-sample2:password-policy-mysql_db_password_policy_secretsmanager]
module.vpc.aws_route_table.privates[0]: Refreshing state... [id=rtb-0b7249501f7f39f80]
module.vpc.aws_route_table.public: Refreshing state... [id=rtb-0833e5cbb3feed7c4]
module.vpc.aws_subnet.publics[1]: Refreshing state... [id=subnet-0a3c585bbf6bba58b]
module.vpc.aws_route_table.privates[2]: Refreshing state... [id=rtb-0f70a7f400318b4fa]
module.vpc.aws_subnet.privates[2]: Refreshing state... [id=subnet-02c271aaae088ea4b]
module.vpc.aws_internet_gateway.main: Refreshing state... [id=igw-0db9d7fef1d452a9f]
module.vpc.aws_subnet.privates[1]: Refreshing state... [id=subnet-071a11b51c485b0b1]
module.vpc.aws_route_table.privates[1]: Refreshing state... [id=rtb-0a31ed301afa10c9e]
module.vpc.aws_subnet.publics[0]: Refreshing state... [id=subnet-0bb63a2f82ac5687b]
module.vpc.aws_subnet.privates[0]: Refreshing state... [id=subnet-0d00944d99dfe3fb9]
module.vpc.aws_subnet.publics[2]: Refreshing state... [id=subnet-03c288199d18a8e45]
module.alb.aws_lb_target_group.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:targetgroup/line-bot-sample2-target-group/85c2e8b8911549f7]
module.alb.aws_security_group.alb: Refreshing state... [id=sg-0829c8222f3c2e3f0]
module.ecs.aws_security_group.ecs: Refreshing state... [id=sg-071dd337cfbbbb50d]
module.ecr-app.aws_vpc_endpoint.s3: Refreshing state... [id=vpce-05f06bcd8be5135ea]
module.rds.aws_security_group.ec2_public_bastian: Refreshing state... [id=sg-0ca95d51ffe6d8894]
module.rds.aws_security_group.example: Refreshing state... [id=sg-06bdc7be2c94a7cf0]
module.ecr-app.aws_security_group.vpc_endpoint: Refreshing state... [id=sg-096192166d6f9cd8b]
module.rds.aws_security_group.vpc_endpoint_rds: Refreshing state... [id=sg-0ce678efdd64b44e5]
module.rds.aws_security_group.ec2_private: Refreshing state... [id=sg-086f3ab5fea1aa2b9]
module.rds.aws_security_group.this: Refreshing state... [id=sg-08ac515ab6e8ebdf7]
module.rds.aws_security_group.mysql_to_private: Refreshing state... [id=sg-0200472868087adb3]
module.vpc.aws_route.public: Refreshing state... [id=r-rtb-0833e5cbb3feed7c41080289494]
module.rds.aws_security_group.ec2_private_nat_to_global: Refreshing state... [id=sg-0d5ed516513b6a83c]
module.vpc.aws_route_table_association.privates[0]: Refreshing state... [id=rtbassoc-0840d58339cd83f90]
module.vpc.aws_route_table_association.privates[1]: Refreshing state... [id=rtbassoc-0a74d87da37cd4c32]
module.vpc.aws_route_table_association.privates[2]: Refreshing state... [id=rtbassoc-0c7b9baba708642b6]
module.vpc.aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-05e859eb1301e09d1]
module.vpc.aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0dfdb12fab7d4006a]
module.vpc.aws_route_table_association.public[2]: Refreshing state... [id=rtbassoc-0f51279304586a58e]
module.rds.aws_security_group_rule.out_all: Refreshing state... [id=sgrule-3986439656]
module.rds.aws_security_group_rule.in_icmp: Refreshing state... [id=sgrule-4046640019]
module.rds.aws_db_subnet_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.rds.aws_security_group_rule.in_ssh: Refreshing state... [id=sgrule-1848129182]
module.ecr-app.aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-0aada49a067e44d0b]
module.rds.aws_vpc_endpoint.rds: Refreshing state... [id=vpce-08152a4039ea057bd]
module.ecr-app.aws_vpc_endpoint.ssm: Refreshing state... [id=vpce-0685661311e6eb46b]
module.ecr-app.aws_vpc_endpoint.ecr_dkr: Refreshing state... [id=vpce-060745b09df69e96a]
module.ecr-app.aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-0aa2aa645cd78c54a]
module.alb.aws_lb.this: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:loadbalancer/app/line-bot-sample2/2d23d36ec59ecb9b]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[2]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea2941716146]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[0]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea3530383921]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[1]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea46037175]
module.rds.aws_security_group_rule.mysql: Refreshing state... [id=sgrule-581596504]
module.rds.aws_rds_cluster.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.alb.aws_lb_listener.https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261]
module.route53.aws_route53_record.main: Refreshing state... [id=Z04052072YGY8CIREK2A2_line-bot-sample2.moikilo00.net_A]
module.alb.aws_lb_listener.http_to_https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/cb9619fbb54169cb]
module.alb.aws_lb_listener_rule.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener-rule/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261/d135b6a132b7b048]
module.rds.aws_rds_cluster_instance.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_task_definition.main: Refreshing state... [id=line-bot-sample2-task-definition]
module.ecs.aws_ecs_service.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]
module.ecs.aws_ecs_task_definition.main: Destroying... [id=line-bot-sample2-task-definition]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Creating...
module.ecs.aws_ecs_task_definition.main: Destruction complete after 1s
module.ecs.aws_ecs_task_definition.main: Creating...
module.ecs.aws_ecs_task_definition.main: Creation complete after 1s [id=line-bot-sample2-task-definition]
module.ecs.aws_ecs_service.main: Modifying... [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]
module.ecs.aws_ecs_service.main: Modifications complete after 2s [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [10s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [20s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [30s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [40s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [50s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [1m0s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [1m10s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [1m20s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [1m30s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [1m40s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [1m50s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [2m0s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Still creating... [2m10s elapsed]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Creation complete after 2m14s [id=vpce-0d26e22adef0a927d]

Apply complete! Resources: 2 added, 1 changed, 1 destroyed.

@github-actions
Copy link

github-actions bot commented May 8, 2021

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan
module.ecs.aws_cloudwatch_log_group.line-bot-sample2: Refreshing state... [id=/aws/ecs/line-bot-sample2]
module.route53.aws_acm_certificate.main: Refreshing state... [id=arn:aws:acm:ap-northeast-1:554506578892:certificate/06e7b54e-fc23-4c2b-8939-aabde5bbb683]
module.vpc.aws_vpc.main: Refreshing state... [id=vpc-0b9c9dcab97f3491c]
module.ecs.aws_ecs_cluster.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:cluster/line-bot-sample2]
module.rds.aws_rds_cluster_parameter_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecr-app.aws_ecr_repository.main: Refreshing state... [id=line-bot-sample2-app]
module.rds.aws_ssm_parameter.database_password_secret: Refreshing state... [id=MYSQL_PASSWORD]
module.rds.aws_key_pair.mmm2: Refreshing state... [id=mmm2]
module.ecs.aws_iam_role.ecs_task_execution_role: Refreshing state... [id=EcsTaskRole-line-bot-sample2]
module.ecs.aws_iam_role_policy.cloudwatch_logs: Refreshing state... [id=EcsTaskRole-line-bot-sample2:cloudwatch_logs]
module.ecs.aws_iam_role_policy_attachment.ecs_task_execution_role_policy_for_ecr: Refreshing state... [id=EcsTaskRole-line-bot-sample2-20210429021106029600000001]
module.route53.aws_route53_record.validations["line-bot-sample2.moikilo00.net"]: Refreshing state... [id=Z04052072YGY8CIREK2A2__9423f2f8b78ae3bdeb3548f1bea69efa.line-bot-sample2.moikilo00.net._CNAME]
module.route53.aws_acm_certificate_validation.main: Refreshing state... [id=2021-04-27 09:08:01 +0000 UTC]
module.rds.aws_iam_role_policy.mysql_db_password_policy_secretsmanager: Refreshing state... [id=EcsTaskRole-line-bot-sample2:password-policy-mysql_db_password_policy_secretsmanager]
module.vpc.aws_subnet.privates[2]: Refreshing state... [id=subnet-02c271aaae088ea4b]
module.vpc.aws_route_table.public: Refreshing state... [id=rtb-0833e5cbb3feed7c4]
module.rds.aws_security_group.this: Refreshing state... [id=sg-08ac515ab6e8ebdf7]
module.vpc.aws_subnet.privates[0]: Refreshing state... [id=subnet-0d00944d99dfe3fb9]
module.alb.aws_lb_target_group.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:targetgroup/line-bot-sample2-target-group/85c2e8b8911549f7]
module.alb.aws_security_group.alb: Refreshing state... [id=sg-0829c8222f3c2e3f0]
module.ecs.aws_security_group.ecs: Refreshing state... [id=sg-071dd337cfbbbb50d]
module.vpc.aws_subnet.privates[1]: Refreshing state... [id=subnet-071a11b51c485b0b1]
module.ecr-app.aws_security_group.vpc_endpoint: Refreshing state... [id=sg-096192166d6f9cd8b]
module.rds.aws_security_group.vpc_endpoint_rds: Refreshing state... [id=sg-0ce678efdd64b44e5]
module.rds.aws_security_group.mysql_to_private: Refreshing state... [id=sg-0200472868087adb3]
module.rds.aws_security_group.example: Refreshing state... [id=sg-06bdc7be2c94a7cf0]
module.rds.aws_security_group.ec2_private: Refreshing state... [id=sg-086f3ab5fea1aa2b9]
module.rds.aws_security_group.ec2_private_nat_to_global: Refreshing state... [id=sg-0d5ed516513b6a83c]
module.vpc.aws_subnet.publics[0]: Refreshing state... [id=subnet-0bb63a2f82ac5687b]
module.ecr-app.aws_vpc_endpoint.s3: Refreshing state... [id=vpce-05f06bcd8be5135ea]
module.rds.aws_security_group.ec2_public_bastian: Refreshing state... [id=sg-0ca95d51ffe6d8894]
module.vpc.aws_subnet.publics[1]: Refreshing state... [id=subnet-0a3c585bbf6bba58b]
module.vpc.aws_subnet.publics[2]: Refreshing state... [id=subnet-03c288199d18a8e45]
module.vpc.aws_internet_gateway.main: Refreshing state... [id=igw-0db9d7fef1d452a9f]
module.vpc.aws_route_table.privates[0]: Refreshing state... [id=rtb-0b7249501f7f39f80]
module.vpc.aws_route_table.privates[1]: Refreshing state... [id=rtb-0a31ed301afa10c9e]
module.vpc.aws_route_table.privates[2]: Refreshing state... [id=rtb-0f70a7f400318b4fa]
module.rds.aws_security_group_rule.mysql: Refreshing state... [id=sgrule-581596504]
module.rds.aws_security_group_rule.in_icmp: Refreshing state... [id=sgrule-4046640019]
module.rds.aws_security_group_rule.out_all: Refreshing state... [id=sgrule-3986439656]
module.rds.aws_security_group_rule.in_ssh: Refreshing state... [id=sgrule-1848129182]
module.ecr-app.aws_vpc_endpoint.cloudwatch_logs: Refreshing state... [id=vpce-0d26e22adef0a927d]
module.ecr-app.aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-0aa2aa645cd78c54a]
module.ecr-app.aws_vpc_endpoint.ssm: Refreshing state... [id=vpce-0685661311e6eb46b]
module.ecr-app.aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-0aada49a067e44d0b]
module.ecr-app.aws_vpc_endpoint.ecr_dkr: Refreshing state... [id=vpce-060745b09df69e96a]
module.vpc.aws_route_table_association.public[2]: Refreshing state... [id=rtbassoc-0f51279304586a58e]
module.vpc.aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-05e859eb1301e09d1]
module.vpc.aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0dfdb12fab7d4006a]
module.rds.aws_db_subnet_group.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.rds.aws_vpc_endpoint.rds: Refreshing state... [id=vpce-08152a4039ea057bd]
module.vpc.aws_route.public: Refreshing state... [id=r-rtb-0833e5cbb3feed7c41080289494]
module.alb.aws_lb.this: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:loadbalancer/app/line-bot-sample2/2d23d36ec59ecb9b]
module.vpc.aws_route_table_association.privates[2]: Refreshing state... [id=rtbassoc-0c7b9baba708642b6]
module.vpc.aws_route_table_association.privates[0]: Refreshing state... [id=rtbassoc-0840d58339cd83f90]
module.vpc.aws_route_table_association.privates[1]: Refreshing state... [id=rtbassoc-0a74d87da37cd4c32]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[0]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea3530383921]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[2]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea2941716146]
module.ecr-app.aws_vpc_endpoint_route_table_association.private_s3[1]: Refreshing state... [id=a-vpce-05f06bcd8be5135ea46037175]
module.rds.aws_rds_cluster.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.alb.aws_lb_listener.https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261]
module.alb.aws_lb_listener.http_to_https: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener/app/line-bot-sample2/2d23d36ec59ecb9b/cb9619fbb54169cb]
module.route53.aws_route53_record.main: Refreshing state... [id=Z04052072YGY8CIREK2A2_line-bot-sample2.moikilo00.net_A]
module.alb.aws_lb_listener_rule.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-1:554506578892:listener-rule/app/line-bot-sample2/2d23d36ec59ecb9b/f629bb67277bf261/d135b6a132b7b048]
module.rds.aws_rds_cluster_instance.this: Refreshing state... [id=linebot-sample2-rds-mysql]
module.ecs.aws_ecs_task_definition.main: Refreshing state... [id=line-bot-sample2-task-definition]
module.ecs.aws_ecs_service.main: Refreshing state... [id=arn:aws:ecs:ap-northeast-1:554506578892:service/line-bot-sample2/line-bot-sample2]

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and the remote system(s). As a result, there are no actions to
take.

Pusher: @lazmond3, Action: pull_request

@lazmond3 lazmond3 merged commit 1700ad1 into master May 8, 2021
@lazmond3 lazmond3 deleted the feature/58-terraform-add-cloudwatch-vpc-endpoint-2-log branch May 8, 2021 14:16
@lazmond3 lazmond3 restored the feature/58-terraform-add-cloudwatch-vpc-endpoint-2-log branch May 8, 2021 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant