Skip to content

Commit

Permalink
Merge pull request #2146 from wellsiau-aws/doc-auto-2
Browse files Browse the repository at this point in the history
docs: wave 2 - auto-generated by bedrock
  • Loading branch information
ewbankkit authored Jan 9, 2025
2 parents 65dac62 + 98b5a03 commit 780e1a4
Show file tree
Hide file tree
Showing 669 changed files with 32,237 additions and 337 deletions.
25 changes: 24 additions & 1 deletion docs/resources/cloudfront_origin_access_control.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_cloudfront_origin_access_control Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -14,7 +14,30 @@ Creates a new origin access control in CloudFront. After you create an origin ac
This makes it possible to block public access to the origin, allowing viewers (users) to access the origin's content only through CloudFront.
For more information about using a CloudFront origin access control, see [Restricting access to an origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-origin.html) in the *Amazon CloudFront Developer Guide*.

## Example Usage

### CloudFront Origin Access Control for S3

Creates a CloudFront Origin Access Control (OAC) configuration that enables secure access to S3 bucket origins using sigv4 signing protocol with always-on signing behavior.

~> This example is generated by LLM using Amazon Bedrock and validated using terraform validate, apply and destroy. While we strive for accuracy and quality, please note that the information provided may not be entirely error-free or up-to-date. We recommend independently verifying the content.

```terraform
# Data sources to get AWS account ID and region
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
# CloudFront Origin Access Control
resource "awscc_cloudfront_origin_access_control" "example" {
origin_access_control_config = {
name = "example-oac"
description = "Example Origin Access Control for S3"
origin_access_control_origin_type = "s3"
signing_behavior = "always"
signing_protocol = "sigv4"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
72 changes: 70 additions & 2 deletions docs/resources/codestarnotifications_notification_rule.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_codestarnotifications_notification_rule Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +10,75 @@ description: |-

Resource Type definition for AWS::CodeStarNotifications::NotificationRule


## Example Usage

### CodeStar Notification Rule for CodeCommit Events

Creates a CodeStar notification rule that monitors CodeCommit repository events (comments, pull request creation and merges) and publishes notifications to an SNS topic.

~> This example is generated by LLM using Amazon Bedrock and validated using terraform validate, apply and destroy. While we strive for accuracy and quality, please note that the information provided may not be entirely error-free or up-to-date. We recommend independently verifying the content.

```terraform
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
# Create an SNS topic for notifications
resource "awscc_sns_topic" "notifications" {
topic_name = "codestar-notifications"
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
# Create SNS topic policy
data "aws_iam_policy_document" "notification_policy" {
statement {
effect = "Allow"
principals {
type = "Service"
identifiers = ["codestar-notifications.amazonaws.com"]
}
actions = [
"SNS:Publish"
]
resources = [awscc_sns_topic.notifications.topic_arn]
}
}
resource "aws_sns_topic_policy" "default" {
arn = awscc_sns_topic.notifications.topic_arn
policy = data.aws_iam_policy_document.notification_policy.json
}
# Create CodeStar Notification Rule
resource "awscc_codestarnotifications_notification_rule" "example" {
name = "example-notification-rule"
detail_type = "BASIC"
resource = "arn:aws:codecommit:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:MyDemoRepo"
event_type_ids = [
"codecommit-repository-comments-on-commits",
"codecommit-repository-pull-request-created",
"codecommit-repository-pull-request-merged"
]
targets = [
{
target_type = "SNS"
target_address = awscc_sns_topic.notifications.topic_arn
}
]
tags = [{
key = "Modified By"
value = "AWSCC"
}]
status = "ENABLED"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
116 changes: 114 additions & 2 deletions docs/resources/cognito_log_delivery_configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_cognito_log_delivery_configuration Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +10,119 @@ description: |-

Resource Type definition for AWS::Cognito::LogDeliveryConfiguration


## Example Usage

### Configure Cognito User Pool Logging

Creates a Cognito User Pool log delivery configuration that enables INFO level user authentication events to be sent to CloudWatch Logs, including necessary IAM roles and permissions setup.

~> This example is generated by LLM using Amazon Bedrock and validated using terraform validate, apply and destroy. While we strive for accuracy and quality, please note that the information provided may not be entirely error-free or up-to-date. We recommend independently verifying the content.

```terraform
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}
# Create a Cognito User Pool (using AWS provider as AWSCC version not available)
resource "aws_cognito_user_pool" "example" {
name = "example-user-pool"
# Note: The Cognito User Pool must be in ENHANCED tier for log delivery to work
user_pool_add_ons {
advanced_security_mode = "OFF"
}
password_policy {
minimum_length = 8
require_lowercase = true
require_numbers = true
require_symbols = true
require_uppercase = true
}
schema {
attribute_data_type = "String"
developer_only_attribute = false
mutable = true
name = "email"
required = true
string_attribute_constraints {
max_length = "2048"
min_length = "0"
}
}
admin_create_user_config {
allow_admin_create_user_only = false
}
tags = {
"Modified By" = "AWSCC"
}
}
# Create CloudWatch Log Group using AWSCC provider
resource "awscc_logs_log_group" "example" {
log_group_name = "/aws/cognito/example-logs"
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
# IAM role for CloudWatch Logs using AWSCC provider
resource "awscc_iam_role" "cognito_cloudwatch" {
role_name = "cognito-cloudwatch-role"
assume_role_policy_document = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
Service = "cognito-idp.amazonaws.com"
}
}
]
})
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
# CloudWatch Logs policy using AWSCC provider
resource "awscc_iam_role_policy" "cognito_cloudwatch" {
policy_name = "cognito-cloudwatch-policy"
role_name = awscc_iam_role.cognito_cloudwatch.role_name
policy_document = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"logs:CreateLogStream",
"logs:PutLogEvents"
]
Resource = awscc_logs_log_group.example.arn
}
]
})
}
# Log Delivery Configuration
resource "awscc_cognito_log_delivery_configuration" "example" {
user_pool_id = aws_cognito_user_pool.example.id
log_configurations = [
{
cloudwatch_logs_configuration = {
log_group_arn = awscc_logs_log_group.example.arn
}
event_source = "userAuthEvents"
log_level = "INFO"
}
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
67 changes: 66 additions & 1 deletion docs/resources/cognito_user_pool_user_to_group_attachment.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_cognito_user_pool_user_to_group_attachment Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +10,72 @@ description: |-

Resource Type definition for AWS::Cognito::UserPoolUserToGroupAttachment

## Example Usage

### Cognito User Group Membership

To add a Cognito user to a user pool group, configure the user pool group attachment with the user pool ID, group name, and username of the target user.

~> This example is generated by LLM using Amazon Bedrock and validated using terraform validate, apply and destroy. While we strive for accuracy and quality, please note that the information provided may not be entirely error-free or up-to-date. We recommend independently verifying the content.

```terraform
# Create a Cognito User Pool
resource "aws_cognito_user_pool" "example" {
name = "example-user-pool"
auto_verified_attributes = ["email"]
username_attributes = ["email"]
password_policy {
minimum_length = 8
require_lowercase = true
require_numbers = true
require_symbols = true
require_uppercase = true
}
schema {
attribute_data_type = "String"
mutable = true
name = "email"
required = true
string_attribute_constraints {
max_length = "2048"
min_length = "0"
}
}
tags = {
"Modified By" = "AWSCC"
}
}
# Create a Cognito User Pool Group
resource "aws_cognito_user_group" "example" {
name = "example-group"
user_pool_id = aws_cognito_user_pool.example.id
description = "Example user pool group"
}
# Create a Cognito User
resource "aws_cognito_user" "example" {
user_pool_id = aws_cognito_user_pool.example.id
username = "[email protected]"
attributes = {
email = "[email protected]"
email_verified = "true"
}
}
# Attach the user to the group
resource "awscc_cognito_user_pool_user_to_group_attachment" "example" {
group_name = aws_cognito_user_group.example.name
user_pool_id = aws_cognito_user_pool.example.id
username = aws_cognito_user.example.username
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
Loading

0 comments on commit 780e1a4

Please sign in to comment.