Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place security policy under folder for easier cleanup #10027

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Place security policy under folder for easier cleanup (#5174)
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Sep 8, 2021
commit c6e90ec7fdd74eee3cab1de18fedae0be75a95ee
3 changes: 3 additions & 0 deletions .changelog/5174.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ To get more information about OrganizationSecurityPolicy, see:
```hcl
resource "google_compute_organization_security_policy" "policy" {
provider = google-beta

display_name = "tf-test%{random_suffix}"
parent = "organizations/123456789"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,20 @@ To get more information about OrganizationSecurityPolicyAssociation, see:


```hcl
resource "google_folder" "security_policy_target" {
provider = google-beta
display_name = "tf-test-secpol-%{random_suffix}"
parent = "organizations/123456789"
}

resource "google_compute_organization_security_policy" "policy" {
provider = google-beta

display_name = "tf-test%{random_suffix}"
parent = "organizations/123456789"
parent = google_folder.security_policy_target.name
}

resource "google_compute_organization_security_policy_rule" "policy" {
provider = google-beta

policy_id = google_compute_organization_security_policy.policy.id
action = "allow"

Expand All @@ -69,7 +73,6 @@ resource "google_compute_organization_security_policy_rule" "policy" {

resource "google_compute_organization_security_policy_association" "policy" {
provider = google-beta

name = "tf-test%{random_suffix}"
attachment_id = google_compute_organization_security_policy.policy.parent
policy_id = google_compute_organization_security_policy.policy.id
Expand Down Expand Up @@ -123,5 +126,4 @@ OrganizationSecurityPolicyAssociation can be imported using any of these accepte

```
$ terraform import google_compute_organization_security_policy_association.default {{policy_id}}/association/{{name}}
$ terraform import google_compute_organization_security_policy_association.default {{policy_id}}/{{name}}
```
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ To get more information about OrganizationSecurityPolicyRule, see:
```hcl
resource "google_compute_organization_security_policy" "policy" {
provider = google-beta

display_name = "tf-test%{random_suffix}"
parent = "organizations/123456789"
}
Expand Down Expand Up @@ -208,5 +207,4 @@ OrganizationSecurityPolicyRule can be imported using any of these accepted forma

```
$ terraform import google_compute_organization_security_policy_rule.default {{policy_id}}/priority/{{priority}}
$ terraform import google_compute_organization_security_policy_rule.default {{policy_id}}/{{priority}}
```