Skip to content

Commit

Permalink
Merge branch 'master' of github.com:org-formation/org-formation-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafConijn committed Jun 23, 2022
2 parents 5076200 + 7a39815 commit 074e206
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 29 deletions.
37 changes: 18 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-organization-formation",
"version": "1.0.1-beta.1",
"version": "1.0.0",
"description": "Infrastructure as code solution for AWS Organizations",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -40,7 +40,7 @@
"@types/nunjucks": "^3.1.4",
"@types/rc": "^1.1.0",
"archiver": "^5.3.1",
"aws-sdk": "^2.895.0",
"aws-sdk": "^2.1160.0",
"commander": "^2.20.0",
"ini": "^1.3.5",
"js-yaml": "^4.0.0",
Expand Down
11 changes: 4 additions & 7 deletions src/org-binder/org-tasks-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export class TaskProvider {
public createRootCreateTasks(resource: OrganizationRootResource, hash: string, mirror?: boolean): IBuildTask[] {
const that = this;
const tasks: IBuildTask[] = [];
let partitionId: string;
let createPartitionOrganizationRootTask: IBuildTask;
const createOrganizationRootTask: IBuildTask = {
type: resource.type,
Expand All @@ -53,7 +52,6 @@ export class TaskProvider {
},
};
tasks.push(createOrganizationRootTask);
const physicalId = createOrganizationRootTask.result;
if (mirror) {
createPartitionOrganizationRootTask = {
type: resource.type,
Expand All @@ -64,15 +62,14 @@ export class TaskProvider {
},
};
tasks.push(createPartitionOrganizationRootTask);
partitionId = createPartitionOrganizationRootTask.result;
}

for (const attachedSCP of resource.serviceControlPolicies) {
const attachSCPTask: IBuildTask = this.createAttachSCPTask(resource, attachedSCP, that, () => physicalId, IS_COMMERCIAL);
const attachSCPTask: IBuildTask = this.createAttachSCPTask(resource, attachedSCP, that, () => createOrganizationRootTask.result, IS_COMMERCIAL);
attachSCPTask.dependentTasks = [createOrganizationRootTask];
tasks.push(attachSCPTask);
if (mirror) {
const attachPartitionSCPTask: IBuildTask = this.createAttachSCPTask(resource, attachedSCP, that, () => partitionId, IS_PARTITION);
const attachPartitionSCPTask: IBuildTask = this.createAttachSCPTask(resource, attachedSCP, that, () => createPartitionOrganizationRootTask.result, IS_PARTITION);
attachPartitionSCPTask.dependentTasks = [createPartitionOrganizationRootTask];
tasks.push(attachPartitionSCPTask);
}
Expand All @@ -88,8 +85,8 @@ export class TaskProvider {
type: resource.type,
logicalId: resource.logicalId,
lastCommittedHash: hash,
physicalId,
partitionId,
physicalId: createOrganizationRootTask.result,
partitionId: createPartitionOrganizationRootTask.result,
});
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/parser/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class Validator {
throw new OrgFormationError(`expected Region to be a string or string[], found ${typeof binding.Region} (${binding.Region})`);

}
Validator.ThrowForUnknownAttribute(binding, id, 'OrganizationalUnit', 'Account', 'ExcludeAccount', 'Region', 'IncludeMasterAccount', 'AccountsWithTag');
Validator.ThrowForUnknownAttribute(binding, id, 'OrganizationalUnit', 'Account', 'ExcludeAccount', 'ExcludeOrganizationalUnit', 'Region', 'IncludeMasterAccount', 'AccountsWithTag');
}

public static ThrowForUnknownAttribute(obj: any, id: string, ...knownAttributes: string[]): void {
Expand Down

0 comments on commit 074e206

Please sign in to comment.