Skip to content

Commit

Permalink
Merge pull request hashicorp#1316 from wellsiau-aws/d-awscc_oam_sink
Browse files Browse the repository at this point in the history
doc: awscc_oam_sink
  • Loading branch information
marcosentino authored Nov 22, 2023
2 parents 5fcc346 + 128a552 commit c3ed317
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 2 deletions.
70 changes: 68 additions & 2 deletions docs/resources/oam_sink.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_oam_sink Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +9,74 @@ description: |-

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

```terraform
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

```terraform
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 generated by tfplugindocs -->
## Schema
Expand All @@ -35,4 +101,4 @@ Import is supported using the following syntax:

```shell
$ terraform import awscc_oam_sink.example <resource ID>
```
```
27 changes: 27 additions & 0 deletions examples/resources/awscc_oam_sink/oam_sink_accounts.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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"
]
}
}
}]
})
}
26 changes: 26 additions & 0 deletions examples/resources/awscc_oam_sink/oam_sink_org.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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"
]
}
}
}]
})
}
35 changes: 35 additions & 0 deletions templates/resources/oam_sink.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## Example Usage

### All Accounts Organization

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

{{ tffile (printf "examples/resources/%s/oam_sink_org.tf" .Name)}}

### Individual Account

Sample sink that permits a link to an individual account

{{ tffile (printf "examples/resources/%s/oam_sink_accounts.tf" .Name)}}

{{ .SchemaMarkdown | trimspace }}
{{- if .HasImport }}

## Import

Import is supported using the following syntax:

{{ codefile "shell" .ImportFile }}

{{- end }}

0 comments on commit c3ed317

Please sign in to comment.