@hiiretail/gcp-infra-cli 0.104.0 → 1.0.1
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/README.md +9 -46
- package/bin/gcp-infra +5 -2
- package/package.json +7 -30
- package/src/gcp-infra.js +90 -0
- package/LICENSE +0 -21
- package/generators/clan-resources/clan-project/generator.json +0 -4
- package/generators/clan-resources/clan-project/index.js +0 -135
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-nat/terragrunt.hcl +0 -52
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-nat-static-ip/spec.hcl +0 -7
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-nat-static-ip/terragrunt.hcl +0 -25
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-router/terragrunt.hcl +0 -34
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/gke-resources/terragrunt.hcl +0 -40
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/spec.hcl +0 -18
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/terragrunt.hcl +0 -52
- package/generators/clan-resources/clan-project/templates/clan-resources/network/firewall-rules/config/main.tf +0 -41
- package/generators/clan-resources/clan-project/templates/clan-resources/network/firewall-rules/config/vars.tf +0 -9
- package/generators/clan-resources/clan-project/templates/clan-resources/network/firewall-rules/terragrunt.hcl +0 -32
- package/generators/clan-resources/clan-project/templates/clan-resources/network/spec.hcl +0 -54
- package/generators/clan-resources/clan-project/templates/clan-resources/network/terragrunt.hcl +0 -29
- package/generators/clan-resources/clan-project/templates/clan-resources/private-vpc-connection/config/main.tf +0 -18
- package/generators/clan-resources/clan-project/templates/clan-resources/private-vpc-connection/config/vars.tf +0 -27
- package/generators/clan-resources/clan-project/templates/clan-resources/private-vpc-connection/terragrunt.hcl +0 -35
- package/generators/clan-resources/clan-project/templates/clan-resources/serverless-vpc-connector/terragrunt.hcl +0 -40
- package/generators/clan-resources/clan-project/templates/clan-resources/terragrunt.hcl +0 -3
- package/generators/clan-resources/command.json +0 -7
- package/generators/common-resources/bigquery/generator.json +0 -4
- package/generators/common-resources/bigquery/index.js +0 -284
- package/generators/common-resources/bigquery/templates/bigquery/spec.hcl +0 -8
- package/generators/common-resources/bigquery/templates/bigquery/terragrunt.hcl +0 -53
- package/generators/common-resources/bigquery/templates/scheduled-queries/terragrunt.hcl +0 -56
- package/generators/common-resources/bigquery/templates/schema/schema.json +0 -14
- package/generators/common-resources/budget/generator.json +0 -4
- package/generators/common-resources/budget/index.js +0 -89
- package/generators/common-resources/budget/templates/budget/terragrunt.hcl +0 -45
- package/generators/common-resources/cloud-armor/generator.json +0 -4
- package/generators/common-resources/cloud-armor/index.js +0 -45
- package/generators/common-resources/cloud-armor/templates/policies.yaml +0 -53
- package/generators/common-resources/cloud-armor/templates/terragrunt.hcl +0 -30
- package/generators/common-resources/cloud-storage/generator.json +0 -4
- package/generators/common-resources/cloud-storage/index.js +0 -156
- package/generators/common-resources/cloud-storage/templates/cloud-storage/storage.yaml +0 -26
- package/generators/common-resources/cloud-storage/templates/cloud-storage/terragrunt.hcl +0 -32
- package/generators/common-resources/cloudsql/generator.json +0 -4
- package/generators/common-resources/cloudsql/index.js +0 -106
- package/generators/common-resources/cloudsql/templates/mssql/instance/spec.hcl +0 -76
- package/generators/common-resources/cloudsql/templates/mssql/instance/terragrunt.hcl +0 -38
- package/generators/common-resources/cloudsql/templates/mssql/instance-secrets/terragrunt.hcl +0 -37
- package/generators/common-resources/cloudsql/templates/mysql/instance/spec.hcl +0 -73
- package/generators/common-resources/cloudsql/templates/mysql/instance/terragrunt.hcl +0 -40
- package/generators/common-resources/cloudsql/templates/mysql/instance-secrets/terragrunt.hcl +0 -38
- package/generators/common-resources/cloudsql/templates/postgres-clan/instance/spec.hcl +0 -102
- package/generators/common-resources/cloudsql/templates/postgres-clan/instance/terragrunt.hcl +0 -36
- package/generators/common-resources/cloudsql/templates/postgres-clan/instance-secrets/terragrunt.hcl +0 -44
- package/generators/common-resources/cloudsql-database/generator.json +0 -4
- package/generators/common-resources/cloudsql-database/index.js +0 -70
- package/generators/common-resources/cloudsql-database/templates/mysql/database/proxy_port.hcl +0 -4
- package/generators/common-resources/cloudsql-database/templates/mysql/database/terragrunt.hcl +0 -69
- package/generators/common-resources/cloudsql-database/templates/mysql/outputs.json +0 -5
- package/generators/common-resources/cloudsql-database/templates/mysql/secrets/terragrunt.hcl +0 -30
- package/generators/common-resources/cloudsql-database/templates/postgres/database/proxy_port.hcl +0 -4
- package/generators/common-resources/cloudsql-database/templates/postgres/database/spec.hcl +0 -17
- package/generators/common-resources/cloudsql-database/templates/postgres/database/terragrunt.hcl +0 -74
- package/generators/common-resources/cloudsql-database/templates/postgres/outputs.json +0 -5
- package/generators/common-resources/cloudsql-database/templates/postgres/secrets/terragrunt.hcl +0 -30
- package/generators/common-resources/command.json +0 -8
- package/generators/common-resources/confluent-cluster/generator.json +0 -4
- package/generators/common-resources/confluent-cluster/index.js +0 -52
- package/generators/common-resources/confluent-cluster/templates/confluent/spec.hcl +0 -5
- package/generators/common-resources/confluent-cluster/templates/confluent/terragrunt.hcl +0 -25
- package/generators/common-resources/datastore/generator.json +0 -4
- package/generators/common-resources/datastore/index.js +0 -91
- package/generators/common-resources/datastore/templates/datastore/indexes.yaml +0 -6
- package/generators/common-resources/datastore/templates/datastore/terragrunt.hcl +0 -23
- package/generators/common-resources/elastic-cloud/generator.json +0 -4
- package/generators/common-resources/elastic-cloud/index.js +0 -52
- package/generators/common-resources/elastic-cloud/templates/elastic/spec.hcl +0 -27
- package/generators/common-resources/elastic-cloud/templates/elastic/terragrunt.hcl +0 -27
- package/generators/common-resources/elastic-index-policy/generator.json +0 -4
- package/generators/common-resources/elastic-index-policy/handle-yaml.js +0 -76
- package/generators/common-resources/elastic-index-policy/index.js +0 -210
- package/generators/common-resources/elastic-index-policy/templates/policy/policy.yaml +0 -28
- package/generators/common-resources/elastic-index-policy/templates/policy/terragrunt.hcl +0 -25
- package/generators/common-resources/elastic-template/generator.json +0 -4
- package/generators/common-resources/elastic-template/index.js +0 -84
- package/generators/common-resources/elastic-template/templates/elastic-template/mappings.json +0 -1
- package/generators/common-resources/elastic-template/templates/elastic-template/terragrunt.hcl +0 -35
- package/generators/common-resources/firestore/generator.json +0 -4
- package/generators/common-resources/firestore/index.js +0 -141
- package/generators/common-resources/firestore/templates/firestore/indexes/indexes.yaml +0 -12
- package/generators/common-resources/firestore/templates/firestore/indexes/terragrunt.hcl +0 -27
- package/generators/common-resources/firestore/templates/firestore/spec.hcl +0 -31
- package/generators/common-resources/firestore/templates/firestore/terragrunt.hcl +0 -25
- package/generators/common-resources/iam/generator.json +0 -4
- package/generators/common-resources/iam/index.js +0 -62
- package/generators/common-resources/iam/templates/github/workflows/iam.yml +0 -18
- package/generators/common-resources/iam/templates/iam.yaml +0 -8
- package/generators/common-resources/iam/valid-prefix.js +0 -8
- package/generators/common-resources/kafka-connect/generator.json +0 -4
- package/generators/common-resources/kafka-connect/index.js +0 -75
- package/generators/common-resources/kafka-connect/templates/elastic/terragrunt.hcl +0 -92
- package/generators/common-resources/kafka-connect/templates/pubsub/terragrunt.hcl +0 -75
- package/generators/common-resources/kafka-topics/generator.json +0 -4
- package/generators/common-resources/kafka-topics/index.js +0 -54
- package/generators/common-resources/kafka-topics/templates/kafka/kafka.yaml +0 -20
- package/generators/common-resources/kafka-topics/templates/kafka/terragrunt.hcl +0 -21
- package/generators/common-resources/kms/generator.json +0 -4
- package/generators/common-resources/kms/index.js +0 -69
- package/generators/common-resources/kms/templates/kms/spec.hcl +0 -5
- package/generators/common-resources/kms/templates/kms/terragrunt.hcl +0 -33
- package/generators/common-resources/memorystore/generator.json +0 -4
- package/generators/common-resources/memorystore/index.js +0 -69
- package/generators/common-resources/memorystore/templates/outputs.json +0 -3
- package/generators/common-resources/memorystore/templates/redis-instance/spec.hcl +0 -16
- package/generators/common-resources/memorystore/templates/redis-instance/terragrunt.hcl +0 -35
- package/generators/common-resources/memorystore/templates/secrets/terragrunt.hcl +0 -31
- package/generators/common-resources/monitoring/generator.json +0 -4
- package/generators/common-resources/monitoring/handle-yaml.js +0 -48
- package/generators/common-resources/monitoring/index.js +0 -192
- package/generators/common-resources/monitoring/templates/alerts/generic-infra.yaml +0 -633
- package/generators/common-resources/monitoring/templates/alerts/terragrunt.hcl +0 -37
- package/generators/common-resources/monitoring/templates/service/service.yaml +0 -16
- package/generators/common-resources/monitoring/templates/service/terragrunt.hcl +0 -37
- package/generators/common-resources/monitoring/templates/uptime-checks/terragrunt.hcl +0 -36
- package/generators/common-resources/monitoring/templates/uptime-checks/uptime-checks.yaml +0 -3
- package/generators/common-resources/monitoring/validate.js +0 -58
- package/generators/common-resources/pubsub/append.js +0 -120
- package/generators/common-resources/pubsub/generator.json +0 -4
- package/generators/common-resources/pubsub/get-gcp-projects.js +0 -34
- package/generators/common-resources/pubsub/handle-subscribers.js +0 -63
- package/generators/common-resources/pubsub/index.js +0 -316
- package/generators/common-resources/pubsub/templates/pubsub/spec.hcl +0 -7
- package/generators/common-resources/pubsub/templates/pubsub/subscribers.yaml +0 -16
- package/generators/common-resources/pubsub/templates/pubsub/terragrunt.hcl +0 -34
- package/generators/common-resources/pubsub/templates/pubsub-dlq/terragrunt.hcl +0 -42
- package/generators/common-resources/pubsub/templates/pubsub-external/spec.hcl +0 -10
- package/generators/common-resources/pubsub/templates/pubsub-external/subscribers.yaml +0 -16
- package/generators/common-resources/pubsub/templates/pubsub-external/terragrunt.hcl +0 -31
- package/generators/common-resources/pubsub/validate.js +0 -44
- package/generators/common-resources/scheduler/append.js +0 -83
- package/generators/common-resources/scheduler/generator.json +0 -4
- package/generators/common-resources/scheduler/index.js +0 -103
- package/generators/common-resources/scheduler/templates/scheduler/terragrunt.hcl +0 -44
- package/generators/common-resources/spanner/append.js +0 -27
- package/generators/common-resources/spanner/generator.json +0 -4
- package/generators/common-resources/spanner/index.js +0 -169
- package/generators/common-resources/spanner/templates/spanner/databases.yaml +0 -5
- package/generators/common-resources/spanner/templates/spanner/spec.hcl +0 -22
- package/generators/common-resources/spanner/templates/spanner/terragrunt.hcl +0 -33
- package/generators/common-resources/spanner/validate.js +0 -38
- package/generators/docs/command.json +0 -7
- package/generators/docs/rca/generator.json +0 -4
- package/generators/docs/rca/index.js +0 -50
- package/generators/docs/rca/templates/docs/rca_external.md +0 -43
- package/generators/docs/rca/templates/docs/rca_internal.md +0 -88
- package/generators/docs/runbook/generator.json +0 -4
- package/generators/docs/runbook/index.js +0 -42
- package/generators/docs/runbook/templates/docs/runbook.md +0 -106
- package/generators/docs/srb/generator.json +0 -4
- package/generators/docs/srb/index.js +0 -62
- package/generators/docs/srb/templates/docs/README.md +0 -42
- package/generators/docs/srb/templates/docs/adr.cmd +0 -3
- package/generators/docs/srb/templates/docs/adr.sh +0 -4
- package/generators/docs/srb/templates/docs/architecture.md +0 -68
- package/generators/docs/srb/templates/docs/cost-estimates.md +0 -39
- package/generators/docs/srb/templates/docs/dsl2png.cmd +0 -3
- package/generators/docs/srb/templates/docs/dsl2png.sh +0 -4
- package/generators/docs/srb/templates/docs/sre.md +0 -43
- package/generators/docs/srb/templates/sample.dsl +0 -36
- package/generators/init/clan-infra/gcp-projects.js +0 -36
- package/generators/init/clan-infra/generator.json +0 -4
- package/generators/init/clan-infra/index.js +0 -170
- package/generators/init/clan-infra/templates/.yamllint +0 -17
- package/generators/init/clan-infra/templates/env/project.hcl +0 -15
- package/generators/init/clan-infra/templates/env/secrets/secrets.yaml +0 -4
- package/generators/init/clan-infra/templates/env/secrets/terragrunt.hcl +0 -31
- package/generators/init/clan-infra/templates/github/CODEOWNERS +0 -1
- package/generators/init/clan-infra/templates/github/workflows/infra-verify.yml +0 -16
- package/generators/init/clan-infra/templates/github/workflows/infra.yml +0 -17
- package/generators/init/clan-infra/templates/github/workflows/release-notes.yml +0 -33
- package/generators/init/clan-infra/templates/github/workflows/sync-docs.yml +0 -29
- package/generators/init/clan-infra/templates/infra/.terraform-version +0 -1
- package/generators/init/clan-infra/templates/infra/.terragrunt-version +0 -1
- package/generators/init/clan-infra/templates/infra/README.md +0 -5
- package/generators/init/clan-infra/templates/infra/common.hcl +0 -24
- package/generators/init/clan-infra/templates/infra/terragrunt_root.hcl +0 -44
- package/generators/init/clan-infra/templates/notification-channels/notification-channels.yaml +0 -7
- package/generators/init/clan-infra/templates/notification-channels/terragrunt.hcl +0 -29
- package/generators/init/clan-infra/templates/release-notes/example-service.yaml +0 -23
- package/generators/init/clan-infra/templates/release-notes-schema/release-notes.schema.json +0 -63
- package/generators/init/clan-infra/tribe-clan-repo.js +0 -38
- package/generators/init/clan-infra/validate.js +0 -8
- package/generators/init/command.json +0 -7
- package/generators/maintenance/command.json +0 -7
- package/generators/maintenance/manage-states/generator.json +0 -4
- package/generators/maintenance/manage-states/index.js +0 -188
- package/generators/maintenance/update-modules/generator.json +0 -4
- package/generators/maintenance/update-modules/index.js +0 -102
- package/generators/organization/clan-project/__tests__/__snapshots__/googlecloud.test.js.snap +0 -27
- package/generators/organization/clan-project/generator.json +0 -4
- package/generators/organization/clan-project/googlecloud.js +0 -119
- package/generators/organization/clan-project/index.js +0 -139
- package/generators/organization/clan-project/templates/clan/clan.yaml +0 -22
- package/generators/organization/clan-project/templates/clan/terragrunt.hcl +0 -39
- package/generators/organization/clan-project/templates/clan-project/project.yaml +0 -14
- package/generators/organization/clan-project/templates/clan-project/terragrunt.hcl +0 -51
- package/generators/organization/clan-project/templates/clans-folder/terragrunt.hcl +0 -3
- package/generators/organization/clan-project/templates/department/terragrunt.hcl +0 -32
- package/generators/organization/clan-project/templates/tribe/terragrunt.hcl +0 -67
- package/generators/organization/clan-project/templates/tribe/tribe.yaml +0 -19
- package/generators/organization/command.json +0 -8
- package/src/BaseGenerator.js +0 -73
- package/src/SecretsGenerator.js +0 -105
- package/src/cli.js +0 -73
- package/src/dependency-check.js +0 -48
- package/src/update-check.js +0 -30
- package/src/validators.js +0 -32
- package/src/yeoman.js +0 -71
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
2
|
-
const { required } = require('../../../src/validators');
|
|
3
|
-
const BaseGenerator = require('../../../src/BaseGenerator');
|
|
4
|
-
const validPrefix = require('./valid-prefix');
|
|
5
|
-
|
|
6
|
-
module.exports = class extends BaseGenerator {
|
|
7
|
-
prompting() {
|
|
8
|
-
const prompts = [
|
|
9
|
-
{
|
|
10
|
-
type: 'input',
|
|
11
|
-
name: 'systemName',
|
|
12
|
-
message: 'System name',
|
|
13
|
-
validate: required,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: 'input',
|
|
17
|
-
name: 'permissionPrefix',
|
|
18
|
-
message: 'Permission prefix',
|
|
19
|
-
transform: (input) => input.toLowerCase(),
|
|
20
|
-
validate: (input) => required(input) && validPrefix(input),
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: 'input',
|
|
24
|
-
name: 'serviceName',
|
|
25
|
-
message: 'Cloud Run service name',
|
|
26
|
-
validate: required,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
type: 'input',
|
|
30
|
-
name: 'repository',
|
|
31
|
-
message: 'Git repository name',
|
|
32
|
-
validate: required,
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
return this.prompt(prompts).then((props) => {
|
|
37
|
-
this.answers = props;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
writing() {
|
|
42
|
-
const { permissionPrefix } = this.answers;
|
|
43
|
-
|
|
44
|
-
this.fs.copy(
|
|
45
|
-
this.templatePath('github', 'workflows', 'iam.yml'),
|
|
46
|
-
this.destinationPath('.github', 'workflows', 'iam.yml'),
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
this.fs.copyTpl(
|
|
50
|
-
this.templatePath('iam.yaml'),
|
|
51
|
-
this.destinationPath('iam', `${permissionPrefix}.yaml`),
|
|
52
|
-
this.answers,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
end() {
|
|
57
|
-
this.log(`
|
|
58
|
-
${chalk.green('Your IAM resources have now been created.')}
|
|
59
|
-
${chalk.green('1.')} Modify the IAM YAML file to define permissions and roles.\`);
|
|
60
|
-
${chalk.green('2.')} Push this change in a feature branch and open a pull request.`);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
name: iam
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
paths: iam/**
|
|
5
|
-
|
|
6
|
-
jobs:
|
|
7
|
-
process-iam:
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
steps:
|
|
10
|
-
- uses: actions/checkout@v2
|
|
11
|
-
|
|
12
|
-
- name: Process IAM
|
|
13
|
-
uses: extenda/actions/iam@v0
|
|
14
|
-
with:
|
|
15
|
-
service-account-key: ${{ secrets.SECRET_AUTH }}
|
|
16
|
-
service-account-key-staging: ${{ secrets.GCLOUD_AUTH_STAGING }}
|
|
17
|
-
service-account-key-prod: ${{ secrets.GCLOUD_AUTH_PROD }}
|
|
18
|
-
dry-run: ${{ github.ref != 'refs/heads/master' }}
|
|
@@ -1,75 +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
|
-
prompting() {
|
|
8
|
-
const prompts = [
|
|
9
|
-
{
|
|
10
|
-
type: 'list',
|
|
11
|
-
name: 'connectionClass',
|
|
12
|
-
message: 'Connection type (connector.class):',
|
|
13
|
-
default: 'ElasticsearchSink',
|
|
14
|
-
choices: ['ElasticsearchSink', 'PubSubSource'],
|
|
15
|
-
validate: required,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
type: 'input',
|
|
19
|
-
name: 'connectionName',
|
|
20
|
-
message: 'Connection name:',
|
|
21
|
-
validate: required,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
type: 'input',
|
|
25
|
-
name: 'topicName',
|
|
26
|
-
message: 'Kafka Topic:',
|
|
27
|
-
validate: required,
|
|
28
|
-
},
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
return this.prompt(prompts).then((props) => {
|
|
32
|
-
this.answers = props;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
writing() {
|
|
37
|
-
const {
|
|
38
|
-
connectionName,
|
|
39
|
-
connectionClass,
|
|
40
|
-
} = this.answers;
|
|
41
|
-
|
|
42
|
-
const templateMap = {
|
|
43
|
-
ElasticsearchSink: 'elastic',
|
|
44
|
-
PubSubSource: 'pubsub',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
['prod', 'staging'].forEach((env) => {
|
|
48
|
-
this.copyDir(
|
|
49
|
-
templateMap[connectionClass],
|
|
50
|
-
path.join('infra', env, 'kafka-connect', connectionName),
|
|
51
|
-
{
|
|
52
|
-
...this.answers,
|
|
53
|
-
env,
|
|
54
|
-
connectionName,
|
|
55
|
-
},
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
end() {
|
|
61
|
-
const {
|
|
62
|
-
connectionName,
|
|
63
|
-
} = this.answers;
|
|
64
|
-
|
|
65
|
-
const connectionDir = path.join(connectionName);
|
|
66
|
-
this.log(`
|
|
67
|
-
${chalk.green(`Your Kafka connection have now been created. To finalize your configuration, please continue
|
|
68
|
-
with manual editing of the generated files.`)}
|
|
69
|
-
${chalk.green('1.')} Review and fill other parameters.
|
|
70
|
-
\u2192 ${chalk.cyan(path.join(connectionDir, 'terragrunt.hcl'))}
|
|
71
|
-
${chalk.green('2.')} Make sure that the different projects are used in configuration for staging and prod in pubsub source connection.
|
|
72
|
-
${chalk.green('3.')} Push this change in a feature branch and open a pull request.
|
|
73
|
-
`);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
@@ -1,92 +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 = "git::https://github.com/extenda/tf-module-kafka//kafka-connect-ccloud?ref=v1.0.0"
|
|
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 "confluent" {
|
|
13
|
-
config_path = "../../confluent"
|
|
14
|
-
mock_outputs = {
|
|
15
|
-
environment_id = "dummy-environment"
|
|
16
|
-
cluster_id = "dummy-cluster"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
dependency "kafka" {
|
|
21
|
-
config_path = "../../kafka"
|
|
22
|
-
mock_outputs = {
|
|
23
|
-
key = "dummy-key"
|
|
24
|
-
secret = "dummy-secret"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
dependency "elastic" {
|
|
29
|
-
config_path = "../../elastic"
|
|
30
|
-
mock_outputs = {
|
|
31
|
-
elasticsearch_username = "dummy-username"
|
|
32
|
-
elasticsearch_password = "dummy-password"
|
|
33
|
-
elasticsearch_https_endpoint = "dummy-url"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# These are the variables we have to pass in to use the module specified in the terragrunt configuration above
|
|
39
|
-
inputs = {
|
|
40
|
-
confluent_environment = dependency.confluent.outputs.environment_id
|
|
41
|
-
confluent_cluster = dependency.confluent.outputs.cluster_id
|
|
42
|
-
|
|
43
|
-
connection_config = {
|
|
44
|
-
"name": "<%-connectionName%>"
|
|
45
|
-
"topics": "<%-topicName%>",
|
|
46
|
-
"connector.class": "ElasticsearchSink",
|
|
47
|
-
|
|
48
|
-
# Input format: 'AVRO', 'JSON', 'JSON_SF', 'PROTOBUF'
|
|
49
|
-
"input.data.format": "AVRO",
|
|
50
|
-
|
|
51
|
-
# Elasticsearch connection URL, uses terragrunt dependency output here
|
|
52
|
-
"connection.url": dependency.elastic.outputs.elasticsearch_https_endpoint,
|
|
53
|
-
|
|
54
|
-
# Elasticsearch data type name
|
|
55
|
-
"type.name": "<%-topicName%>",
|
|
56
|
-
|
|
57
|
-
# Key Ignore
|
|
58
|
-
"key.ignore": "false",
|
|
59
|
-
|
|
60
|
-
# Schema ignore
|
|
61
|
-
"schema.ignore": "true",
|
|
62
|
-
|
|
63
|
-
# Compact map entries
|
|
64
|
-
"compact.map.entries": "true",
|
|
65
|
-
|
|
66
|
-
# Behaviour on null values: 'delete', 'fail', 'ignore'
|
|
67
|
-
"behavior.on.null.values": "delete",
|
|
68
|
-
|
|
69
|
-
# Drop invalid message
|
|
70
|
-
"drop.invalid.message": "false",
|
|
71
|
-
|
|
72
|
-
# Auto create indices at start
|
|
73
|
-
"auto.create.indices.at.start": "true",
|
|
74
|
-
|
|
75
|
-
# Number of tasks for this connector
|
|
76
|
-
"tasks.max": "1",
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
connection_sensitive_config = {
|
|
80
|
-
# Kafka API key, uses terragrunt dependency output here
|
|
81
|
-
"kafka.api.key": dependency.kafka.outputs.key,
|
|
82
|
-
|
|
83
|
-
# Kafka API secret, uses terragrunt dependency output here
|
|
84
|
-
"kafka.api.secret": dependency.kafka.outputs.secret,
|
|
85
|
-
|
|
86
|
-
# Elasticsearch connection user, uses terragrunt dependency output here
|
|
87
|
-
"connection.username": dependency.elastic.outputs.elasticsearch_username,
|
|
88
|
-
|
|
89
|
-
# Elasticsearch connection password, uses terragrunt dependency output here
|
|
90
|
-
"connection.password": dependency.elastic.outputs.elasticsearch_password,
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,75 +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 = "git::https://github.com/extenda/tf-module-kafka//kafka-connect-ccloud?ref=v1.0.0"
|
|
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 "confluent" {
|
|
13
|
-
config_path = "../../confluent"
|
|
14
|
-
mock_outputs = {
|
|
15
|
-
environment_id = "dummy-environment"
|
|
16
|
-
cluster_id = "dummy-cluster"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
dependency "kafka" {
|
|
21
|
-
config_path = "../../kafka"
|
|
22
|
-
mock_outputs = {
|
|
23
|
-
key = "dummy-key"
|
|
24
|
-
secret = "dummy-secret"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
locals {
|
|
29
|
-
project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
# These are the variables we have to pass in to use the module specified in the terragrunt configuration above
|
|
33
|
-
inputs = {
|
|
34
|
-
confluent_environment = dependency.confluent.outputs.environment_id
|
|
35
|
-
confluent_cluster = dependency.confluent.outputs.cluster_id
|
|
36
|
-
|
|
37
|
-
connection_config = {
|
|
38
|
-
"name": "<%-connectionName%>",
|
|
39
|
-
"connector.class": "PubSubSource",
|
|
40
|
-
"kafka.topic": "<%-topicName%>",
|
|
41
|
-
|
|
42
|
-
# GCP Pub/Sub Project ID
|
|
43
|
-
"gcp.pubsub.project.id": "CHANGEME",
|
|
44
|
-
|
|
45
|
-
# GCP Pub/Sub Topic ID
|
|
46
|
-
"gcp.pubsub.topic.id": "CHANGEME",
|
|
47
|
-
|
|
48
|
-
# GCP Pub/Sub Subscription ID
|
|
49
|
-
"gcp.pubsub.subscription.id": "CHANGEME",
|
|
50
|
-
|
|
51
|
-
# Maximum number of messages to be polled in a request
|
|
52
|
-
"gcp.pubsub.message.max.count": "10000",
|
|
53
|
-
|
|
54
|
-
# Maximum time in seconds to retry on errors
|
|
55
|
-
"gcp.pubsub.max.retry.time": "5",
|
|
56
|
-
|
|
57
|
-
# Number of tasks for this connector
|
|
58
|
-
"tasks.max": "1",
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
connection_sensitive_config = {
|
|
62
|
-
# Kafka API key, uses terragrunt dependency output here
|
|
63
|
-
"kafka.api.key": dependency.kafka.outputs.key,
|
|
64
|
-
|
|
65
|
-
# Kafka API secret, uses terragrunt dependency output here
|
|
66
|
-
"kafka.api.secret": dependency.kafka.outputs.secret,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
connection_gcp_secret_project = local.project_vars.locals.project_id
|
|
70
|
-
|
|
71
|
-
connection_gcp_secret_config = {
|
|
72
|
-
# GCP Servive account key
|
|
73
|
-
"gcp.pubsub.credentials.json": "pnp-kafka-connect-bum-sa",
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,54 +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
|
-
prompting() {
|
|
8
|
-
const prompts = [
|
|
9
|
-
{
|
|
10
|
-
type: 'input',
|
|
11
|
-
name: 'topicName',
|
|
12
|
-
message: 'Please provide the Kafka topic name',
|
|
13
|
-
validate: required,
|
|
14
|
-
},
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
return this.prompt(prompts).then((props) => {
|
|
18
|
-
this.answers = props;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
writing() {
|
|
23
|
-
const {
|
|
24
|
-
topicName,
|
|
25
|
-
} = this.answers;
|
|
26
|
-
|
|
27
|
-
['prod', 'staging'].forEach((env) => {
|
|
28
|
-
this.copyDir(
|
|
29
|
-
'kafka',
|
|
30
|
-
path.join('infra', env, 'kafka'),
|
|
31
|
-
{
|
|
32
|
-
...this.answers,
|
|
33
|
-
env,
|
|
34
|
-
topicName,
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
end() {
|
|
41
|
-
const {
|
|
42
|
-
topicName,
|
|
43
|
-
} = this.answers;
|
|
44
|
-
|
|
45
|
-
const kafkaDir = path.join(topicName);
|
|
46
|
-
this.log(`
|
|
47
|
-
${chalk.green(`Your Kafka topic have now been created. To finalize your configuration, please continue
|
|
48
|
-
with manual editing of the generated files.`)}
|
|
49
|
-
${chalk.green('1.')} Review and add more subscribers if needed.
|
|
50
|
-
\u2192 ${chalk.cyan(path.join(kafkaDir, 'kafka.yaml'))}
|
|
51
|
-
${chalk.green('2.')} Push this change in a feature branch and open a pull request.
|
|
52
|
-
`);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
topics:
|
|
2
|
-
- name: <%-topicName%>
|
|
3
|
-
replication_factor: 3
|
|
4
|
-
partitions: 1
|
|
5
|
-
config:
|
|
6
|
-
segment.ms: 600000
|
|
7
|
-
cleanup.policy: compact
|
|
8
|
-
|
|
9
|
-
# See https://registry.terraform.io/providers/Mongey/kafka/latest/docs/resources/topic for syntax details
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
acls:
|
|
13
|
-
- resource_name: <%-topicName%>
|
|
14
|
-
resource_type: Topic
|
|
15
|
-
acl_principal: User:Alice
|
|
16
|
-
acl_host: "*"
|
|
17
|
-
acl_operation: Write
|
|
18
|
-
acl_permission_type: Deny
|
|
19
|
-
|
|
20
|
-
# See https://registry.terraform.io/providers/Mongey/kafka/latest/docs/resources/acl for syntax details
|
|
@@ -1,21 +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 = "git::https://github.com/extenda/tf-module-kafka//?ref=v0.1.0"
|
|
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
|
-
locals {
|
|
13
|
-
project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
# These are the variables we have to pass in to use the module specified in the terragrunt configuration above
|
|
17
|
-
inputs = merge(
|
|
18
|
-
yamldecode(
|
|
19
|
-
file("${get_terragrunt_dir()}/kafka.yaml")),
|
|
20
|
-
local.project_vars.locals,
|
|
21
|
-
)
|
|
@@ -1,69 +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
|
-
prompting() {
|
|
8
|
-
const prompts = [
|
|
9
|
-
{
|
|
10
|
-
type: 'input',
|
|
11
|
-
name: 'keyRing',
|
|
12
|
-
message: 'Please provide the name of the key ring',
|
|
13
|
-
validate: required,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: 'input',
|
|
17
|
-
name: 'location',
|
|
18
|
-
message: 'Please provide the location for the key ring',
|
|
19
|
-
default: 'europe-west1',
|
|
20
|
-
validate: required,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: 'input',
|
|
24
|
-
name: 'keys',
|
|
25
|
-
message: 'Please provide the first key in the key ring',
|
|
26
|
-
validate: required,
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
return this.prompt(prompts).then((props) => {
|
|
31
|
-
this.answers = props;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
writing() {
|
|
36
|
-
const {
|
|
37
|
-
keyRing,
|
|
38
|
-
location,
|
|
39
|
-
keys,
|
|
40
|
-
} = this.answers;
|
|
41
|
-
|
|
42
|
-
['prod', 'staging'].forEach((env) => {
|
|
43
|
-
this.copyDir(
|
|
44
|
-
'kms',
|
|
45
|
-
path.join('infra', env, 'kms'),
|
|
46
|
-
{
|
|
47
|
-
...this.answers,
|
|
48
|
-
env,
|
|
49
|
-
keyRing,
|
|
50
|
-
location,
|
|
51
|
-
keys,
|
|
52
|
-
},
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
end() {
|
|
58
|
-
const specStageFile = path.join('infra', 'staging', 'kms');
|
|
59
|
-
const specProdFile = path.join('infra', 'prod', 'kms');
|
|
60
|
-
this.log(`
|
|
61
|
-
${chalk.green(`Your KMS resources have now been created. To finalize your configuration, please continue
|
|
62
|
-
with manual editing of the generated files.`)}
|
|
63
|
-
${chalk.green('1.')} Review KMS configurations:
|
|
64
|
-
\u2192 ${chalk.cyan(path.join(specStageFile, 'spec.hcl'))}
|
|
65
|
-
\u2192 ${chalk.cyan(path.join(specProdFile, 'spec.hcl'))}
|
|
66
|
-
${chalk.green('2.')} Push this change in a feature branch and open a pull request.
|
|
67
|
-
`);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
@@ -1,33 +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 = "git::https://github.com/terraform-google-modules/terraform-google-kms//?ref=v2.3.0"
|
|
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
|
-
locals {
|
|
13
|
-
spec_vars = read_terragrunt_config("${get_terragrunt_dir()}/spec.hcl")
|
|
14
|
-
project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
|
|
15
|
-
common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl"))
|
|
16
|
-
labels = merge(local.common_vars.locals.default_user_labels, local.project_vars.locals.default_user_labels, {
|
|
17
|
-
component = local.common_vars.locals.component
|
|
18
|
-
product = local.common_vars.locals.product
|
|
19
|
-
tenant-alias = local.common_vars.locals.tenant_alias
|
|
20
|
-
terraform = ""
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
# These are the variables we have to pass in to use the module specified in the terragrunt configuration above
|
|
25
|
-
inputs = merge(
|
|
26
|
-
local.spec_vars.locals,
|
|
27
|
-
local.project_vars.locals,
|
|
28
|
-
{
|
|
29
|
-
labels = local.labels
|
|
30
|
-
project_id = local.project_vars.locals.project_id
|
|
31
|
-
prevent_destroy = false
|
|
32
|
-
}
|
|
33
|
-
)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const SecretsGenerator = require('../../../src/SecretsGenerator');
|
|
3
|
-
const getTribeAndClanName = require('../../init/clan-infra/tribe-clan-repo');
|
|
4
|
-
|
|
5
|
-
module.exports = class extends SecretsGenerator {
|
|
6
|
-
prompting() {
|
|
7
|
-
const choices = [
|
|
8
|
-
{
|
|
9
|
-
name: 'BASIC - standalone instance',
|
|
10
|
-
value: 'BASIC',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'STANDARD_HA - highly available primary/replica instances',
|
|
14
|
-
value: 'STANDARD_HA',
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
const prompts = [
|
|
19
|
-
{
|
|
20
|
-
type: 'input',
|
|
21
|
-
name: 'name',
|
|
22
|
-
default: getTribeAndClanName().clan,
|
|
23
|
-
message: 'Enter your service name or leave blank for common instance',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'list',
|
|
27
|
-
name: 'stagingTier',
|
|
28
|
-
default: 'BASIC',
|
|
29
|
-
message: 'Select the service tier for the staging environment',
|
|
30
|
-
choices,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
type: 'list',
|
|
34
|
-
name: 'prodTier',
|
|
35
|
-
default: 'STANDARD_HA',
|
|
36
|
-
message: 'Select the service tier for the production environment',
|
|
37
|
-
choices,
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
return this.prompt(prompts).then((props) => {
|
|
42
|
-
this.answers = props;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
writing() {
|
|
47
|
-
const {
|
|
48
|
-
name,
|
|
49
|
-
stagingTier,
|
|
50
|
-
prodTier,
|
|
51
|
-
} = this.answers;
|
|
52
|
-
|
|
53
|
-
const selectTier = (env, tier) => {
|
|
54
|
-
this.copyDir(
|
|
55
|
-
'redis-instance',
|
|
56
|
-
path.join('infra', env, 'memorystore', name === '' ? 'redis-instance' : name),
|
|
57
|
-
{
|
|
58
|
-
env,
|
|
59
|
-
tier,
|
|
60
|
-
},
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
selectTier('prod', prodTier);
|
|
65
|
-
selectTier('staging', stagingTier);
|
|
66
|
-
|
|
67
|
-
this.writeSecrets('memorystore', '', '', name === '' ? 'redis-instance' : name);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
locals {
|
|
2
|
-
tier = "<%-tier%>"
|
|
3
|
-
connect_mode = "PRIVATE_SERVICE_ACCESS"
|
|
4
|
-
memory_size_gb = "1" # memory size in GiB
|
|
5
|
-
read_replicas_mode = "READ_REPLICAS_DISABLED"
|
|
6
|
-
transit_encryption_mode = "DISABLED"
|
|
7
|
-
maintenance_policy = {
|
|
8
|
-
day = "MONDAY"
|
|
9
|
-
start_time = {
|
|
10
|
-
hours = 0
|
|
11
|
-
minutes = 0
|
|
12
|
-
seconds = 0
|
|
13
|
-
nanos = 0
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|