Skip to content

Commit

Permalink
Update the TF example files from turbot_smart_folder to turbot_policy…
Browse files Browse the repository at this point in the history
…_pack
  • Loading branch information
rajlearner17 committed Jul 18, 2024
1 parent a9431c1 commit 54a8c9c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
26 changes: 13 additions & 13 deletions docs/7-minute-labs/terraform/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ touch demo.tf
previous step.

```hcl
resource "turbot_smart_folder" "encryption" {
resource "turbot_policy_pack" "encryption" {
title = "Encryption @ ACME"
description = "Enforce encryption on a range of resource types per ACME policies."
parent = "tmod:@turbot/turbot#/"
Expand Down Expand Up @@ -121,8 +121,8 @@ Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

# turbot_smart_folder.encryption will be created
+ resource "turbot_smart_folder" "encryption" {
# turbot_policy_pack.encryption will be created
+ resource "turbot_policy_pack" "encryption" {
+ description = "Enforce encryption on a range of resource types per ACME policies."
+ id = (known after apply)
+ parent = "tmod:@turbot/turbot#/"
Expand Down Expand Up @@ -158,8 +158,8 @@ Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

# turbot_smart_folder.encryption will be created
+ resource "turbot_smart_folder" "encryption" {
# turbot_policy_pack.encryption will be created
+ resource "turbot_policy_pack" "encryption" {
+ description = "Enforce encryption on a range of resource types per ACME policies."
+ id = (known after apply)
+ parent = "tmod:@turbot/turbot#/"
Expand All @@ -175,8 +175,8 @@ Do you want to perform these actions?

Enter a value: yes

turbot_smart_folder.encryption: Creating...
turbot_smart_folder.encryption: Creation complete after 1s [id=178050816325133]
turbot_policy_pack.encryption: Creating...
turbot_policy_pack.encryption: Creation complete after 1s [id=178050816325133]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
```
Expand All @@ -194,21 +194,21 @@ Now that you have created a Policy Pack, you will add Policy Settings to it.
`Encryption @ ACME` Policy Pack:
```hcl
resource "turbot_smart_folder" "encryption" {
resource "turbot_policy_pack" "encryption" {
title = "Encryption @ ACME"
description = "Enforce encryption on a range of resource types per ACME policies."
parent = "tmod:@turbot/turbot#/"
}

// highlight-start
resource "turbot_policy_setting" "s3_encryption_at_rest" {
resource = turbot_smart_folder.encryption.id
resource = turbot_policy_pack.encryption.id
type = "tmod:@turbot/aws-s3#/policy/types/bucketEncryptionAtRest"
value = "Check: AWS SSE"
}

resource "turbot_policy_setting" "s3_encryption_in_transit" {
resource = turbot_smart_folder.encryption.id
resource = turbot_policy_pack.encryption.id
type = "tmod:@turbot/aws-s3#/policy/types/encryptionInTransit"
value = "Check: Enabled"
}
Expand Down Expand Up @@ -242,20 +242,20 @@ enforce SSL.
`Encryption at Rest` policy from `Check: Enabled` to `Enforce: Enabled`.
```hcl
resource "turbot_smart_folder" "encryption" {
resource "turbot_policy_pack" "encryption" {
title = "Encryption @ ACME"
description = "Enforce encryption on a range of resource types per ACME policies."
parent = "tmod:@turbot/turbot#/"
}

resource "turbot_policy_setting" "s3_encryption_at_rest" {
resource = turbot_smart_folder.encryption.id
resource = turbot_policy_pack.encryption.id
type = "tmod:@turbot/aws-s3#/policy/types/bucketEncryptionAtRest"
value = "Check: AWS SSE"
}

resource "turbot_policy_setting" "s3_encryption_in_transit" {
resource = turbot_smart_folder.encryption.id
resource = turbot_policy_pack.encryption.id
type = "tmod:@turbot/aws-s3#/policy/types/encryptionInTransit"
// highlight-start
value = "Enforce: Enabled"
Expand Down
6 changes: 3 additions & 3 deletions docs/concepts/guardrails/tagging/tagging-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,19 @@ resource "turbot_file" "tag_rules" {
The example creates a Policy Pack, sets the `AWS > S3 > Bucket > Tags` guardrail to `Enforce: Set tags`, and creates our calculated policy that reads the rules from the Guardrails File specified in the previous section.

```hcl
resource "turbot_smart_folder" "tag_transform_example" {
resource "turbot_policy_pack" "tag_transform_example" {
parent = "tmod:@turbot/turbot#/"
title = "Tagging Transformation Example"
}
resource "turbot_policy_setting" "aws_s3_bucket_tags" {
resource = turbot_smart_folder.tag_transform_example.id
resource = turbot_policy_pack.tag_transform_example.id
type = "tmod:@turbot/aws-s3#/policy/types/bucketTags"
value = "Enforce: Set tags"
}
resource "turbot_policy_setting" "aws_s3_bucket_tags_template" {
resource = turbot_smart_folder.tag_transform_example.id
resource = turbot_policy_pack.tag_transform_example.id
type = "tmod:@turbot/aws-s3#/policy/types/bucketTagsTemplate"
template_input = <<-EOT
{
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/files/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ tags match:

```hcl
resource "turbot_policy_setting" "security_group_ingress_rules_approved_rules" {
resource = turbot_smart_folder.test_smart_folder.id
resource = turbot_policy_pack.test_smart_folder.id
type = "tmod:@turbot/aws-vpc-security#/policy/types/securityGroupIngressRulesApprovedRules"
template_input = <<QUERY
{
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/iam/administrators/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ By default, Guardrails API keys do not expire. Passwords for users in the Guardr
1. Terraform option: Use [policypacks_attachments](https://registry.terraform.io/providers/turbot/turbot/latest/docs/resources/smart_folder_attachment) to attach the policy pack to the required directories.
2. Manual Option: In the Turbot console, attach the policy pack to each required directories.
```terraform
resource "turbot_smart_folder" "breakglass_user_exceptions" {
resource "turbot_policy_pack" "breakglass_user_exceptions" {
parent = "tmod:@turbot/turbot#/"
title = "Breakglass User Exceptions"
description = "A set of policies to make sure that breakglass users stay viable. Directions: Attach this policy pack to each directory that holds breakglass users. "
}
resource "turbot_policy_setting" "turbot_iam_access_key_expiration" {
resource = turbot_smart_folder.breakglass_user_exceptions.id
resource = turbot_policy_pack.breakglass_user_exceptions.id
type = "tmod:@turbot/turbot-iam#/policy/types/accessKeyExpiration"
template_input = <<EOT
{
Expand All @@ -114,7 +114,7 @@ You must specify the regex for the breakglass users emails. This policy is a gua
EOT
}
resource "turbot_policy_setting" "turbot_iam_access_key_expiration_period" {
resource = turbot_smart_folder.breakglass_user_exceptions.id
resource = turbot_policy_pack.breakglass_user_exceptions.id
type = "tmod:@turbot/turbot-iam#/policy/types/accessKeyExpirationDays"
value = "90"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ so:
## Sets tagging policy for each resource type in the resource_tags map.
resource "turbot_policy_setting" "set_resource_tag_policies" {
for_each = var.resource_tags
resource = turbot_smart_folder.azure_tagging.id
resource = turbot_policy_pack.azure_tagging.id
type = var.policy_map[each.key]
value = each.value
}
Expand All @@ -276,7 +276,7 @@ code:
```hcl
resource "turbot_policy_setting" "default_tag_template" {
for_each = var.resource_tags
resource = turbot_smart_folder.azure_tagging.id
resource = turbot_policy_pack.azure_tagging.id
type = var.policy_map_template[each.key]
```

Expand Down Expand Up @@ -395,7 +395,7 @@ provider "turbot" {
}
# Create Policy Pack at the Turbot level
resource "turbot_smart_folder" "azure_tagging" {
resource "turbot_policy_pack" "azure_tagging" {
parent = "tmod:@turbot/turbot#/"
title = "SF - Azure Tagging Policies"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/managing-policies/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ important. Note the `EOT` encapsulating both the template and template_input!
```hcl
# AWS > S3 > Bucket > Versioning
resource "turbot_policy_setting" "s3_bucket_versioning" {
resource = turbot_smart_folder.baseline.id
resource = turbot_policy_pack.baseline.id
type = "tmod:@turbot/aws-s3#/policy/types/bucketVersioning"
template_input = <<EOT
{
Expand Down

0 comments on commit 54a8c9c

Please sign in to comment.