Skip to content

Commit 1202abe

Browse files
committed
fix(CI): provide the TFC token in the environment
1 parent aa11a4b commit 1202abe

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

infra/repository/main.tf

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,22 @@ resource "github_repository_environment" "this" {
2424
}
2525
}
2626

27-
resource "github_actions_environment_secret" "this" {
27+
resource "github_actions_environment_secret" "iam_role" {
2828
repository = "aws-lambda-opentofu-github-actions"
2929

3030
environment = github_repository_environment.this.environment
3131
secret_name = "AWS_IAM_ROLE"
3232
plaintext_value = var.aws_iam_role
3333
}
3434

35+
resource "github_actions_environment_secret" "terraform_cloud_token" {
36+
repository = "aws-lambda-opentofu-github-actions"
37+
38+
environment = github_repository_environment.this.environment
39+
secret_name = "TF_TOKEN_app_terraform_io"
40+
plaintext_value = var.terraform_cloud_token
41+
}
42+
3543
resource "github_actions_environment_variable" "this" {
3644
repository = "aws-lambda-opentofu-github-actions"
3745
environment = var.environment_name

infra/repository/variables.tf

+7
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ variable "environment_name" {
77
type = string
88
nullable = false
99
}
10+
11+
variable "terraform_cloud_token" {
12+
type = string
13+
description = "The token to authenticate with Terraform Cloud"
14+
sensitive = true
15+
nullable = false
16+
}

0 commit comments

Comments
 (0)