Skip to content

Commit

Permalink
chore: Add provision account unit test (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyen102 authored Jul 19, 2021
1 parent 55ee55a commit 6eec31d
Show file tree
Hide file tree
Showing 3 changed files with 541 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,21 @@ class EnvironmentConfigVarsService extends Service {
});
}

// TODO: If the ami sharing gets moved (because it doesn't contribute to an env var)
// then move the update local resource policies too.
// Using the account root provides basically the same level of security because in either
// case we have to trust that the member account hasn't altered the role's assume role policy to allow other
// principals assume it
// if (s3Prefixes.length > 0) {
// await environmentMountService.addRoleArnToLocalResourcePolicies(`arn:aws:iam::${accountId}:root`, s3Prefixes);
// }

// Check if the environment being launched needs an admin key-pair to be created in the target account
// If the configuration being used has any parameter that uses the "adminKeyPairName" variable then it means
// we need to provision that key in the target account and provide the name of the generated key as the
// "adminKeyPairName" variable
// Disabling "no-template-curly-in-string" lint rule because we need to compare with the string literal "${adminKeyPairName}"
// i.e., without any string interpolation
// eslint-disable-next-line no-template-curly-in-string
const isAdminKeyPairRequired = !!_.find(envTypeConfig.params, p => p.value === '${adminKeyPairName}');
let adminKeyPairName = '';
Expand Down
Loading

0 comments on commit 6eec31d

Please sign in to comment.