Skip to content

Commit 13a4cbc

Browse files
authored
Merge pull request #21 from zilliztech/record-caller
chore: record caller
2 parents 6a74547 + f767a54 commit 13a4cbc

File tree

15 files changed

+86
-1
lines changed

15 files changed

+86
-1
lines changed

.github/workflows/hcl-check.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

modules/aws_bucket/bucket.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
data "aws_caller_identity" "current" {}
2+
13
module "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

1320
output "s3_bucket_ids" {
1421
value = module.s3_bucket["milvus"].s3_bucket_id
15-
}
22+
}

modules/aws_byoc_op/eks.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

modules/aws_byoc_op/iam-role-eks-addon.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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({

modules/aws_byoc_op/iam-role-eks.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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({

modules/aws_byoc_op/iam-role-maintaince.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

modules/aws_byoc_op/iam-role-storage.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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 {

modules/aws_byoc_op/private_link.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

3238
resource "aws_route53_record" "byoc_endpoint_alias" {

modules/aws_byoc_op/s3.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

modules/aws_byoc_op/vpc.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)