Skip to content
Snippets Groups Projects
Commit 492fe792 authored by Timo Furrer's avatar Timo Furrer
Browse files

Merge branch 'artifacts-access' into 'main'

Lock down plan artifacts access

Closes #29

See merge request components/opentofu!80
parents d7b564bb dadf9916
Branches
Tags
No related merge requests found
...@@ -182,6 +182,7 @@ Have a look at the individual template spec to learn about the available inputs. ...@@ -182,6 +182,7 @@ Have a look at the individual template spec to learn about the available inputs.
| `state_name` | `default` | Remote OpenTofu state name. | | `state_name` | `default` | Remote OpenTofu state name. |
| `auto_apply` | `false` | Whether the apply job is manual or automatically run. | | `auto_apply` | `false` | Whether the apply job is manual or automatically run. |
| `auto_destroy` | `false` | Whether the destroy job is manual or automatically run. | | `auto_destroy` | `false` | Whether the destroy job is manual or automatically run. |
| `plan_artifacts_access` | `none` | Access level for the plan artifact. See https://docs.gitlab.com/ee/ci/yaml/#artifactsaccess for possible values. |
### Available OpenTofu Versions ### Available OpenTofu Versions
......
...@@ -67,6 +67,9 @@ spec: ...@@ -67,6 +67,9 @@ spec:
default: false default: false
type: boolean type: boolean
description: 'Whether the destroy job is manual or automatically run.' description: 'Whether the destroy job is manual or automatically run.'
plan_artifacts_access:
default: 'none'
description: 'Access level for the plan artifact. See https://docs.gitlab.com/ee/ci/yaml/#artifactsaccess for possible values.'
--- ---
...@@ -113,6 +116,7 @@ include: ...@@ -113,6 +116,7 @@ include:
image_name: $[[ inputs.image_name ]] image_name: $[[ inputs.image_name ]]
root_dir: $[[ inputs.root_dir ]] root_dir: $[[ inputs.root_dir ]]
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
artifacts_access: $[[ inputs.plan_artifacts_access ]]
- local: '/templates/apply.yml' - local: '/templates/apply.yml'
inputs: inputs:
as: 'apply' as: 'apply'
......
...@@ -57,6 +57,9 @@ spec: ...@@ -57,6 +57,9 @@ spec:
default: false default: false
type: boolean type: boolean
description: 'Indicate if the plan should be a destroy plan. You may want to change the `plan_name` input to `destroy-plan` which is the default for the destroy job.' description: 'Indicate if the plan should be a destroy plan. You may want to change the `plan_name` input to `destroy-plan` which is the default for the destroy job.'
artifacts_access:
default: 'none'
description: 'Access level for the plan artifact. See https://docs.gitlab.com/ee/ci/yaml/#artifactsaccess for possible values.'
--- ---
...@@ -70,10 +73,8 @@ spec: ...@@ -70,10 +73,8 @@ spec:
# Terraform's cache files can include secrets which can be accidentally exposed. # Terraform's cache files can include secrets which can be accidentally exposed.
# Please exercise caution when utilizing secrets in your Terraform infrastructure and # Please exercise caution when utilizing secrets in your Terraform infrastructure and
# consider limiting access to artifacts or take other security measures to protect sensitive information. # consider limiting access to artifacts or take other security measures to protect sensitive information.
# # See https://docs.gitlab.com/ee/ci/yaml/#artifactsaccess for possible values.
# The next line, which disables public access to pipeline artifacts, is not available on GitLab.com. access: '$[[ inputs.artifacts_access ]]'
# See: https://docs.gitlab.com/ee/ci/yaml/#artifactspublic
public: false
paths: paths:
- $TF_ROOT/$[[ inputs.plan_name ]].cache - $TF_ROOT/$[[ inputs.plan_name ]].cache
reports: reports:
......
...@@ -57,6 +57,9 @@ spec: ...@@ -57,6 +57,9 @@ spec:
default: false default: false
type: boolean type: boolean
description: 'Whether the apply job is manual or automatically run.' description: 'Whether the apply job is manual or automatically run.'
plan_artifacts_access:
default: 'none'
description: 'Access level for the plan artifact. See https://docs.gitlab.com/ee/ci/yaml/#artifactsaccess for possible values.'
--- ---
...@@ -90,6 +93,7 @@ include: ...@@ -90,6 +93,7 @@ include:
image_name: $[[ inputs.image_name ]] image_name: $[[ inputs.image_name ]]
root_dir: $[[ inputs.root_dir ]] root_dir: $[[ inputs.root_dir ]]
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
artifacts_access: $[[ inputs.plan_artifacts_access ]]
- local: '/templates/apply.yml' - local: '/templates/apply.yml'
inputs: inputs:
as: 'apply' as: 'apply'
......
...@@ -56,6 +56,9 @@ spec: ...@@ -56,6 +56,9 @@ spec:
plan_name: plan_name:
default: 'destroy-plan' default: 'destroy-plan'
description: 'Destroy plan file name.' description: 'Destroy plan file name.'
plan_artifacts_access:
default: 'none'
description: 'Access level for the plan artifact. See https://docs.gitlab.com/ee/ci/yaml/#artifactsaccess for possible values.'
auto_destroy: auto_destroy:
default: false default: false
type: boolean type: boolean
...@@ -94,6 +97,7 @@ include: ...@@ -94,6 +97,7 @@ include:
root_dir: $[[ inputs.root_dir ]] root_dir: $[[ inputs.root_dir ]]
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
plan_name: $[[ inputs.plan_name ]] plan_name: $[[ inputs.plan_name ]]
artifacts_access: $[[ inputs.plan_artifacts_access ]]
destroy: true destroy: true
- local: '/templates/destroy.yml' - local: '/templates/destroy.yml'
inputs: inputs:
......
...@@ -50,6 +50,9 @@ spec: ...@@ -50,6 +50,9 @@ spec:
state_name: state_name:
default: default default: default
description: 'Remote OpenTofu state name.' description: 'Remote OpenTofu state name.'
artifacts_access:
default: 'none'
description: 'Access level for the plan artifact. See https://docs.gitlab.com/ee/ci/yaml/#artifactsaccess for possible values.'
--- ---
...@@ -83,3 +86,4 @@ include: ...@@ -83,3 +86,4 @@ include:
image_name: $[[ inputs.image_name ]] image_name: $[[ inputs.image_name ]]
root_dir: $[[ inputs.root_dir ]] root_dir: $[[ inputs.root_dir ]]
state_name: $[[ inputs.state_name ]] state_name: $[[ inputs.state_name ]]
artifacts_access: $[[ inputs.artifacts_access ]]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment