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

CSU-1154: rename test_role to cast_role #10

Merged
merged 3 commits into from
Jan 25, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: terraform-linters/setup-tflint@v1
name: Setup TFLint
with:
tflint_version: v0.29.0
tflint_version: v0.48.0

- name: Show version
run: tflint --version
Expand Down
13 changes: 9 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ data "castai_eks_settings" "eks" {
}

resource "aws_iam_role_policy_attachment" "castai_iam_policy_attachment" {
role = aws_iam_role.test_role.name
role = aws_iam_role.cast_role.name
policy_arn = aws_iam_policy.castai_iam_policy.arn
}

resource "aws_iam_role" "test_role" {
resource "aws_iam_role" "cast_role" {
name = local.iam_role_name
assume_role_policy = data.aws_iam_policy_document.cast_assume_role_policy.json
}

moved {
from = aws_iam_role.test_role
to = aws_iam_role.cast_role
}

resource "aws_iam_policy" "castai_iam_policy" {
name = local.iam_policy_name
policy = data.castai_eks_settings.eks.iam_policy_json
Expand All @@ -39,13 +44,13 @@ resource "aws_iam_role_policy_attachment" "castai_iam_readonly_policy_attachment
"${local.iam_policy_prefix}/AmazonEC2ReadOnlyAccess",
"${local.iam_policy_prefix}/IAMReadOnlyAccess",
])
role = aws_iam_role.test_role.name
role = aws_iam_role.cast_role.name
policy_arn = each.value
}

resource "aws_iam_role_policy" "castai_role_iam_policy" {
name = local.iam_role_policy_name
role = aws_iam_role.test_role.name
role = aws_iam_role.cast_role.name
policy = data.castai_eks_settings.eks.iam_user_policy_json
}
# iam - instance profile role
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output "role_arn" {
description = "Arn of created AWS user"
value = aws_iam_role.test_role.arn
value = aws_iam_role.cast_role.arn
}

output "instance_profile_arn" {
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ variable "aws_account_id" {
description = "ID of AWS account the cluster is located in."
}

variable "castai_iam_policy_name" {
type = string
description = "Name of a IAM policy to create."
default = ""
}

variable "castai_user_arn" {
type = string
description = "ARN of CAST AI user for which AssumeRole trust access should be granted"
Expand Down
Loading