iwaseasahi / christchurches-map-infra

キリスト教会マップのインフラ管理
0 stars 0 forks source link

ElastiCache を Terraform で作成する #40

Closed iwaseasahi closed 3 years ago

iwaseasahi commented 3 years ago

背景

https://github.com/iwaseasahi/christchurches-map-infra/issues/38

上記 issue で削除しましたが、Terraform でいつでも作成できるようにします。

目的

ElastiCache を管理する

完成条件

ElastiCache を Terraform で作成すること

iwaseasahi commented 3 years ago
Terraform will perform the following actions:

  # aws_elasticache_replication_group.main will be created
  + resource "aws_elasticache_replication_group" "main" {
      + apply_immediately              = (known after apply)
      + arn                            = (known after apply)
      + at_rest_encryption_enabled     = false
      + auto_minor_version_upgrade     = true
      + automatic_failover_enabled     = true
      + cluster_enabled                = (known after apply)
      + configuration_endpoint_address = (known after apply)
      + engine                         = "redis"
      + engine_version                 = "6.x"
      + engine_version_actual          = (known after apply)
      + global_replication_group_id    = (known after apply)
      + id                             = (known after apply)
      + maintenance_window             = "mon:13:00-mon:14:00"
      + member_clusters                = (known after apply)
      + multi_az_enabled               = false
      + node_type                      = "cache.t2.micro"
      + number_cache_clusters          = (known after apply)
      + parameter_group_name           = "default.redis6.x"
      + port                           = 6379
      + primary_endpoint_address       = (known after apply)
      + reader_endpoint_address        = (known after apply)
      + replication_group_description  = "Amazon ElastiCache Redis for christchurches-map-ecs"
      + replication_group_id           = "christchurches-map-ecs-redis"
      + security_group_ids             = [
          + "sg-031ed8836c6d18abb",
        ]
      + security_group_names           = (known after apply)
      + snapshot_retention_limit       = 1
      + snapshot_window                = "19:00-20:00"
      + subnet_group_name              = "christchurches-map-ecs-subnet-group"
      + tags_all                       = (known after apply)
      + transit_encryption_enabled     = false

      + cluster_mode {
          + num_node_groups         = 1
          + replicas_per_node_group = 2
        }
    }
iwaseasahi commented 3 years ago

削除前

    {
      "mode": "managed",
      "type": "aws_elasticache_replication_group",
      "name": "main",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 1,
          "attributes": {
            "apply_immediately": null,
            "arn": "arn:aws:elasticache:ap-northeast-1:xxxx:replicationgroup:christchurches-map-ecs-redis",
            "at_rest_encryption_enabled": false,
            "auth_token": "",
            "auto_minor_version_upgrade": true,
            "automatic_failover_enabled": true,
            "availability_zones": null,
            "cluster_enabled": false,
            "cluster_mode": [
              {
                "num_node_groups": 1,
                "replicas_per_node_group": 2
              }
            ],
            "configuration_endpoint_address": null,
            "engine": "redis",
            "engine_version": "6.x",
            "engine_version_actual": "6.0.5",
            "final_snapshot_identifier": null,
            "global_replication_group_id": null,
            "id": "christchurches-map-ecs-redis",
            "kms_key_id": "",
            "maintenance_window": "mon:13:00-mon:14:00",
            "member_clusters": [
              "christchurches-map-ecs-redis-001",
              "christchurches-map-ecs-redis-002",
              "christchurches-map-ecs-redis-003"
            ],
            "multi_az_enabled": false,
            "node_type": "cache.t2.micro",
            "notification_topic_arn": null,
            "number_cache_clusters": 3,
            "parameter_group_name": "default.redis6.x",
            "port": 6379,
            "primary_endpoint_address": "christchurches-map-ecs-redis.nagz8k.ng.0001.apne1.cache.amazonaws.com",
            "reader_endpoint_address": "christchurches-map-ecs-redis-ro.nagz8k.ng.0001.apne1.cache.amazonaws.com",
            "replication_group_description": "Amazon ElastiCache Redis for christchurches-map-ecs",
            "replication_group_id": "christchurches-map-ecs-redis",
            "security_group_ids": [
              "sg-031ed8836c6d18abb"
            ],
            "security_group_names": [],
            "snapshot_arns": null,
            "snapshot_name": null,
            "snapshot_retention_limit": 1,
            "snapshot_window": "19:00-20:00",
            "subnet_group_name": "christchurches-map-ecs-subnet-group",
            "tags": {},
            "tags_all": {},
            "timeouts": {
              "create": null,
              "delete": null,
              "update": null
            },
            "transit_encryption_enabled": false
          },
          "sensitive_attributes": []
        }
      ]
    }
iwaseasahi commented 3 years ago

作成後

    {
      "mode": "managed",
      "type": "aws_elasticache_replication_group",
      "name": "main",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 1,
          "attributes": {
            "apply_immediately": null,
            "arn": "arn:aws:elasticache:ap-northeast-1:xxxx:replicationgroup:christchurches-map-ecs-redis",
            "at_rest_encryption_enabled": false,
            "auth_token": "",
            "auto_minor_version_upgrade": true,
            "automatic_failover_enabled": true,
            "availability_zones": null,
            "cluster_enabled": false,
            "cluster_mode": [
              {
                "num_node_groups": 1,
                "replicas_per_node_group": 2
              }
            ],
            "configuration_endpoint_address": null,
            "engine": "redis",
            "engine_version": "6.x",
            "engine_version_actual": "6.0.5",
            "final_snapshot_identifier": null,
            "global_replication_group_id": null,
            "id": "christchurches-map-ecs-redis",
            "kms_key_id": "",
            "maintenance_window": "mon:13:00-mon:14:00",
            "member_clusters": [
              "christchurches-map-ecs-redis-001",
              "christchurches-map-ecs-redis-002",
              "christchurches-map-ecs-redis-003"
            ],
            "multi_az_enabled": false,
            "node_type": "cache.t2.micro",
            "notification_topic_arn": null,
            "number_cache_clusters": 3,
            "parameter_group_name": "default.redis6.x",
            "port": 6379,
            "primary_endpoint_address": "christchurches-map-ecs-redis.nagz8k.ng.0001.apne1.cache.amazonaws.com",
            "reader_endpoint_address": "christchurches-map-ecs-redis-ro.nagz8k.ng.0001.apne1.cache.amazonaws.com",
            "replication_group_description": "Amazon ElastiCache Redis for christchurches-map-ecs",
            "replication_group_id": "christchurches-map-ecs-redis",
            "security_group_ids": [
              "sg-031ed8836c6d18abb"
            ],
            "security_group_names": [],
            "snapshot_arns": null,
            "snapshot_name": null,
            "snapshot_retention_limit": 1,
            "snapshot_window": "19:00-20:00",
            "subnet_group_name": "christchurches-map-ecs-subnet-group",
            "tags": null,
            "tags_all": {},
            "timeouts": null,
            "transit_encryption_enabled": false
          },
          "sensitive_attributes": []
        }
      ]
    },
iwaseasahi commented 3 years ago

削除前と作成後で同じ値でした。