INFRA-3721 | Ankit Bhardwaj | fix test
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit when any command fails
|
||||
set -e
|
||||
|
||||
additional_terraform_options=""
|
||||
additional_kube_options=""
|
||||
|
||||
terraform_action=${1:-apply}
|
||||
if [ $terraform_action == "apply" ];then
|
||||
additional_terraform_options="${additional_terraform_options} -auto-approve"
|
||||
else
|
||||
additional_kube_options="${additional_kube_options} --dry-run"
|
||||
fi
|
||||
|
||||
terraform init
|
||||
terraform workspace select nonprod.np.navi-tech.in || terraform workspace new nonprod.np.navi-tech.in
|
||||
terraform $terraform_action $additional_terraform_options
|
||||
|
||||
kubectl config use-context ${CLUSTER}
|
||||
kubectl apply -f foo-navi-service-dev.yaml -n ${NAMESPACE} $additional_kube_options
|
||||
@@ -1,17 +0,0 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "navi-bank-terraform-nonprod-state"
|
||||
region = "ap-south-1"
|
||||
key = "service-iam-roles"
|
||||
workspace_key_prefix = "iamroles/dev/foo-navi-service"
|
||||
profile = "nonprod"
|
||||
acl = "bucket-owner-full-control"
|
||||
}
|
||||
}
|
||||
|
||||
module "iam-role" {
|
||||
source = "git::ssh://git@github.cmd.navi-tech.in/navi-infra/iam-roles.git?ref=cef39cc18b5dd3095cf6969dabfe1cfe09500390"
|
||||
environment = "dev"
|
||||
service_role = {"policies":[{"actions":["s3:GetObject","s3:PutObject"],"resource":"arn:aws:s3:::navi-e3e2a9bfd88566b05001b02a3f51d286/*"},{"actions":["s3:GetObject","s3:PutObject"],"resource":"*"},{"actions":["sns:Publish","sns:SetSMSAttributes"],"resource":"arn:aws:s3:::arn:aws:s3:::test-bucket-to-be-deleted/*"}]}
|
||||
role_name = "foo-navi-service"
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit when any command fails
|
||||
set -e
|
||||
|
||||
additional_terraform_options=""
|
||||
terraform_action=${1:-apply}
|
||||
|
||||
if [ $terraform_action == "apply" ];then
|
||||
additional_terraform_options="${additional_terraform_options} -auto-approve"
|
||||
fi
|
||||
|
||||
terraform init
|
||||
terraform workspace select nonprod.np.navi-tech.in || terraform workspace new nonprod.np.navi-tech.in
|
||||
terraform $terraform_action $additional_terraform_options
|
||||
@@ -1,16 +0,0 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "navi-bank-terraform-nonprod-state"
|
||||
region = "ap-south-1"
|
||||
key = "s3-buckets"
|
||||
workspace_key_prefix = "s3-buckets/dev/foo-navi-service"
|
||||
profile = "nonprod"
|
||||
acl = "bucket-owner-full-control"
|
||||
}
|
||||
}
|
||||
|
||||
module "s3-buckets" {
|
||||
source = "git::ssh://git@github.cmd.navi-tech.in/navi-infra/aws-s3-bucket.git?ref=fd40ccc2a8f4a97029612e618b9d09902ceecfe3"
|
||||
s3_buckets = [{"anonymizedBucketName":"navi-bucket-test-1","bucketTag":"customer-uploads","lifecycleRules":null},{"anonymizedBucketName":"navi-bucket-test-2","bucketTag":"document-uploads","lifecycleRules":[{"expiration":{"days":1,"storageClass":""}}]}]
|
||||
environment = "dev"
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
additional_terraform_options=""
|
||||
terraform_action=${1:-apply}
|
||||
|
||||
if [ $terraform_action == "apply" ];then
|
||||
additional_terraform_options="${additional_terraform_options} -auto-approve"
|
||||
fi
|
||||
|
||||
terraform init
|
||||
terraform workspace select nonprod.np.navi-tech.in || terraform workspace new nonprod.np.navi-tech.in
|
||||
terraform $terraform_action -target=module.rds.data.aws_subnet_ids.command_private_subnets $additional_terraform_options
|
||||
terraform $terraform_action -target=module.rds.module.rds_instance $additional_terraform_options
|
||||
terraform $terraform_action -target=module.rds.module.rds_instance_replica $additional_terraform_options
|
||||
terraform $terraform_action -target=module.rds.module.postgres_db $additional_terraform_options
|
||||
57
testdata/m1_basic/expected_output/rds-tf/main.tf
vendored
57
testdata/m1_basic/expected_output/rds-tf/main.tf
vendored
@@ -1,57 +0,0 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "navi-bank-terraform-command-state"
|
||||
region = "ap-south-1"
|
||||
key = "rds"
|
||||
workspace_key_prefix = "rds-states/foo-service"
|
||||
profile = "cmd"
|
||||
acl = "bucket-owner-full-control"
|
||||
}
|
||||
}
|
||||
|
||||
module "rds" {
|
||||
source = "git::ssh://git@github.cmd.navi-tech.in/navi-infra/rds.git?ref=1fc10877a1d9d009ca892208f7f89f669e7634cc"
|
||||
environment = "dev"
|
||||
instance_name = "foo-service"
|
||||
password = "foo_service_password"
|
||||
user = "foo_service_user"
|
||||
name = "foo"
|
||||
|
||||
monitoring_password = ""
|
||||
monitoring_user = ""
|
||||
|
||||
databases = ["foo_service"]
|
||||
database_tags = {
|
||||
Team = "Infra"
|
||||
medici-app = "foo-navi-service"
|
||||
medici-owner = "Infra"
|
||||
medici-environment = "dev"
|
||||
}
|
||||
|
||||
team = "Infra"
|
||||
size = 7
|
||||
db_extensions = ["pgcrypto"]
|
||||
readonly_user = "foo_readonly_user"
|
||||
readonly_password = "foo_readonly_password"
|
||||
backup_retention_period = 7
|
||||
multi_az = true
|
||||
read_replica_instance_class = "db.t3.micro"
|
||||
read_replica_performance_insights_enabled = true
|
||||
parameters = [
|
||||
{
|
||||
name = "rds.logical_replication"
|
||||
value = "1"
|
||||
apply_method = "pending-reboot"
|
||||
}
|
||||
]
|
||||
cpu_utilization_alarm_threshold = "70"
|
||||
cpucredit_balance_alarm_threshold = "120"
|
||||
burst_balance_alarm_threshold = "85"
|
||||
db_connections_alarm_threshold = "200"
|
||||
queue_depth_alarm_threshold = "20"
|
||||
free_storage_space_percent = 90
|
||||
freeable_memory_threshold = 150
|
||||
read_latency_alarm_threshold = "0.5"
|
||||
write_latency_alarm_threshold = "0.5"
|
||||
|
||||
}
|
||||
74
testdata/m1_basic/sample_infra_manifest.json
vendored
74
testdata/m1_basic/sample_infra_manifest.json
vendored
@@ -1,74 +0,0 @@
|
||||
{
|
||||
"extraResources": {
|
||||
"environment": "dev",
|
||||
"database": {
|
||||
"instanceName": "foo-service",
|
||||
"user": "foo_service_user",
|
||||
"password": "foo_service_password",
|
||||
"sizeInGb": 7,
|
||||
"dbNames": ["foo_service"],
|
||||
"dbExtensions": ["pgcrypto"],
|
||||
"readonlyUser": "foo_readonly_user",
|
||||
"readonlyPassword": "foo_readonly_password",
|
||||
"applyImmediately": false,
|
||||
"performanceInsightsEnabled": false,
|
||||
"readReplica": {
|
||||
"awsInstanceClass": "db.t3.micro",
|
||||
"performanceInsightsEnabled": true
|
||||
},
|
||||
"parameters": {
|
||||
"rds.logical_replication": "1"
|
||||
},
|
||||
"rdsAlertThresholds": {
|
||||
"cpuUtilization": 70,
|
||||
"cpuCreditBalance": 120,
|
||||
"burstBalance": 85,
|
||||
"dbConnections": 200,
|
||||
"queueDepth": 20,
|
||||
"freeStorageSpacePercent": 90,
|
||||
"freeMemoryTooLowInMB": 150,
|
||||
"readLatency": 0.5,
|
||||
"writeLatency": 0.5
|
||||
}
|
||||
},
|
||||
"aws_access": {
|
||||
"policies": [
|
||||
{
|
||||
"actions": ["s3:GetObject", "s3:PutObject"],
|
||||
"resource": "arn:aws:s3:::navi-e3e2a9bfd88566b05001b02a3f51d286/*"
|
||||
},
|
||||
{
|
||||
"actions": ["s3:GetObject", "s3:PutObject"],
|
||||
"resource": "*"
|
||||
},
|
||||
{
|
||||
"resource": "arn:aws:s3:::arn:aws:s3:::test-bucket-to-be-deleted/*",
|
||||
"actions": ["sns:Publish", "sns:SetSMSAttributes"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"s3_buckets": [
|
||||
{
|
||||
"anonymizedBucketName": "navi-bucket-test-1",
|
||||
"bucketTag": "customer-uploads"
|
||||
},
|
||||
{
|
||||
"anonymizedBucketName": "navi-bucket-test-2",
|
||||
"bucketTag": "document-uploads",
|
||||
"lifecycleRules": [
|
||||
{
|
||||
"expiration": {
|
||||
"days": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"team": {
|
||||
"name": "Infra"
|
||||
},
|
||||
"deployment": {
|
||||
"name": "foo"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user