@hiiretail/gcp-infra-cli 0.87.3 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators/clan-resources/clan-project/generator.json +4 -0
- package/generators/clan-resources/clan-project/index.js +135 -0
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/cloud-nat/terragrunt.hcl +9 -3
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/cloud-nat-static-ip/terragrunt.hcl +2 -2
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/cloud-router/terragrunt.hcl +7 -4
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/gke-resources/terragrunt.hcl +40 -0
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/spec.hcl +18 -0
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/gke/terragrunt.hcl +12 -7
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/network/firewall-rules/config/main.tf +13 -0
- package/generators/clan-resources/clan-project/templates/clan-resources/network/firewall-rules/config/vars.tf +9 -0
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/network/firewall-rules/terragrunt.hcl +3 -3
- package/generators/clan-resources/clan-project/templates/clan-resources/network/spec.hcl +46 -0
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/network/terragrunt.hcl +2 -2
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/private-vpc-connection/config/main.tf +2 -1
- package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/private-vpc-connection/terragrunt.hcl +3 -3
- package/generators/clan-resources/clan-project/templates/clan-resources/serverless-vpc-connector/terragrunt.hcl +40 -0
- package/generators/{tribe-resources → clan-resources}/command.json +1 -1
- package/generators/{resources → common-resources}/command.json +1 -1
- package/generators/{resources → common-resources}/pubsub/templates/pubsub-external/terragrunt.hcl +1 -0
- package/generators/{resources → common-resources}/spanner/index.js +2 -8
- package/generators/common-resources/spanner/validate.js +24 -0
- package/generators/organization/clan-project/index.js +6 -0
- package/generators/organization/clan-project/templates/clan/clan.yaml +3 -1
- package/generators/organization/clan-project/templates/clan-project/terragrunt.hcl +4 -37
- package/package.json +1 -1
- package/generators/resources/spanner/validate.js +0 -27
- package/generators/tribe-resources/tribe-project/generator.json +0 -4
- package/generators/tribe-resources/tribe-project/index.js +0 -106
- package/generators/tribe-resources/tribe-project/templates/project/gke/opa/config/main.tf +0 -33
- package/generators/tribe-resources/tribe-project/templates/project/gke/opa/config/vars.tf +0 -14
- package/generators/tribe-resources/tribe-project/templates/project/gke/opa/terragrunt.hcl +0 -34
- package/generators/tribe-resources/tribe-project/templates/project/gke/spec.hcl +0 -35
- package/generators/tribe-resources/tribe-project/templates/project/gke-ingress-static-ip/spec.hcl +0 -7
- package/generators/tribe-resources/tribe-project/templates/project/gke-ingress-static-ip/terragrunt.hcl +0 -25
- package/generators/tribe-resources/tribe-project/templates/project/network/firewall-rules/config/vars.tf +0 -9
- package/generators/tribe-resources/tribe-project/templates/project/network/spec.hcl +0 -40
- package/generators/tribe-resources/tribe-project/templates/project/project.yaml +0 -7
- package/generators/tribe-resources/tribe-project/templates/project/terragrunt.hcl +0 -51
- /package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/cloud-nat-static-ip/spec.hcl +0 -0
- /package/generators/{tribe-resources/tribe-project/templates/project → clan-resources/clan-project/templates/clan-resources}/private-vpc-connection/config/vars.tf +0 -0
- /package/generators/{tribe-resources/tribe-project/templates → clan-resources/clan-project/templates/clan-resources}/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/bigquery/generator.json +0 -0
- /package/generators/{resources → common-resources}/bigquery/index.js +0 -0
- /package/generators/{resources → common-resources}/bigquery/templates/bigquery/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/bigquery/templates/bigquery/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/bigquery/templates/scheduled-queries/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/bigquery/templates/schema/schema.json +0 -0
- /package/generators/{resources → common-resources}/cloud-storage/generator.json +0 -0
- /package/generators/{resources → common-resources}/cloud-storage/index.js +0 -0
- /package/generators/{resources → common-resources}/cloud-storage/templates/cloud-storage/storage.yaml +0 -0
- /package/generators/{resources → common-resources}/cloud-storage/templates/cloud-storage/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/generator.json +0 -0
- /package/generators/{resources → common-resources}/cloudsql/index.js +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/mssql/instance/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/mssql/instance/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/mssql/instance-secrets/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/mysql/instance/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/mysql/instance/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/mysql/instance-secrets/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/postgres/instance/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/postgres/instance/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql/templates/postgres/instance-secrets/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/generator.json +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/index.js +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/mysql/database/proxy_port.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/mysql/database/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/mysql/outputs.json +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/mysql/secrets/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/postgres/database/proxy_port.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/postgres/database/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/postgres/database/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/postgres/outputs.json +0 -0
- /package/generators/{resources → common-resources}/cloudsql-database/templates/postgres/secrets/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/confluent-cluster/generator.json +0 -0
- /package/generators/{resources → common-resources}/confluent-cluster/index.js +0 -0
- /package/generators/{resources → common-resources}/confluent-cluster/templates/confluent/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/confluent-cluster/templates/confluent/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/datastore/generator.json +0 -0
- /package/generators/{resources → common-resources}/datastore/index.js +0 -0
- /package/generators/{resources → common-resources}/datastore/templates/datastore/indexes.yaml +0 -0
- /package/generators/{resources → common-resources}/datastore/templates/datastore/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/elastic-cloud/generator.json +0 -0
- /package/generators/{resources → common-resources}/elastic-cloud/index.js +0 -0
- /package/generators/{resources → common-resources}/elastic-cloud/templates/elastic/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/elastic-cloud/templates/elastic/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/elastic-index-policy/generator.json +0 -0
- /package/generators/{resources → common-resources}/elastic-index-policy/handle-yaml.js +0 -0
- /package/generators/{resources → common-resources}/elastic-index-policy/index.js +0 -0
- /package/generators/{resources → common-resources}/elastic-index-policy/templates/policy/policy.yaml +0 -0
- /package/generators/{resources → common-resources}/elastic-index-policy/templates/policy/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/elastic-template/generator.json +0 -0
- /package/generators/{resources → common-resources}/elastic-template/index.js +0 -0
- /package/generators/{resources → common-resources}/elastic-template/templates/elastic-template/mappings.json +0 -0
- /package/generators/{resources → common-resources}/elastic-template/templates/elastic-template/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/firestore/generator.json +0 -0
- /package/generators/{resources → common-resources}/firestore/index.js +0 -0
- /package/generators/{resources → common-resources}/firestore/templates/firestore/indexes.yaml +0 -0
- /package/generators/{resources → common-resources}/firestore/templates/firestore/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/iam/generator.json +0 -0
- /package/generators/{resources → common-resources}/iam/index.js +0 -0
- /package/generators/{resources → common-resources}/iam/templates/github/workflows/iam.yml +0 -0
- /package/generators/{resources → common-resources}/iam/templates/iam.yaml +0 -0
- /package/generators/{resources → common-resources}/iam/valid-prefix.js +0 -0
- /package/generators/{resources → common-resources}/kafka-connect/generator.json +0 -0
- /package/generators/{resources → common-resources}/kafka-connect/index.js +0 -0
- /package/generators/{resources → common-resources}/kafka-connect/templates/elastic/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/kafka-connect/templates/pubsub/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/kafka-topics/generator.json +0 -0
- /package/generators/{resources → common-resources}/kafka-topics/index.js +0 -0
- /package/generators/{resources → common-resources}/kafka-topics/templates/kafka/kafka.yaml +0 -0
- /package/generators/{resources → common-resources}/kafka-topics/templates/kafka/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/kms/generator.json +0 -0
- /package/generators/{resources → common-resources}/kms/index.js +0 -0
- /package/generators/{resources → common-resources}/kms/templates/kms/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/kms/templates/kms/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/memorystore/generator.json +0 -0
- /package/generators/{resources → common-resources}/memorystore/index.js +0 -0
- /package/generators/{resources → common-resources}/memorystore/templates/outputs.json +0 -0
- /package/generators/{resources → common-resources}/memorystore/templates/redis-instance/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/memorystore/templates/redis-instance/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/memorystore/templates/secrets/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/monitoring/generator.json +0 -0
- /package/generators/{resources → common-resources}/monitoring/handle-yaml.js +0 -0
- /package/generators/{resources → common-resources}/monitoring/index.js +0 -0
- /package/generators/{resources → common-resources}/monitoring/templates/alerts/generic-infra.yaml +0 -0
- /package/generators/{resources → common-resources}/monitoring/templates/alerts/service.yaml +0 -0
- /package/generators/{resources → common-resources}/monitoring/templates/alerts/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/monitoring/templates/slos/slos.yaml +0 -0
- /package/generators/{resources → common-resources}/monitoring/templates/slos/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/monitoring/templates/uptime-checks/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/monitoring/templates/uptime-checks/uptime-checks.yaml +0 -0
- /package/generators/{resources → common-resources}/monitoring/validate.js +0 -0
- /package/generators/{resources → common-resources}/pubsub/append.js +0 -0
- /package/generators/{resources → common-resources}/pubsub/generator.json +0 -0
- /package/generators/{resources → common-resources}/pubsub/get-gcp-projects.js +0 -0
- /package/generators/{resources → common-resources}/pubsub/handle-subscribers.js +0 -0
- /package/generators/{resources → common-resources}/pubsub/index.js +0 -0
- /package/generators/{resources → common-resources}/pubsub/templates/pubsub/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/pubsub/templates/pubsub/subscribers.yaml +0 -0
- /package/generators/{resources → common-resources}/pubsub/templates/pubsub/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/pubsub/templates/pubsub-dlq/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/pubsub/templates/pubsub-external/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/pubsub/templates/pubsub-external/subscribers.yaml +0 -0
- /package/generators/{resources → common-resources}/pubsub/validate.js +0 -0
- /package/generators/{resources → common-resources}/scheduler/append.js +0 -0
- /package/generators/{resources → common-resources}/scheduler/generator.json +0 -0
- /package/generators/{resources → common-resources}/scheduler/index.js +0 -0
- /package/generators/{resources → common-resources}/scheduler/templates/scheduler/terragrunt.hcl +0 -0
- /package/generators/{resources → common-resources}/spanner/append.js +0 -0
- /package/generators/{resources → common-resources}/spanner/generator.json +0 -0
- /package/generators/{resources → common-resources}/spanner/templates/spanner/databases.yaml +0 -0
- /package/generators/{resources → common-resources}/spanner/templates/spanner/spec.hcl +0 -0
- /package/generators/{resources → common-resources}/spanner/templates/spanner/terragrunt.hcl +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
terraform {
|
|
2
|
-
source = "git::https://github.com/extenda/tf-module-gcp-project//?ref=
|
|
2
|
+
source = "git::https://github.com/extenda/tf-module-gcp-project//?ref=v2.0.0-autopilot"
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
dependency "parent_folder" {
|
|
@@ -9,32 +9,6 @@ dependency "parent_folder" {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
dependency "tribe_project" {
|
|
13
|
-
config_path = "../../../resources/${local.env_name}"
|
|
14
|
-
mock_outputs = {
|
|
15
|
-
project_id = "project-dummy-id"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
dependency "tribe_network" {
|
|
20
|
-
config_path = "../../../resources/${local.env_name}/network"
|
|
21
|
-
mock_outputs = {
|
|
22
|
-
subnets = {
|
|
23
|
-
"europe-west1/clan-resources" = {
|
|
24
|
-
id = "projects/project-name/regions/region-name/subnetworks/subnet-name"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
dependency "gke" {
|
|
31
|
-
config_path = "../../../resources/${local.env_name}/gke"
|
|
32
|
-
mock_outputs = {
|
|
33
|
-
endpoint = "dummy-endpoint"
|
|
34
|
-
ca_certificate = "dummy-ca-certificate"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
12
|
locals {
|
|
39
13
|
tribe_name = basename(dirname(dirname(dirname(get_terragrunt_dir()))))
|
|
40
14
|
clan_name = basename(dirname(get_terragrunt_dir()))
|
|
@@ -67,16 +41,9 @@ inputs = merge(
|
|
|
67
41
|
bucket_name = local.bucket_name
|
|
68
42
|
folder_id = dependency.parent_folder.outputs.folder_id
|
|
69
43
|
|
|
70
|
-
service_group_name
|
|
71
|
-
clan_gsuite_group
|
|
72
|
-
env_name
|
|
73
|
-
parent_project_id = dependency.tribe_project.outputs.project_id
|
|
74
|
-
gke_ca_certificate = dependency.gke.outputs.ca_certificate
|
|
75
|
-
gke_host = dependency.gke.outputs.endpoint
|
|
76
|
-
shared_vpc = dependency.tribe_project.outputs.project_id
|
|
77
|
-
shared_vpc_subnets = [
|
|
78
|
-
dependency.tribe_network.outputs.subnets["europe-west1/clan-resources"].id
|
|
79
|
-
]
|
|
44
|
+
service_group_name = local.service_group_name
|
|
45
|
+
clan_gsuite_group = local.clan_gsuite_group
|
|
46
|
+
env_name = local.env_name
|
|
80
47
|
bucket_labels = {
|
|
81
48
|
cc = local.tribe_yaml.costcenter
|
|
82
49
|
}
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const validName = (input) => {
|
|
2
|
-
if (input.replace(/\s/g, '').length >= 6 && input.length <= 30) {
|
|
3
|
-
return { valid: true };
|
|
4
|
-
}
|
|
5
|
-
return { valid: false, message: 'Name must be between 6 and 30 characters in length' };
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const validRetentionPeriod = (input) => {
|
|
9
|
-
const validFormats = /^(84000s|1h|2d|7d)$/;
|
|
10
|
-
|
|
11
|
-
if (input === '') {
|
|
12
|
-
return { valid: true };
|
|
13
|
-
}
|
|
14
|
-
if (validFormats.test(input)) {
|
|
15
|
-
return { valid: true };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
valid: false,
|
|
20
|
-
message: 'Invalid retention period format. Possible values are 84000s, 1h, 2d, or leave empty for default value 1h',
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
module.exports = {
|
|
25
|
-
validName,
|
|
26
|
-
validRetentionPeriod,
|
|
27
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const chalk = require('chalk');
|
|
3
|
-
const BaseGenerator = require('../../../src/BaseGenerator');
|
|
4
|
-
const { required } = require('../../../src/validators');
|
|
5
|
-
|
|
6
|
-
module.exports = class extends BaseGenerator {
|
|
7
|
-
constructor(args, opts) {
|
|
8
|
-
super(args, opts);
|
|
9
|
-
|
|
10
|
-
// Output directory relative to the tf-infra-gcp directory.
|
|
11
|
-
this.destinationRoot('organization');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
prompting() {
|
|
15
|
-
const prompts = [
|
|
16
|
-
{
|
|
17
|
-
type: 'list',
|
|
18
|
-
name: 'domain',
|
|
19
|
-
default: 'extendaretail-com',
|
|
20
|
-
message: 'Choose GCP Organization',
|
|
21
|
-
store: true,
|
|
22
|
-
choices: this.listSubDirectories(this.destinationPath()),
|
|
23
|
-
validate: required,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'list',
|
|
27
|
-
name: 'department',
|
|
28
|
-
message: 'Choose department',
|
|
29
|
-
store: true,
|
|
30
|
-
choices: (answers) => this.listSubDirectories(
|
|
31
|
-
path.join(this.destinationPath(), answers.domain, 'departments'),
|
|
32
|
-
),
|
|
33
|
-
validate: required,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
type: 'list',
|
|
37
|
-
name: 'tribe',
|
|
38
|
-
message: 'Choose tribe',
|
|
39
|
-
store: true,
|
|
40
|
-
choices: (answers) => this.listSubDirectories(
|
|
41
|
-
path.join(this.destinationPath(), answers.domain, 'departments', answers.department),
|
|
42
|
-
),
|
|
43
|
-
validate: required,
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
return this.prompt(prompts).then((props) => {
|
|
48
|
-
this.answers = props;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
writing() {
|
|
53
|
-
const {
|
|
54
|
-
domain,
|
|
55
|
-
department,
|
|
56
|
-
tribe,
|
|
57
|
-
} = this.answers;
|
|
58
|
-
|
|
59
|
-
this.fs.copyTpl(
|
|
60
|
-
this.templatePath('terragrunt.hcl'),
|
|
61
|
-
this.destinationPath(path.join(domain, 'departments', department, tribe, 'resources', 'terragrunt.hcl')),
|
|
62
|
-
this.answers,
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
['prod', 'staging'].forEach((env) => {
|
|
66
|
-
this.copyDir(
|
|
67
|
-
'project',
|
|
68
|
-
path.join(domain, 'departments', department, tribe, 'resources', env),
|
|
69
|
-
{
|
|
70
|
-
...this.answers,
|
|
71
|
-
network: {
|
|
72
|
-
// TODO These cannot be hard coded!
|
|
73
|
-
k8s_subnet_cidr: env === 'prod' ? '10.90.0.0/24' : '10.89.0.0/24',
|
|
74
|
-
tribe_subnet_cidr: env === 'prod' ? '10.90.2.0/23' : '10.89.2.0/23',
|
|
75
|
-
clan_subnet_cidr: env === 'prod' ? '10.90.4.0/22' : '10.89.4.0/22',
|
|
76
|
-
k8s_pods_cidr: env === 'prod' ? '172.20.0.0/17' : '172.19.0.0/17',
|
|
77
|
-
k8s_services_cidr: env === 'prod' ? '10.90.8.0/21' : '10.89.8.0/21',
|
|
78
|
-
},
|
|
79
|
-
gke: {
|
|
80
|
-
preemptible: env === 'staging',
|
|
81
|
-
},
|
|
82
|
-
env,
|
|
83
|
-
},
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
end() {
|
|
89
|
-
const {
|
|
90
|
-
domain,
|
|
91
|
-
department,
|
|
92
|
-
tribe,
|
|
93
|
-
} = this.answers;
|
|
94
|
-
const tribeDir = path.join(domain, 'departments', department, tribe, 'resources');
|
|
95
|
-
this.log(`
|
|
96
|
-
${chalk.green(`Your tribe GKE projects have now been created. To finalize your configuration, please continue
|
|
97
|
-
with manual editing of the generated files.`)}
|
|
98
|
-
${chalk.green('1.')} Review Network and Kubernetes configuration
|
|
99
|
-
\u2192 ${chalk.cyan(path.join(tribeDir, 'prod', 'network', 'spec.hcl'))}
|
|
100
|
-
\u2192 ${chalk.cyan(path.join(tribeDir, 'prod', 'gke', 'spec.hcl'))}
|
|
101
|
-
\u2192 ${chalk.cyan(path.join(tribeDir, 'staging', 'network', 'spec.hcl'))}
|
|
102
|
-
\u2192 ${chalk.cyan(path.join(tribeDir, 'staging', 'gke', 'spec.hcl'))}
|
|
103
|
-
${chalk.green('2.')} Push this change in a feature branch and open a pull request.
|
|
104
|
-
`);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
resource "null_resource" "setup_opa_config" {
|
|
2
|
-
triggers = {
|
|
3
|
-
cluster_name = var.cluster_name
|
|
4
|
-
cluster_region = var.cluster_region
|
|
5
|
-
project_id = var.project_id
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
provisioner "local-exec" {
|
|
9
|
-
command = <<EOT
|
|
10
|
-
gcloud container clusters get-credentials ${self.triggers.cluster_name} --region ${self.triggers.cluster_region} --project ${self.triggers.project_id}
|
|
11
|
-
cd $(git rev-parse --show-toplevel)/platform/opa-gke-installation/
|
|
12
|
-
gcloud config set project ${self.triggers.project_id}
|
|
13
|
-
gcloud compute firewall-rules update $(gcloud compute firewall-rules list --format='value(NAME)' --filter='NAME:master') --allow=TCP:9443,TCP:10250,TCP:443,TCP:15017
|
|
14
|
-
kubectl apply -f .
|
|
15
|
-
kubectl patch cm config-domainmapping -n knative-serving -p '{"data":{"autoTLS":"Enabled"}}'
|
|
16
|
-
if [[ ${self.triggers.project_id} == *"-prod"* ]]; then
|
|
17
|
-
kubectl patch hpa cluster-local-gateway -n gke-system -p '{"spec": { "minReplicas": 3 }}'
|
|
18
|
-
kubectl patch hpa istio-ingress -n gke-system -p '{"spec": { "minReplicas": 3 }}'
|
|
19
|
-
fi
|
|
20
|
-
cd envoy-filters && sleep 15 && kubectl apply -f .
|
|
21
|
-
EOT
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
provisioner "local-exec" {
|
|
25
|
-
when = destroy
|
|
26
|
-
command = <<EOT
|
|
27
|
-
gcloud container clusters get-credentials ${self.triggers.cluster_name} --region ${self.triggers.cluster_region} --project ${self.triggers.project_id}
|
|
28
|
-
cd $(git rev-parse --show-toplevel)/platform/opa-gke-installation/
|
|
29
|
-
kubectl delete -f .
|
|
30
|
-
kubectl patch cm config-domainmapping -n knative-serving -p '{"data":{"autoTLS":"Disabled"}}'
|
|
31
|
-
EOT
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
variable "cluster_name" {
|
|
2
|
-
description = "Cluster name"
|
|
3
|
-
type = string
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
variable "cluster_region" {
|
|
7
|
-
description = "Cluster region."
|
|
8
|
-
type = string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
variable "project_id" {
|
|
12
|
-
description = "Tribe project id where cluster is created."
|
|
13
|
-
type = string
|
|
14
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
|
|
2
|
-
# working directory, into a temporary folder, and execute your Terraform commands in that folder.
|
|
3
|
-
terraform {
|
|
4
|
-
source = "config/"
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
# Include all settings from the root terragrunt.hcl file
|
|
8
|
-
include {
|
|
9
|
-
path = find_in_parent_folders("terragrunt_root.hcl")
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
dependency "tribe_project" {
|
|
13
|
-
config_path = "../../"
|
|
14
|
-
mock_outputs = {
|
|
15
|
-
project_id = "dymmy-id"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
dependency "gke" {
|
|
20
|
-
config_path = "../"
|
|
21
|
-
mock_outputs = {
|
|
22
|
-
name = "dummy-name"
|
|
23
|
-
region = "region-name"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
# These are the variables we have to pass in to use the module specified in the terragrunt configuration above
|
|
28
|
-
inputs = merge(
|
|
29
|
-
{
|
|
30
|
-
cluster_name = dependency.gke.outputs.name
|
|
31
|
-
cluster_region = dependency.gke.outputs.region
|
|
32
|
-
project_id = dependency.tribe_project.outputs.project_id
|
|
33
|
-
}
|
|
34
|
-
)
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
locals {
|
|
2
|
-
name = "k8s-cluster"
|
|
3
|
-
regional = true
|
|
4
|
-
region = "europe-west1"
|
|
5
|
-
zones = ["europe-west1-d"]
|
|
6
|
-
ip_range_pods = "pods-cidr"
|
|
7
|
-
ip_range_services = "services-cidr"
|
|
8
|
-
create_service_account = true
|
|
9
|
-
grant_registry_access = true
|
|
10
|
-
http_load_balancing = true
|
|
11
|
-
network_policy = true
|
|
12
|
-
istio = false
|
|
13
|
-
cloudrun = true
|
|
14
|
-
node_metadata = "GKE_METADATA_SERVER"
|
|
15
|
-
enable_private_nodes = true
|
|
16
|
-
master_global_access_enabled = false
|
|
17
|
-
release_channel = "REGULAR"
|
|
18
|
-
maintenance_start_time = "01:00" #UTC
|
|
19
|
-
node_pools = [
|
|
20
|
-
{
|
|
21
|
-
name = "custom-node-pool"
|
|
22
|
-
machine_type = "n1-standard-2"
|
|
23
|
-
min_count = 1
|
|
24
|
-
max_count = 15
|
|
25
|
-
local_ssd_count = 0
|
|
26
|
-
disk_size_gb = 20
|
|
27
|
-
disk_type = "pd-ssd"
|
|
28
|
-
image_type = "COS"
|
|
29
|
-
auto_repair = true
|
|
30
|
-
auto_upgrade = true
|
|
31
|
-
preemptible = <%- gke.preemptible %>
|
|
32
|
-
initial_node_count = 1
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
terraform {
|
|
2
|
-
source = "git::https://github.com/terraform-google-modules/terraform-google-address//?ref=v2.1.0"
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
dependency "project" {
|
|
6
|
-
config_path = "../"
|
|
7
|
-
mock_outputs = {
|
|
8
|
-
project_id = "project-dummy-id"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
include {
|
|
13
|
-
path = find_in_parent_folders("terragrunt_root.hcl")
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
locals {
|
|
17
|
-
spec_vars = read_terragrunt_config("${get_terragrunt_dir()}/spec.hcl")
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
inputs = merge(
|
|
21
|
-
local.spec_vars.locals,
|
|
22
|
-
{
|
|
23
|
-
project_id = dependency.project.outputs.project_id
|
|
24
|
-
}
|
|
25
|
-
)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// Network for Kubernetes cluster
|
|
2
|
-
locals {
|
|
3
|
-
|
|
4
|
-
shared_vpc_host = true
|
|
5
|
-
network_name = "tribe-network"
|
|
6
|
-
|
|
7
|
-
subnets = [
|
|
8
|
-
{
|
|
9
|
-
subnet_name = "k8s-subnet"
|
|
10
|
-
subnet_ip = "<%- network.k8s_subnet_cidr %>"
|
|
11
|
-
subnet_region = "europe-west1"
|
|
12
|
-
subnet_private_access = true
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
subnet_name = "tribe-resources"
|
|
16
|
-
subnet_ip = "<%- network.tribe_subnet_cidr %>"
|
|
17
|
-
subnet_region = "europe-west1"
|
|
18
|
-
subnet_private_access = true
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
subnet_name = "clan-resources"
|
|
22
|
-
subnet_ip = "<%- network.clan_subnet_cidr %>"
|
|
23
|
-
subnet_region = "europe-west1"
|
|
24
|
-
subnet_private_access = true
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
secondary_ranges = {
|
|
29
|
-
"k8s-subnet" = [
|
|
30
|
-
{
|
|
31
|
-
range_name = "pods-cidr"
|
|
32
|
-
ip_cidr_range = "<%- network.k8s_pods_cidr %>"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
range_name = "services-cidr"
|
|
36
|
-
ip_cidr_range = "<%- network.k8s_services_cidr %>"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
activate_apis:
|
|
2
|
-
- cloudapis.googleapis.com # Google Cloud APIs
|
|
3
|
-
- container.googleapis.com # Kubernetes
|
|
4
|
-
- monitoring.googleapis.com # Stackdriver Monitoring API
|
|
5
|
-
- run.googleapis.com # Cloud Run API
|
|
6
|
-
- storage-api.googleapis.com # Cloud Storage
|
|
7
|
-
- servicenetworking.googleapis.com # Service Networking API
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
terraform {
|
|
2
|
-
source = "git::https://github.com/extenda/tf-module-gcp-project//?ref=v1.1.0"
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
dependency "tribe_folder" {
|
|
6
|
-
config_path = "../../"
|
|
7
|
-
mock_outputs = {
|
|
8
|
-
folder_id = "folder-dummy-id"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
locals {
|
|
13
|
-
tribe_name = basename(dirname(dirname(get_terragrunt_dir())))
|
|
14
|
-
env_name = basename(get_terragrunt_dir())
|
|
15
|
-
name = "${local.tribe_name}-${local.env_name}"
|
|
16
|
-
bucket_name = "tf-state-${local.name}"
|
|
17
|
-
tribe_yaml = yamldecode(file(find_in_parent_folders("tribe.yaml")))
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
include {
|
|
21
|
-
path = find_in_parent_folders("terragrunt_root.hcl")
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
inputs = merge(
|
|
25
|
-
|
|
26
|
-
yamldecode(
|
|
27
|
-
file("${get_terragrunt_dir()}/project.yaml")),
|
|
28
|
-
{
|
|
29
|
-
labels = {
|
|
30
|
-
cc = local.tribe_yaml.costcenter
|
|
31
|
-
tribe = local.tribe_name
|
|
32
|
-
environment = local.env_name
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
name = local.name
|
|
36
|
-
bucket_name = local.bucket_name
|
|
37
|
-
folder_id = dependency.tribe_folder.outputs.folder_id
|
|
38
|
-
env_name = local.env_name
|
|
39
|
-
|
|
40
|
-
project_type = "tribe_project"
|
|
41
|
-
create_ci_cd_service_account = false
|
|
42
|
-
create_cloudrun_service_account = false
|
|
43
|
-
create_service_sa = false
|
|
44
|
-
|
|
45
|
-
clan_gsuite_group = ""
|
|
46
|
-
|
|
47
|
-
bucket_labels = {
|
|
48
|
-
cc = local.tribe_yaml.costcenter
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/bigquery/templates/bigquery/terragrunt.hcl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/cloudsql/templates/mssql/instance/spec.hcl
RENAMED
|
File without changes
|
/package/generators/{resources → common-resources}/cloudsql/templates/mssql/instance/terragrunt.hcl
RENAMED
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/cloudsql/templates/mysql/instance/spec.hcl
RENAMED
|
File without changes
|
/package/generators/{resources → common-resources}/cloudsql/templates/mysql/instance/terragrunt.hcl
RENAMED
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/cloudsql/templates/postgres/instance/spec.hcl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/cloudsql-database/templates/mysql/outputs.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/cloudsql-database/templates/postgres/outputs.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/confluent-cluster/templates/confluent/spec.hcl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/datastore/templates/datastore/indexes.yaml
RENAMED
|
File without changes
|
/package/generators/{resources → common-resources}/datastore/templates/datastore/terragrunt.hcl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/elastic-cloud/templates/elastic/terragrunt.hcl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/elastic-index-policy/templates/policy/policy.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/generators/{resources → common-resources}/firestore/templates/firestore/indexes.yaml
RENAMED
|
File without changes
|
/package/generators/{resources → common-resources}/firestore/templates/firestore/terragrunt.hcl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|