Skip to content

Commit

Permalink
CSU-1154: rename test_role to cast_role (#10)
Browse files Browse the repository at this point in the history
* rename test_role to cast_role

* upgrade linter

* fix linter
  • Loading branch information
ValyaB authored Jan 25, 2024
1 parent f6d1cff commit 2f30676
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
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

0 comments on commit 2f30676

Please sign in to comment.