awscc_oam_sink (Resource)

Resource Type definition for AWS::Oam::Sink

Example Usage

All Accounts Organization

Sample sink to connect that permits links to all accounts in an organization

data "aws_organizations_organization" "example" {}

resource "awscc_oam_sink" "example" {
  name = "SampleSink"

  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect    = "Allow"
      Principal = "*"
      Resource  = "*"
      Action    = ["oam:CreateLink", "oam:UpdateLink"]
      Condition = {
        StringEquals = {
          "aws:PrincipalOrgID" = data.aws_organizations_organization.example.id
        }
        "ForAllValues:StringEquals" = {
          "oam:ResourceTypes" = [
            "AWS::CloudWatch::Metric",
            "AWS::Logs::LogGroup"
          ]
        }
      }
    }]
  })
}

Individual Account

Sample sink that permits a link to an individual account

resource "awscc_oam_sink" "example" {
  name = "SampleSink"

  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect   = "Allow"
      Resource = "*"
      Action = [
        "oam:CreateLink",
        "oam:UpdateLink"
      ]
      Principal = {
        AWS = ["1111111111111"]
      }
      Condition = {
        "ForAllValues:StringEquals" : {
          "oam:ResourceTypes" : [
            "AWS::CloudWatch::Metric",
            "AWS::Logs::LogGroup",
            "AWS::XRay::Trace"
          ]
        }
      }
    }]
  })
}

Schema

Required

Optional

Read-Only

Import

Import is supported using the following syntax:

$ terraform import awscc_oam_sink.example <resource ID>