Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Unclear how to "import" existing accounts. #110

Open
moltar opened this issue Jul 15, 2022 · 4 comments
Open

Unclear how to "import" existing accounts. #110

moltar opened this issue Jul 15, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@moltar
Copy link
Contributor

moltar commented Jul 15, 2022

I have tried to add an existing account to nestedOU.

All of the values were copy-pasted from the console.

          {
            name: 'name',
            existingAccountId: '123',
            email: '[email protected]',
          },

Deployment exploded with:

Parameter name: can't be prefixed with "ssm" (case-insensitive). If formed as a path, it can consist of sub-paths divided by slash symbol; each sub-path can be formed as a mix of letters, numbers and the following 3 symbols .-_ (Service: AmazonSSM; Status Code: 400; Error Code: ValidationException; Request ID: abb75351-1797-4236-b34d-4539a829ca5b; Proxy: null)

Which doesn't even make sense, as the parameter is not using ssm in the name. But maybe it's a generic error?

Account name does have a space in it. But it looks like an ID is used for existing accounts anyways. So I don't see a problem there.

Any ideas?

Thanks.

@moltar
Copy link
Contributor Author

moltar commented Jul 15, 2022

Btw, what also might have caused it is the fact that I renamed the OU in the same deployment.

@flochaz flochaz added the bug Something isn't working label Jul 18, 2022
@npvisual
Copy link

npvisual commented Aug 4, 2022

Tried using the existingAccountId as well and got the following error when running a cdk diff :

1-SDLC-organization % npm run diff

> [email protected] diff
> cdk --profile main-admin diff


/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/private/uniqueid.ts:42
    throw new Error(`ID components may not include unresolved tokens: ${unresolvedTokens.join(',')}`);
          ^
Error: Resolution error: ID components may not include unresolved tokens: ${Token[TOKEN.1399]}SubZoneDelegationNSRecord.
Object creation stack:
  at Execute again with CDK_DEBUG=true to capture stack traces
    at Object.makeUniqueId (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/private/uniqueid.ts:42:11)
    at AwsOrganizationsStack.allocateLogicalId (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/stack.ts:500:12)
    at AwsOrganizationsStack.getLogicalId (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/stack.ts:260:28)
    at CfnRecordSet.synthesizeLogicalId (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/cfn-element.ts:98:25)
    at Object.produce (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/cfn-element.ts:33:64)
    at LazyString.resolve (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/lazy.ts:167:28)
    at RememberingTokenResolver.resolveToken (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/resolvable.ts:80:24)
    at RememberingTokenResolver.resolveToken (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/private/resolve.ts:282:18)
    at resolve (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/private/resolve.ts:208:51)
    at Object.resolve [as mapToken] (/Users/{...}/GitHub/aws-bootstrap-kit-examples/source/1-SDLC-organization/node_modules/aws-cdk-lib/core/lib/private/resolve.ts:115:77)
Subprocess exited with error 1

The error disappears when I remove it from sdlc-organization.ts.

@parker-h
Copy link

Im getting the same error exact error when trying to add existing accounts using existingAccountId @npvisual. For me it seems to be only throwing the error on AccountType.STAGE type.

@flochaz
Copy link
Contributor

flochaz commented Dec 15, 2022

Sorry to hear that. let me come back to you with proper doc. will prioritize that this week

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants