jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
122 stars 51 forks source link

AWS - Does Terraform Init Task Support DynamoDB Backend for Locking with S3 State Files? #429

Open brandtaderrick opened 2 months ago

brandtaderrick commented 2 months ago

If you want to use DynamoDB in collaboration with S3 to handle locking and state checksum management, can you do that with the TerraformCLI@0 init task? I searched around the repo, but I didn't have any luck figuring out whether this would be supported with something like "dynamo_db_table: states.locks."


  displayName: 'terraform init'
  inputs:
    command: init
    workingDirectory: $(my_terraform_templates_dir)
    # set to `aws` to use aws backend
    backendType: aws
    # service connection name, required if backendType = aws
    backendServiceAws: env_test_aws
    # s3 bucket's region, optional if provided elsewhere (i.e. inside terraform template or command options)
    backendAwsRegion: us-east-1
    # s3 bucket name, optional if provided elsewhere (i.e. inside terraform template or command options)
    backendAwsBucket: s3-trfrm-dev-eus-czp
    # s3 path to state file, optional if provided elsewhere (i.e. inside terraform template or command options)
    backendAwsKey: 'my-env-infrax/dev-infrax'```
jason-johnson commented 1 month ago

@piizei do you have any insights here?