Skip to content

Commit a1a975a

Browse files
committed
Remove obsolete policy
1 parent 35e8c7e commit a1a975a

File tree

3 files changed

+0
-50
lines changed

3 files changed

+0
-50
lines changed

management/policies.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
resource "spacelift_policy" "ignore-outside-project-root" {
2-
name = "Ignore pushes outside of project root - ${random_string.stack_name_suffix.result}"
3-
body = file("${path.module}/policies/ignore-outside-project-root.rego")
4-
type = "GIT_PUSH"
5-
6-
labels = toset(var.spacelift_labels)
7-
}
8-
91
resource "spacelift_policy" "trigger-dependent-stacks" {
102
name = "Trigger dependent stacks - ${random_string.stack_name_suffix.result}"
113
body = file("${path.module}/policies/trigger-dependent-stacks.rego")

management/policies/ignore-outside-project-root.rego

Lines changed: 0 additions & 18 deletions
This file was deleted.

management/stacks.tf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ resource "spacelift_aws_role" "terraform-stack" {
4444
role_arn = var.aws_role
4545
}
4646

47-
resource "spacelift_policy_attachment" "ignore-outside-project-root-terraform" {
48-
policy_id = spacelift_policy.ignore-outside-project-root.id
49-
stack_id = spacelift_stack.terraform-ansible-workflow-terraform.id
50-
}
51-
5247
resource "spacelift_policy_attachment" "trigger-dependent-stacks-terraform" {
5348
policy_id = spacelift_policy.trigger-dependent-stacks.id
5449
stack_id = spacelift_stack.terraform-ansible-workflow-terraform.id
@@ -59,7 +54,6 @@ resource "spacelift_stack_destructor" "terraform-stack" {
5954
spacelift_environment_variable.ansible_context_id,
6055
spacelift_environment_variable.aws_region,
6156
spacelift_aws_role.terraform-stack,
62-
spacelift_policy_attachment.ignore-outside-project-root-terraform,
6357
spacelift_policy_attachment.trigger-dependent-stacks-terraform,
6458
]
6559

@@ -102,28 +96,11 @@ resource "spacelift_aws_role" "ansible-stack" {
10296
role_arn = var.aws_role
10397
}
10498

105-
resource "spacelift_policy_attachment" "ignore-outside-project-root-ansible" {
106-
policy_id = spacelift_policy.ignore-outside-project-root.id
107-
stack_id = spacelift_stack.terraform-ansible-workflow-ansible.id
108-
}
109-
11099
resource "spacelift_policy_attachment" "warn-on-unreachable-hosts-ansible" {
111100
policy_id = spacelift_policy.warn-on-unreachable-hosts.id
112101
stack_id = spacelift_stack.terraform-ansible-workflow-ansible.id
113102
}
114103

115-
# Ignore outside of project root for current stack
116-
data "spacelift_current_stack" "this" {}
117-
118-
data "spacelift_stack" "current_stack" {
119-
stack_id = data.spacelift_current_stack.this.id
120-
}
121-
122-
resource "spacelift_policy_attachment" "ignore-outside-project-root-this" {
123-
policy_id = spacelift_policy.ignore-outside-project-root.id
124-
stack_id = data.spacelift_current_stack.this.id
125-
}
126-
127104
# Trigger a run in terraform stack
128105

129106
resource "spacelift_run" "this" {
@@ -132,6 +109,5 @@ resource "spacelift_run" "this" {
132109
depends_on = [
133110
spacelift_environment_variable.ansible_context_id,
134111
spacelift_aws_role.ansible-stack,
135-
spacelift_policy_attachment.ignore-outside-project-root-ansible,
136112
]
137113
}

0 commit comments

Comments
 (0)