Use base stack name as the environment within aws cloud formations
							parent
							
								
									52ef99fb78
								
							
						
					
					
						commit
						29442b7508
					
				|  | @ -450,7 +450,7 @@ class AWSBuildEnvironment { | |||
|                     taskDefCloudFormation = this.insertAtTemplate(taskDefCloudFormation, 'p2 - secret', this.getSecretTemplate(secret.ParameterKey.replace(/[^\dA-Za-z]/g, ''))); | ||||
|                     taskDefCloudFormation = this.insertAtTemplate(taskDefCloudFormation, 'p3 - container def', this.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey.replace(/[^\dA-Za-z]/g, ''))); | ||||
|                 } | ||||
|                 const mappedSecrets = secrets.map((x) => { | ||||
|                 const secretsMappedToCloudFormationParameters = secrets.map((x) => { | ||||
|                     return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue }; | ||||
|                 }); | ||||
|                 yield CF.createStack({ | ||||
|  | @ -458,6 +458,10 @@ class AWSBuildEnvironment { | |||
|                     TemplateBody: taskDefCloudFormation, | ||||
|                     Capabilities: ['CAPABILITY_IAM'], | ||||
|                     Parameters: [ | ||||
|                         { | ||||
|                             ParameterKey: 'Environment', | ||||
|                             ParameterValue: this.baseStackName, | ||||
|                         }, | ||||
|                         { | ||||
|                             ParameterKey: 'ImageUrl', | ||||
|                             ParameterValue: image, | ||||
|  | @ -486,7 +490,7 @@ class AWSBuildEnvironment { | |||
|                             ParameterKey: 'BUILDID', | ||||
|                             ParameterValue: buildGuid, | ||||
|                         }, | ||||
|                         ...mappedSecrets, | ||||
|                         ...secretsMappedToCloudFormationParameters, | ||||
|                     ], | ||||
|                 }).promise(); | ||||
|                 core.info('Creating cloud runner job'); | ||||
|  | @ -547,7 +551,7 @@ class AWSBuildEnvironment { | |||
|                 StackName: baseStackName, | ||||
|             }; | ||||
|             const parameters = [ | ||||
|                 { ParameterKey: 'EnvironmentName', ParameterValue: 'development' }, | ||||
|                 { ParameterKey: 'EnvironmentName', ParameterValue: baseStackName }, | ||||
|                 { ParameterKey: 'Storage', ParameterValue: `${baseStackName}-storage` }, | ||||
|                 { ParameterKey: 'Version', ParameterValue: hash }, | ||||
|             ]; | ||||
|  |  | |||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -152,7 +152,7 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface { | |||
|           this.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey.replace(/[^\dA-Za-z]/g, '')), | ||||
|         ); | ||||
|       } | ||||
|       const mappedSecrets = secrets.map((x) => { | ||||
|       const secretsMappedToCloudFormationParameters = secrets.map((x) => { | ||||
|         return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue }; | ||||
|       }); | ||||
| 
 | ||||
|  | @ -161,6 +161,10 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface { | |||
|         TemplateBody: taskDefCloudFormation, | ||||
|         Capabilities: ['CAPABILITY_IAM'], | ||||
|         Parameters: [ | ||||
|           { | ||||
|             ParameterKey: 'Environment', | ||||
|             ParameterValue: this.baseStackName, | ||||
|           }, | ||||
|           { | ||||
|             ParameterKey: 'ImageUrl', | ||||
|             ParameterValue: image, | ||||
|  | @ -189,7 +193,7 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface { | |||
|             ParameterKey: 'BUILDID', | ||||
|             ParameterValue: buildGuid, | ||||
|           }, | ||||
|           ...mappedSecrets, | ||||
|           ...secretsMappedToCloudFormationParameters, | ||||
|         ], | ||||
|       }).promise(); | ||||
|       core.info('Creating cloud runner job'); | ||||
|  | @ -256,7 +260,7 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface { | |||
|       StackName: baseStackName, | ||||
|     }; | ||||
|     const parameters: SDK.CloudFormation.Parameter[] = [ | ||||
|       { ParameterKey: 'EnvironmentName', ParameterValue: 'development' }, | ||||
|       { ParameterKey: 'EnvironmentName', ParameterValue: baseStackName }, | ||||
|       { ParameterKey: 'Storage', ParameterValue: `${baseStackName}-storage` }, | ||||
|       { ParameterKey: 'Version', ParameterValue: hash }, | ||||
|     ]; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue