Skip to content

Commit

Permalink
fix yaml load and log bucket output error (#947)
Browse files Browse the repository at this point in the history
* fixed raw config format to JSON

* fixed log-bucket-config

* Fixed log bucket output

Co-authored-by: hickeydh-aws <hickeydh@amazon.com>
  • Loading branch information
hickeydh-aws and dustinhaws authored Mar 22, 2022
1 parent 9c7bf6d commit da7430f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions src/deployments/cdk/src/deployments/iam/step-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as iam from '@aws-cdk/aws-iam';
import { AccountStacks } from '../../common/account-stacks';
import { createRoleName } from '@aws-accelerator/cdk-accelerator/src/core/accelerator-name-generator';
import { CfnIamRoleOutput } from './outputs';
import { LogBucketOutput, AccountBucketOutputFinder } from '../defaults/outputs';
import { LogBucketOutput } from '../defaults/outputs';
import { StackOutput } from '@aws-accelerator/common-outputs/src/stack-output';

export interface IamConfigServiceRoleProps {
Expand All @@ -35,12 +35,16 @@ export async function createConfigServiceRoles(props: IamConfigServiceRoleProps)
const securityAccountKey = config.getMandatoryAccountKey('central-security');
const centralOperationsKey = config.getMandatoryAccountKey('central-operations');
const centralLogKey = config.getMandatoryAccountKey('central-log');

const logBucketDetails = LogBucketOutput.getBucket({
accountStacks,
config,
outputs,
});
let logBucketDetails;
try {
logBucketDetails = LogBucketOutput.getBucket({
accountStacks,
config,
outputs,
});
} catch (err) {
console.log('Log Bucket not created yet. Continuing.');
}

for (const accountKey of accountKeys) {
const accountStack = accountStacks.tryGetOrCreateAccountStack(accountKey);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/common/src/util/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,6 @@ function enableGlobalRegion(config: string, rawConfig: string, format: FormatTyp
}

const configStr = getStringFromObject(configObj, format);
const rawConfigStr = getStringFromObject(rawConfigObj, format);
const rawConfigStr = getStringFromObject(rawConfigObj, JSON_FORMAT);
return { configStr, rawConfigStr };
}

0 comments on commit da7430f

Please sign in to comment.