@goldstack/infra-aws 0.3.30 → 0.3.34
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/dist/src/awsUserUtils.d.ts +10 -0
- package/dist/src/awsUserUtils.d.ts.map +1 -0
- package/dist/src/awsUserUtils.js +152 -0
- package/dist/src/awsUserUtils.js.map +1 -0
- package/dist/src/infraAws.d.ts +18 -17
- package/dist/src/infraAws.d.ts.map +1 -1
- package/dist/src/infraAws.js +111 -191
- package/dist/src/infraAws.js.map +1 -1
- package/dist/src/infraAws.spec.d.ts +1 -1
- package/dist/src/infraAws.spec.js +85 -40
- package/dist/src/infraAws.spec.js.map +1 -1
- package/dist/src/schemas/accountConfigSchema.json +223 -207
- package/dist/src/schemas/awsTerraformStateSchema.json +57 -57
- package/dist/src/schemas/deploymentConfigSchema.json +73 -73
- package/dist/src/types/awsAccount.d.ts +125 -112
- package/dist/src/types/awsAccount.d.ts.map +1 -1
- package/dist/src/types/awsAccount.js +2 -2
- package/dist/src/types/awsDeployment.d.ts +17 -17
- package/dist/src/types/awsDeployment.js +2 -2
- package/dist/src/types/awsTerraformState.d.ts +24 -24
- package/dist/src/types/awsTerraformState.js +2 -2
- package/package.json +7 -7
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const infraAws_1 = require("./infraAws");
|
|
7
|
-
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
8
|
-
const assert_1 = __importDefault(require("assert"));
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const infraAws_1 = require("./infraAws");
|
|
7
|
+
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
8
|
+
const assert_1 = __importDefault(require("assert"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
describe('AWS User config', () => {
|
|
11
|
+
it.skip('Should read AWS config from Goldstack config file', async () => {
|
|
11
12
|
const awsConfig = `{
|
|
12
13
|
"users": [
|
|
13
14
|
{
|
|
@@ -29,47 +30,91 @@ describe('AWS User config', () => {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
]
|
|
32
|
-
}`;
|
|
33
|
-
const testDir = './goldstackLocal/tests/getAWSUser';
|
|
34
|
-
(0, utils_sh_1.mkdir)('-p', testDir);
|
|
35
|
-
(0, utils_sh_1.write)(awsConfig, testDir + '/config-embedded.json');
|
|
36
|
-
const credentialsDev = await (0, infraAws_1.getAWSUser)('goldstack-dev', testDir + '/config-embedded.json');
|
|
37
|
-
(0, assert_1.default)(credentialsDev.accessKeyId === 'dummy');
|
|
38
|
-
const credentialsProd = await (0, infraAws_1.getAWSUser)('goldstack-prod', testDir + '/config-embedded.json');
|
|
39
|
-
(0, assert_1.default)(credentialsProd.accessKeyId === 'dummy-prod');
|
|
40
|
-
});
|
|
41
|
-
// problems when initialising AWS config more than once, so leaving this as one test for now
|
|
42
|
-
// following difficult to test
|
|
43
|
-
it.skip('Should read from AWS config in user folder if no config provided', async () => {
|
|
44
|
-
const credentials = await (0, infraAws_1.getAWSUser)('default', './invalid');
|
|
45
|
-
(0, assert_1.default)(credentials.accessKeyId);
|
|
46
|
-
});
|
|
47
|
-
it
|
|
48
|
-
const testDir = './goldstackLocal/tests/getAWSUser';
|
|
33
|
+
}`;
|
|
34
|
+
const testDir = './goldstackLocal/tests/getAWSUser';
|
|
35
|
+
(0, utils_sh_1.mkdir)('-p', testDir);
|
|
36
|
+
(0, utils_sh_1.write)(awsConfig, testDir + '/config-embedded.json');
|
|
37
|
+
const credentialsDev = await (0, infraAws_1.getAWSUser)('goldstack-dev', testDir + '/config-embedded.json');
|
|
38
|
+
(0, assert_1.default)(credentialsDev.accessKeyId === 'dummy');
|
|
39
|
+
const credentialsProd = await (0, infraAws_1.getAWSUser)('goldstack-prod', testDir + '/config-embedded.json');
|
|
40
|
+
(0, assert_1.default)(credentialsProd.accessKeyId === 'dummy-prod');
|
|
41
|
+
});
|
|
42
|
+
// problems when initialising AWS config more than once, so leaving this as one test for now
|
|
43
|
+
// following difficult to test
|
|
44
|
+
it.skip('Should read from AWS config in user folder if no config provided', async () => {
|
|
45
|
+
const credentials = await (0, infraAws_1.getAWSUser)('default', './invalid');
|
|
46
|
+
(0, assert_1.default)(credentials.accessKeyId);
|
|
47
|
+
});
|
|
48
|
+
it('Should read from AWS credentials file', async () => {
|
|
49
|
+
const testDir = './goldstackLocal/tests/getAWSUser';
|
|
49
50
|
const awsConfig = `{
|
|
50
51
|
"users": [
|
|
51
52
|
{
|
|
52
53
|
"name": "dev",
|
|
53
54
|
"type": "profile",
|
|
54
55
|
"config": {
|
|
55
|
-
"profile": "
|
|
56
|
-
"awsDefaultRegion": "us-west-2"
|
|
56
|
+
"profile": "goldstack-dev",
|
|
57
|
+
"awsDefaultRegion": "us-west-2",
|
|
58
|
+
"awsCredentialsFileName": "${path_1.default
|
|
59
|
+
.resolve('./testData/awsCredentials')
|
|
60
|
+
.replace(/\\/g, '/')}"
|
|
57
61
|
}
|
|
58
|
-
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}`;
|
|
65
|
+
(0, utils_sh_1.mkdir)('-p', testDir);
|
|
66
|
+
(0, utils_sh_1.write)(awsConfig, testDir + '/config.json');
|
|
67
|
+
const credentialsDev = await (0, infraAws_1.getAWSUser)('dev', testDir + '/config.json');
|
|
68
|
+
expect(credentialsDev.secretAccessKey).toEqual('devsecret');
|
|
69
|
+
expect(credentialsDev.accessKeyId).toEqual('devkey');
|
|
70
|
+
});
|
|
71
|
+
it('Should load credentials using a credentials source defined in the credentials file', async () => {
|
|
72
|
+
const testDir = './goldstackLocal/tests/getAWSUser';
|
|
73
|
+
const awsConfig = `{
|
|
74
|
+
"users": [
|
|
59
75
|
{
|
|
60
|
-
"name": "
|
|
76
|
+
"name": "process",
|
|
61
77
|
"type": "profile",
|
|
62
78
|
"config": {
|
|
63
|
-
"profile": "
|
|
64
|
-
"awsDefaultRegion": "us-west-2"
|
|
79
|
+
"profile": "with-process",
|
|
80
|
+
"awsDefaultRegion": "us-west-2",
|
|
81
|
+
"credentialsSource": "process",
|
|
82
|
+
"awsCredentialsFileName": "${path_1.default
|
|
83
|
+
.resolve('./testData/awsCredentials')
|
|
84
|
+
.replace(/\\/g, '/')}"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}`;
|
|
89
|
+
(0, utils_sh_1.mkdir)('-p', testDir);
|
|
90
|
+
(0, utils_sh_1.write)(awsConfig, testDir + '/config.json');
|
|
91
|
+
const credentialsProcess = await (0, infraAws_1.getAWSUser)('process', testDir + '/config.json');
|
|
92
|
+
expect(credentialsProcess.secretAccessKey).toEqual('processsecret');
|
|
93
|
+
expect(credentialsProcess.accessKeyId).toEqual('processkey');
|
|
94
|
+
});
|
|
95
|
+
it('Should load credentials using a credentials source defined in the config file', async () => {
|
|
96
|
+
const testDir = './goldstackLocal/tests/getAWSUser';
|
|
97
|
+
const awsConfig = `{
|
|
98
|
+
"users": [
|
|
99
|
+
{
|
|
100
|
+
"name": "process-from-config",
|
|
101
|
+
"type": "profile",
|
|
102
|
+
"config": {
|
|
103
|
+
"profile": "with-process",
|
|
104
|
+
"awsDefaultRegion": "us-west-2",
|
|
105
|
+
"credentialsSource": "process",
|
|
106
|
+
"awsConfigFileName": "${path_1.default
|
|
107
|
+
.resolve('./testData/awsConfig')
|
|
108
|
+
.replace(/\\/g, '/')}"
|
|
65
109
|
}
|
|
66
110
|
}
|
|
67
111
|
]
|
|
68
|
-
}`;
|
|
69
|
-
(0, utils_sh_1.mkdir)('-p', testDir);
|
|
70
|
-
(0, utils_sh_1.write)(awsConfig, testDir + '/config.json');
|
|
71
|
-
const
|
|
72
|
-
(
|
|
73
|
-
|
|
74
|
-
});
|
|
112
|
+
}`;
|
|
113
|
+
(0, utils_sh_1.mkdir)('-p', testDir);
|
|
114
|
+
(0, utils_sh_1.write)(awsConfig, testDir + '/config.json');
|
|
115
|
+
const credentialsProcessFromConfig = await (0, infraAws_1.getAWSUser)('process-from-config', testDir + '/config.json');
|
|
116
|
+
expect(credentialsProcessFromConfig.secretAccessKey).toEqual('processsecret');
|
|
117
|
+
expect(credentialsProcessFromConfig.accessKeyId).toEqual('processkey');
|
|
118
|
+
});
|
|
119
|
+
});
|
|
75
120
|
//# sourceMappingURL=infraAws.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infraAws.spec.js","sourceRoot":"","sources":["../../src/infraAws.spec.ts"],"names":[],"mappings":";;;;;AAAA,yCAAwC;AACxC,kDAAmD;AACnD,oDAA4B;
|
|
1
|
+
{"version":3,"file":"infraAws.spec.js","sourceRoot":"","sources":["../../src/infraAws.spec.ts"],"names":[],"mappings":";;;;;AAAA,yCAAwC;AACxC,kDAAmD;AACnD,oDAA4B;AAC5B,gDAAwB;AAExB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,IAAI,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;EAqBpB,CAAC;QACC,MAAM,OAAO,GAAG,mCAAmC,CAAC;QACpD,IAAA,gBAAK,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrB,IAAA,gBAAK,EAAC,SAAS,EAAE,OAAO,GAAG,uBAAuB,CAAC,CAAC;QACpD,MAAM,cAAc,GAAG,MAAM,IAAA,qBAAU,EACrC,eAAe,EACf,OAAO,GAAG,uBAAuB,CAClC,CAAC;QACF,IAAA,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
"$ref": "#/definitions/AWSConfiguration",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"definitions": {
|
|
5
|
-
"AWSAPIKeyUserConfig": {
|
|
6
|
-
"additionalProperties": false,
|
|
7
|
-
"description": "User accessing AWS using an access key id and secret access key. Only recommended for users used during development. The provided credentials will be included in the downloaded package but by default will not be committed to git.",
|
|
8
|
-
"properties": {
|
|
9
|
-
"awsAccessKeyId": {
|
|
10
|
-
"$ref": "#/definitions/AWSAccessKeyId"
|
|
11
|
-
},
|
|
12
|
-
"awsDefaultRegion": {
|
|
13
|
-
"$ref": "#/definitions/AWSRegion"
|
|
14
|
-
},
|
|
15
|
-
"awsSecretAccessKey": {
|
|
16
|
-
"$ref": "#/definitions/AWSSecretAccessKey"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"required": [
|
|
20
|
-
"awsDefaultRegion"
|
|
21
|
-
],
|
|
22
|
-
"title": "AWS API Key User Configuration",
|
|
23
|
-
"type": "object"
|
|
24
|
-
},
|
|
25
|
-
"AWSAccessKeyId": {
|
|
26
|
-
"description": "Access key for this user.",
|
|
27
|
-
"pattern": "^[^\\s]*$",
|
|
28
|
-
"title": "AWS Access Key Id",
|
|
29
|
-
"type": "string"
|
|
30
|
-
},
|
|
31
|
-
"AWSAccessKeyIdVariableName": {
|
|
32
|
-
"description": "Name of environment variable for AWS Access Key Id. When in doubt, use AWS_ACCESS_KEY_ID.",
|
|
33
|
-
"pattern": "^[^\\s]*$",
|
|
34
|
-
"title": "AWS Access Key Id Variable Name",
|
|
35
|
-
"type": "string"
|
|
36
|
-
},
|
|
37
|
-
"AWSConfiguration": {
|
|
38
|
-
"additionalProperties": false,
|
|
39
|
-
"description": "Global configuration for deploying to AWS.",
|
|
40
|
-
"properties": {
|
|
41
|
-
"users": {
|
|
42
|
-
"$ref": "#/definitions/AWSUsers"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"required": [
|
|
46
|
-
"users"
|
|
47
|
-
],
|
|
48
|
-
"title": "AWS Configuration",
|
|
49
|
-
"type": "object"
|
|
50
|
-
},
|
|
51
|
-
"AWSDefaultRegionVariableName": {
|
|
52
|
-
"description": "Name of environment variable for AWS Default Region. When in doubt, use AWS_DEFAULT_REGION.",
|
|
53
|
-
"pattern": "^[^\\s]*$",
|
|
54
|
-
"title": "AWS Default Region Varialbe Name",
|
|
55
|
-
"type": "string"
|
|
56
|
-
},
|
|
57
|
-
"AWSDeploymentRegion": {
|
|
58
|
-
"description": "AWS region that infrastructure should be deployed to.",
|
|
59
|
-
"enum": [
|
|
60
|
-
"us-east-1",
|
|
61
|
-
"us-east-2",
|
|
62
|
-
"us-west-1",
|
|
63
|
-
"us-west-2",
|
|
64
|
-
"af-south-1",
|
|
65
|
-
"ap-east-1",
|
|
66
|
-
"ap-south-1",
|
|
67
|
-
"ap-northeast-3",
|
|
68
|
-
"ap-northeast-2",
|
|
69
|
-
"ap-southeast-1",
|
|
70
|
-
"ap-southeast-2",
|
|
71
|
-
"ap-northeast-1",
|
|
72
|
-
"ca-central-1",
|
|
73
|
-
"eu-central-1",
|
|
74
|
-
"eu-west-1",
|
|
75
|
-
"eu-west-2",
|
|
76
|
-
"eu-south-1",
|
|
77
|
-
"eu-west-3",
|
|
78
|
-
"eu-north-1",
|
|
79
|
-
"me-south-1",
|
|
80
|
-
"sa-east-1"
|
|
81
|
-
],
|
|
82
|
-
"title": "AWS Deployment Region",
|
|
83
|
-
"type": "string"
|
|
84
|
-
},
|
|
85
|
-
"AWSEnvironmentVariableUserConfig": {
|
|
86
|
-
"additionalProperties": false,
|
|
87
|
-
"description": "Obtain AWS user from environment variables. This will be useful for CI/CD.",
|
|
88
|
-
"properties": {
|
|
89
|
-
"awsAccessKeyIdVariableName": {
|
|
90
|
-
"$ref": "#/definitions/AWSAccessKeyIdVariableName"
|
|
91
|
-
},
|
|
92
|
-
"awsDefaultRegionVariableName": {
|
|
93
|
-
"$ref": "#/definitions/AWSDefaultRegionVariableName"
|
|
94
|
-
},
|
|
95
|
-
"awsSecretAccessKeyVariableName": {
|
|
96
|
-
"$ref": "#/definitions/AWSSecretAccessKeyVariableName"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"required": [
|
|
100
|
-
"awsAccessKeyIdVariableName",
|
|
101
|
-
"awsSecretAccessKeyVariableName",
|
|
102
|
-
"awsDefaultRegionVariableName"
|
|
103
|
-
],
|
|
104
|
-
"title": "AWS Environment Variable User Configuration",
|
|
105
|
-
"type": "object"
|
|
106
|
-
},
|
|
107
|
-
"AWSProfileConfig": {
|
|
108
|
-
"additionalProperties": false,
|
|
109
|
-
"description": "User that is configured using the aws cli. Useful for development environments.",
|
|
110
|
-
"properties": {
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"title": "AWS
|
|
135
|
-
"type": "
|
|
136
|
-
},
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
},
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
],
|
|
203
|
-
"title": "
|
|
204
|
-
"type": "string"
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/AWSConfiguration",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"AWSAPIKeyUserConfig": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"description": "User accessing AWS using an access key id and secret access key. Only recommended for users used during development. The provided credentials will be included in the downloaded package but by default will not be committed to git.",
|
|
8
|
+
"properties": {
|
|
9
|
+
"awsAccessKeyId": {
|
|
10
|
+
"$ref": "#/definitions/AWSAccessKeyId"
|
|
11
|
+
},
|
|
12
|
+
"awsDefaultRegion": {
|
|
13
|
+
"$ref": "#/definitions/AWSRegion"
|
|
14
|
+
},
|
|
15
|
+
"awsSecretAccessKey": {
|
|
16
|
+
"$ref": "#/definitions/AWSSecretAccessKey"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": [
|
|
20
|
+
"awsDefaultRegion"
|
|
21
|
+
],
|
|
22
|
+
"title": "AWS API Key User Configuration",
|
|
23
|
+
"type": "object"
|
|
24
|
+
},
|
|
25
|
+
"AWSAccessKeyId": {
|
|
26
|
+
"description": "Access key for this user.",
|
|
27
|
+
"pattern": "^[^\\s]*$",
|
|
28
|
+
"title": "AWS Access Key Id",
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"AWSAccessKeyIdVariableName": {
|
|
32
|
+
"description": "Name of environment variable for AWS Access Key Id. When in doubt, use AWS_ACCESS_KEY_ID.",
|
|
33
|
+
"pattern": "^[^\\s]*$",
|
|
34
|
+
"title": "AWS Access Key Id Variable Name",
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"AWSConfiguration": {
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"description": "Global configuration for deploying to AWS.",
|
|
40
|
+
"properties": {
|
|
41
|
+
"users": {
|
|
42
|
+
"$ref": "#/definitions/AWSUsers"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": [
|
|
46
|
+
"users"
|
|
47
|
+
],
|
|
48
|
+
"title": "AWS Configuration",
|
|
49
|
+
"type": "object"
|
|
50
|
+
},
|
|
51
|
+
"AWSDefaultRegionVariableName": {
|
|
52
|
+
"description": "Name of environment variable for AWS Default Region. When in doubt, use AWS_DEFAULT_REGION.",
|
|
53
|
+
"pattern": "^[^\\s]*$",
|
|
54
|
+
"title": "AWS Default Region Varialbe Name",
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"AWSDeploymentRegion": {
|
|
58
|
+
"description": "AWS region that infrastructure should be deployed to.",
|
|
59
|
+
"enum": [
|
|
60
|
+
"us-east-1",
|
|
61
|
+
"us-east-2",
|
|
62
|
+
"us-west-1",
|
|
63
|
+
"us-west-2",
|
|
64
|
+
"af-south-1",
|
|
65
|
+
"ap-east-1",
|
|
66
|
+
"ap-south-1",
|
|
67
|
+
"ap-northeast-3",
|
|
68
|
+
"ap-northeast-2",
|
|
69
|
+
"ap-southeast-1",
|
|
70
|
+
"ap-southeast-2",
|
|
71
|
+
"ap-northeast-1",
|
|
72
|
+
"ca-central-1",
|
|
73
|
+
"eu-central-1",
|
|
74
|
+
"eu-west-1",
|
|
75
|
+
"eu-west-2",
|
|
76
|
+
"eu-south-1",
|
|
77
|
+
"eu-west-3",
|
|
78
|
+
"eu-north-1",
|
|
79
|
+
"me-south-1",
|
|
80
|
+
"sa-east-1"
|
|
81
|
+
],
|
|
82
|
+
"title": "AWS Deployment Region",
|
|
83
|
+
"type": "string"
|
|
84
|
+
},
|
|
85
|
+
"AWSEnvironmentVariableUserConfig": {
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"description": "Obtain AWS user from environment variables. This will be useful for CI/CD.",
|
|
88
|
+
"properties": {
|
|
89
|
+
"awsAccessKeyIdVariableName": {
|
|
90
|
+
"$ref": "#/definitions/AWSAccessKeyIdVariableName"
|
|
91
|
+
},
|
|
92
|
+
"awsDefaultRegionVariableName": {
|
|
93
|
+
"$ref": "#/definitions/AWSDefaultRegionVariableName"
|
|
94
|
+
},
|
|
95
|
+
"awsSecretAccessKeyVariableName": {
|
|
96
|
+
"$ref": "#/definitions/AWSSecretAccessKeyVariableName"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"required": [
|
|
100
|
+
"awsAccessKeyIdVariableName",
|
|
101
|
+
"awsSecretAccessKeyVariableName",
|
|
102
|
+
"awsDefaultRegionVariableName"
|
|
103
|
+
],
|
|
104
|
+
"title": "AWS Environment Variable User Configuration",
|
|
105
|
+
"type": "object"
|
|
106
|
+
},
|
|
107
|
+
"AWSProfileConfig": {
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"description": "User that is configured using the aws cli. Useful for development environments.",
|
|
110
|
+
"properties": {
|
|
111
|
+
"awsConfigFileName": {
|
|
112
|
+
"description": "Path to the AWS configuration, e.g. `~/.aws/config`. If environment variable `AWS_CONFIG_FILE` is set, this is ignored.",
|
|
113
|
+
"type": "string"
|
|
114
|
+
},
|
|
115
|
+
"awsCredentialsFileName": {
|
|
116
|
+
"description": "Path to the AWS configuration, e.g. `~/.aws/credentials`. If environment variable `AWS_SHARED_CREDENTIALS_FILE` is set, this is ignored.",
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"awsDefaultRegion": {
|
|
120
|
+
"$ref": "#/definitions/AWSRegion"
|
|
121
|
+
},
|
|
122
|
+
"credentialsSource": {
|
|
123
|
+
"$ref": "#/definitions/CredentialsSource",
|
|
124
|
+
"description": "Set to `process`, if credentials should be loaded by running a `credential-process` defined in the AWS credentials configuration. See https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html"
|
|
125
|
+
},
|
|
126
|
+
"profile": {
|
|
127
|
+
"$ref": "#/definitions/Profile"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": [
|
|
131
|
+
"profile",
|
|
132
|
+
"awsDefaultRegion"
|
|
133
|
+
],
|
|
134
|
+
"title": "AWS Local User Configuration",
|
|
135
|
+
"type": "object"
|
|
136
|
+
},
|
|
137
|
+
"AWSRegion": {
|
|
138
|
+
"$ref": "#/definitions/AWSDeploymentRegion",
|
|
139
|
+
"description": "Default AWS region to use.",
|
|
140
|
+
"pattern": "^[^\\s]*$",
|
|
141
|
+
"title": "AWS Region"
|
|
142
|
+
},
|
|
143
|
+
"AWSSecretAccessKey": {
|
|
144
|
+
"description": "Secret key for this user.",
|
|
145
|
+
"pattern": "^[^\\s]*$",
|
|
146
|
+
"title": "AWS Secret Access Key",
|
|
147
|
+
"type": "string"
|
|
148
|
+
},
|
|
149
|
+
"AWSSecretAccessKeyVariableName": {
|
|
150
|
+
"description": "Name of environment variable for AWS Secret Access Key. When in doubt, use AWS_SECRET_ACCESS_KEY.",
|
|
151
|
+
"pattern": "^[^\\s]*$",
|
|
152
|
+
"title": "AWS Secret Access Key Variable Name",
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"AWSUser": {
|
|
156
|
+
"additionalProperties": false,
|
|
157
|
+
"description": "AWS user",
|
|
158
|
+
"properties": {
|
|
159
|
+
"config": {
|
|
160
|
+
"$ref": "#/definitions/AwsUserConfig"
|
|
161
|
+
},
|
|
162
|
+
"name": {
|
|
163
|
+
"$ref": "#/definitions/Name"
|
|
164
|
+
},
|
|
165
|
+
"type": {
|
|
166
|
+
"$ref": "#/definitions/Type"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"required": [
|
|
170
|
+
"name",
|
|
171
|
+
"type",
|
|
172
|
+
"config"
|
|
173
|
+
],
|
|
174
|
+
"title": "AWS User",
|
|
175
|
+
"type": "object"
|
|
176
|
+
},
|
|
177
|
+
"AWSUsers": {
|
|
178
|
+
"items": {
|
|
179
|
+
"$ref": "#/definitions/AWSUser"
|
|
180
|
+
},
|
|
181
|
+
"type": "array"
|
|
182
|
+
},
|
|
183
|
+
"AwsUserConfig": {
|
|
184
|
+
"anyOf": [
|
|
185
|
+
{
|
|
186
|
+
"$ref": "#/definitions/AWSProfileConfig"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"$ref": "#/definitions/AWSEnvironmentVariableUserConfig"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"$ref": "#/definitions/AWSAPIKeyUserConfig"
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"CredentialsSource": {
|
|
197
|
+
"const": "process",
|
|
198
|
+
"type": "string"
|
|
199
|
+
},
|
|
200
|
+
"Name": {
|
|
201
|
+
"description": "Identifier for this user. No spaces allowed.",
|
|
202
|
+
"pattern": "^[^\\s]*$",
|
|
203
|
+
"title": "Name",
|
|
204
|
+
"type": "string"
|
|
205
|
+
},
|
|
206
|
+
"Profile": {
|
|
207
|
+
"description": "Profile name of the user configured with the aws cli. When in doubt, use `default`.",
|
|
208
|
+
"pattern": "^[^\\s]*$",
|
|
209
|
+
"title": "Profile",
|
|
210
|
+
"type": "string"
|
|
211
|
+
},
|
|
212
|
+
"Type": {
|
|
213
|
+
"description": "Type of this user.",
|
|
214
|
+
"enum": [
|
|
215
|
+
"apiKey",
|
|
216
|
+
"profile",
|
|
217
|
+
"environmentVariables"
|
|
218
|
+
],
|
|
219
|
+
"title": "Type",
|
|
220
|
+
"type": "string"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|