Skip to content

Latest commit

 

History

History
123 lines (95 loc) · 2.08 KB

aws_datasync_location_s3.md

File metadata and controls

123 lines (95 loc) · 2.08 KB

aws_datasync_location_s3

back

Index

Terraform

terraform {
  required_providers {
    aws = ">= 3.35.0"
  }
}

top

Example Usage

module "aws_datasync_location_s3" {
  source = "./modules/aws/r/aws_datasync_location_s3"

  # s3_bucket_arn - (required) is a type of string
  s3_bucket_arn = null
  # subdirectory - (required) is a type of string
  subdirectory = null
  # tags - (optional) is a type of map of string
  tags = {}

  s3_config = [{
    bucket_access_role_arn = null
  }]
}

top

Variables

variable "s3_bucket_arn" {
  description = "(required)"
  type        = string
}

variable "subdirectory" {
  description = "(required)"
  type        = string
}

variable "tags" {
  description = "(optional)"
  type        = map(string)
  default     = null
}

variable "s3_config" {
  description = "nested block: NestingList, min items: 1, max items: 1"
  type = set(object(
    {
      bucket_access_role_arn = string
    }
  ))
}

top

Resource

resource "aws_datasync_location_s3" "this" {
  # s3_bucket_arn - (required) is a type of string
  s3_bucket_arn = var.s3_bucket_arn
  # subdirectory - (required) is a type of string
  subdirectory = var.subdirectory
  # tags - (optional) is a type of map of string
  tags = var.tags

  dynamic "s3_config" {
    for_each = var.s3_config
    content {
      # bucket_access_role_arn - (required) is a type of string
      bucket_access_role_arn = s3_config.value["bucket_access_role_arn"]
    }
  }

}

top

Outputs

output "arn" {
  description = "returns a string"
  value       = aws_datasync_location_s3.this.arn
}

output "id" {
  description = "returns a string"
  value       = aws_datasync_location_s3.this.id
}

output "uri" {
  description = "returns a string"
  value       = aws_datasync_location_s3.this.uri
}

output "this" {
  value = aws_datasync_location_s3.this
}

top