File tree Expand file tree Collapse file tree 15 files changed +86
-1
lines changed
Expand file tree Collapse file tree 15 files changed +86
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Terraform Validation
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - master
7+
8+ jobs :
9+ terraform :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+
15+ - name : Setup Terraform
16+ uses : hashicorp/setup-terraform@v3
17+ with :
18+ terraform_version : latest
19+
20+ - name : Configure Terraform plugin cache
21+ run : |
22+ echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV"
23+ mkdir --parents "$HOME/.terraform.d/plugin-cache"
24+
25+ - name : Cache Terraform Plugin
26+ uses : actions/cache@v4
27+ with :
28+ path : |
29+ ~/.terraform.d/plugin-cache
30+ key : terraform-${{ runner.os }}-plugin-cache
31+ restore-keys : |
32+ terraform-${{ runner.os }}-plugin-cache
33+
34+ - name : Terraform Validate in All Modules
35+ run : |
36+ export TF_PLUGIN_CACHE_DIR="${HOME}/.terraform.d/plugin-cache"
37+ for dir in modules/*; do
38+ if [ -d "$dir" ]; then
39+ echo "Validating $dir"
40+ cd "$dir"
41+ terraform init
42+ terraform validate
43+ cd -
44+ fi
45+ done
Original file line number Diff line number Diff line change 1+ data "aws_caller_identity" "current" {}
2+
13module "s3_bucket" {
24 source = " terraform-aws-modules/s3-bucket/aws"
35 version = " 3.15.1"
@@ -8,8 +10,13 @@ module "s3_bucket" {
810
911 control_object_ownership = true
1012 object_ownership = " ObjectWriter"
13+
14+ tags = {
15+ Vendor = " zilliz-byoc"
16+ Caller = data.aws_caller_identity.current.arn
17+ }
1118}
1219
1320output "s3_bucket_ids" {
1421 value = module. s3_bucket [" milvus" ]. s3_bucket_id
15- }
22+ }
Original file line number Diff line number Diff line change @@ -8,10 +8,12 @@ resource "aws_eks_cluster" "zilliz_byoc_cluster" {
88 tags = {
99
1010 " Vendor" = " zilliz-byoc"
11+ Caller = data.aws_caller_identity.current.arn
1112 }
1213 tags_all = {
1314
1415 " Vendor" = " zilliz-byoc"
16+ Caller = data.aws_caller_identity.current.arn
1517 }
1618 # version = "1.31"
1719
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ resource "aws_iam_role" "eks_addon_role" {
33
44 tags = {
55 Vendor = " zilliz-byoc"
6+ Caller = data.aws_caller_identity.current.arn
67 }
78
89 assume_role_policy = jsonencode ({
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ resource "aws_iam_role" "eks_role" {
33
44 tags = {
55 Vendor = " zilliz-byoc"
6+ Caller = data.aws_caller_identity.current.arn
67 }
78
89 assume_role_policy = jsonencode ({
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ resource "aws_iam_role" "maintaince_role" {
3636
3737 tags = {
3838 Vendor = " zilliz-byoc"
39+ Caller = data.aws_caller_identity.current.arn
3940 }
4041}
4142
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ resource "aws_iam_role" "storage_role" {
22 name = " ${ local . dataplane_id } -storage-role"
33 tags = {
44 Vendor = " zilliz-byoc"
5+ Caller = data.aws_caller_identity.current.arn
56 }
67
78 lifecycle {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ resource "aws_vpc_endpoint" "byoc_endpoint" {
1414 tags = {
1515 Name = " ${ local . dataplane_id } -endpoint"
1616 Vendor = " zilliz-byoc"
17+ Caller = data.aws_caller_identity.current.arn
1718 }
1819}
1920
@@ -27,6 +28,11 @@ resource "aws_route53_zone" "byoc_private_zone" {
2728 vpc_id = module. vpc . vpc_id
2829 }
2930 comment = " Private hosted zone for BYOC project"
31+
32+ tags = {
33+ Vendor = " zilliz-byoc"
34+ Caller = data.aws_caller_identity.current.arn
35+ }
3036}
3137
3238resource "aws_route53_record" "byoc_endpoint_alias" {
Original file line number Diff line number Diff line change @@ -8,4 +8,9 @@ module "s3_bucket" {
88
99 control_object_ownership = true
1010 object_ownership = " ObjectWriter"
11+
12+ tags = {
13+ Vendor = " zilliz-byoc"
14+ Caller = data.aws_caller_identity.current.arn
15+ }
1116}
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ module "vpc" {
4444
4545 tags = {
4646 Vendor = " zilliz-byoc"
47+ Caller = data.aws_caller_identity.current.arn
4748 }
4849}
4950
You can’t perform that action at this time.
0 commit comments