Giter Club home page Giter Club logo

Comments (3)

wellsiau-aws avatar wellsiau-aws commented on June 28, 2024 1

I was able to replicate the behavior on resource awscc_ecs_task_definition.

It seemed that these attributes that forces replacement are declared in the Terraform state file as null. On contrary, CCAPI GetResource is returning an empty value or empty list.

I suspect this is related to #1139

from terraform-provider-awscc.

lemiliomoreno avatar lemiliomoreno commented on June 28, 2024

I also tried to set up the default values stored in the state file but still forces replacement

resource "awscc_ecs_task_definition" "db_task_definition" {
  container_definitions = [
    {
      name  = "${var.environment}-${var.application}-db"
      image = "postgres:15"
      port_mappings = [{
        name           = "${var.environment}-${var.application}-db-port"
        container_port = 5432
        protocol       = "tcp"
      }]

      log_configuration = {
        log_driver = "awslogs"
        options = {
          awslogs-group         = "${var.environment}-${var.application}-db-log-group"
          awslogs-region        = "${var.aws_region}"
          awslogs-stream-prefix = "ecs"
        }
      }

      environment = [
        {
          name  = "POSTGRES_DB"
          value = "${data.aws_ssm_parameter.db_name.value}"
        },
        {
          name  = "POSTGRES_PASSWORD"
          value = "${data.aws_ssm_parameter.db_password.value}"
        },
        {
          name  = "POSTGRES_USER"
          value = "${data.aws_ssm_parameter.db_username.value}"
        },
      ]

      mount_points = [
        {
          source_volume  = "${var.environment}-${var.application}-db-volume",
          container_path = "/var/lib/postgresql",
          read_only      = false
        }
      ]
    }
  ]

  cpu = 256

  ephemeral_storage = {
    size_in_gi_b = 30
  }

  execution_role_arn     = aws_iam_role.db_execution_role.arn
  family                 = "${var.environment}-${var.application}-db-task-definition"
  inference_accelerators = null
  ipc_mode               = null
  memory                 = 512
  network_mode           = "awsvpc"
  pid_mode               = null
  placement_constraints  = null
  proxy_configuration    = null

  requires_compatibilities = [
    "FARGATE",
  ]

  runtime_platform = {
    cpu_architecture        = "X86_64"
    operating_system_family = "LINUX"
  }

  tags          = null
  task_role_arn = aws_iam_role.db_task_role.arn

  volumes = [
    {
      configured_at_launch        = true
      docker_volume_configuration = null
      efs_volume_configuration    = null
      host                        = null
      name                        = "${var.environment}-${var.application}-db-volume"
    }
  ]
}

from terraform-provider-awscc.

wellsiau-aws avatar wellsiau-aws commented on June 28, 2024

Problem with resource awscc_ecs_service also seemed to stem from the same behavior as described in #1139

from terraform-provider-awscc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.