Resource: aws_ssm_resource_data_sync

Provides a SSM resource data sync.

Example Usage

resource "aws_s3_bucket" "hoge" {
  bucket = "tf-test-bucket-1234"
}

data "aws_iam_policy_document" "hoge" {
  statement {
    sid    = "SSMBucketPermissionsCheck"
    effect = "Allow"

    principals {
      type        = "Service"
      identifiers = ["ssm.amazonaws.com"]
    }

    actions   = ["s3:GetBucketAcl"]
    resources = ["arn:aws:s3:::tf-test-bucket-1234"]
  }

  statement {
    sid    = "SSMBucketDelivery"
    effect = "Allow"

    principals {
      type        = "Service"
      identifiers = ["ssm.amazonaws.com"]
    }

    actions   = ["s3:PutObject"]
    resources = ["arn:aws:s3:::tf-test-bucket-1234/*"]

    condition {
      test     = "StringEquals"
      variable = "s3:x-amz-acl"
      values   = ["bucket-owner-full-control"]
    }
  }
}

resource "aws_s3_bucket_policy" "hoge" {
  bucket = aws_s3_bucket.hoge.id
  policy = data.aws_iam_policy_document.hoge.json
}

resource "aws_ssm_resource_data_sync" "foo" {
  name = "foo"

  s3_destination {
    bucket_name = aws_s3_bucket.hoge.bucket
    region      = aws_s3_bucket.hoge.region
  }
}

Argument Reference

This resource supports the following arguments:

s3_destination

s3_destination supports the following:

Attribute Reference

This resource exports no additional attributes.

Import

In Terraform v1.5.0 and later, use an import block to import SSM resource data sync using the name. For example:

import {
  to = aws_ssm_resource_data_sync.example
  id = "example-name"
}

Using terraform import, import SSM resource data sync using the name. For example:

% terraform import aws_ssm_resource_data_sync.example example-name