Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error: Domain not available / error on HostedUICustomResourceInputs creation, on adding new amplify env #10796

Closed
5 tasks done
BBopanna opened this issue Jul 25, 2022 · 12 comments
Labels
auth Issues tied to the auth category of the CLI ops-auth Operational theme: auth category ops-multienv Operational theme: multi-environment pending-triage Issue is pending triage

Comments

@BBopanna
Copy link

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

How did you install the Amplify CLI?

yarn

If applicable, what version of Node.js are you using?

v16.15.1

Amplify CLI Version

9.1.0

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

None

Amplify Categories

auth, storage, function, api, hosting

Amplify Commands

push

Describe the bug

Adding a new env is giving the error : Failed to create HostedUICustomResourceInputs on looking into cloudwatch logs below is the error -

`2022-07-24T15:24:37.820+05:30

2022-07-24T09:54:37.814Z 2a2666a0-e31d-486f-941f-6b7815e90ceb INFO Error: Domain not available
at /var/task/index.js:54:25
at processTicksAndRejections (internal/process/task_queues.js:95:5)

2022-07-24T09:54:37.814Z 2a2666a0-e31d-486f-941f-6b7815e90ceb INFO Error: Domain not available at /var/task/index.js:54:25 at processTicksAndRejections (internal/process/task_queues.js:95:5)

2022-07-24T15:24:37.840+05:30
2022-07-24T09:54:37.840Z 2a2666a0-e31d-486f-941f-6b7815e90ceb INFO Response body:

{
"Status": "FAILED",
"Reason": "See the details in CloudWatch Log Stream: 2022/07/24/[$LATEST]<>",
"PhysicalResourceId": "2022/07/24/[$LATEST]03681359a3d446e1a642221adc765637",
"StackId": "arn:aws:cloudformation:ap-south-1:016616419379:stack/amplify-<>/<>",
"RequestId": "<>",
"LogicalResourceId": "HostedUICustomResourceInputs",
"NoEcho": false,
"Data": {
"err": {}
}
}`

Similar issue are mentioned here
[1] #4781
[2] #9173

We realised that we had the exact same project name and amplify env name in another development aws account and we were trying to create the same project with the same amplify env under another aws account - this was what gave away the cause.

After we delete the amplify env from the first aws account, the addition of the new amplify env with the same name was successful in the second aws account.

So, if there are 2 aws accounts where the same project is created (say one for development, one for beta testing) with the same amplify env the second one will fail.

Expected behavior

Should be able to add a amplify env for the same project name and amplify env name in different aws accounts.

Reproduction steps

  1. Add amplify env, say 'dev' for a project - say 'wanderingMind' in aws account say '11122233'
  2. Now try adding amplify env - 'dev' for project - 'wanderingMind' in another aws account say '444555666'

Notice #2 will fail with the above error.

PS - possible solution - try adding to aws account number (or some parts of it Or any other unique identifier)

GraphQL schema(s)

# Put schemas below this line

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

@josefaidt josefaidt added auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage ops-auth Operational theme: auth category labels Jul 25, 2022
@ykethan
Copy link
Member

ykethan commented Jul 26, 2022

Hello @BBopanna, On utilizing the reproduction steps, I was unable to reproduce the issue. Please find the following steps I utilized.

Created a new Amplify application with dev as environment the.

  1. Utilized the amplify add env command to add an a new environment but amplify does provide the option to select a new profile and utilizes the present dev environment .
  2. Created a new environment named test in new account then cloned the environment and naming it as dev then pulling the environment in present project but this does not pull the environment as the ID of the project is different from the project ID in new account.

Could you please provide us the steps utilized in adding the same env in your Amplify project.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Jul 26, 2022
@ykethan
Copy link
Member

ykethan commented Aug 1, 2022

Following up on this issue, please do let us know if you would require any assistance.

@ykethan ykethan added pending-close-response-required and removed pending-response Issue is pending response from the issue author labels Aug 1, 2022
@BBopanna
Copy link
Author

BBopanna commented Aug 1, 2022

You have got the steps wrong

  1. Add amplify env, say 'dev' for a project - say 'wanderingMind' in aws account say '11122233'
  2. Copy over this project without the amplify directory to a new space, do NOT pull
  3. Now try initialising and adding amplify env - 'dev' for project - 'wanderingMind' in another aws account say '444555666', this will ask you for a aws profile, pick the one tied to aws account say '444555666'
  4. Try with the env name "master" not the default "dev"

@josefaidt josefaidt added the ops-multienv Operational theme: multi-environment label Aug 1, 2022
@ykethan
Copy link
Member

ykethan commented Aug 1, 2022

Hello @BBopanna, Thank you for you for the reproduction steps. Could you please provide me information on the use case for naming the environments the same.

@BBopanna
Copy link
Author

BBopanna commented Aug 1, 2022

One account in on "Development" Sandbox while other one is for "Beta" testing - cross geo accounts.

@ykethan
Copy link
Member

ykethan commented Aug 1, 2022

Hello @BBopanna, From the information provided the work flow is currently not supported. The following are the supported workflows.

  • We can deploy a environment into a different account when running a amplify add env, name the environment different from the existing environments and selecting a different account/profile.

  • The Amplify team-provider-info.json file currently stores information on different environments present in a application. We can deploy the same resources in a different account by copying the project to a new folder(with amplify resources) then remove the team-provider-info.json and aws-exports.js and perform an amplify init and push. But please note that this would be a different application with a new app ID. The application will need to be maintained separately.

Please refer to the document for additional information: https://docs.amplify.aws/cli/teams/overview/

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Aug 1, 2022
@BBopanna
Copy link
Author

BBopanna commented Aug 2, 2022

Noted.

So wont it be a problem if 2 customer with 2 different accounts name their amplify project the same - say "sameAmplifyProject" and attempt to deploy ? wont it lead to this use case ?

@ykethan
Copy link
Member

ykethan commented Aug 2, 2022

Hey @BBopanna, if the accounts are different and the applications have the same name this should not cause any issues. As the Amplify apps are identified by the app Id created on a amplify init.
for a quick test I created 2 amplify app in the same account with the same name i did not experience any issues as the applications are separated by different app id's.
Hope this helps

@ykethan ykethan added pending-close-response-required and removed pending-response Issue is pending response from the issue author labels Aug 2, 2022
@BBopanna
Copy link
Author

BBopanna commented Aug 3, 2022

Try with 2 different accounts, same amplify project name and same amplify env name.

@ykethan
Copy link
Member

ykethan commented Aug 3, 2022

Hey @BBopanna, on quick replication I can confirm that creating a same environment name and same app name in different accounts works.

image

image

output:
Account A:
image

Account B:
image

I have created two different apps in different folders same environment name and same app name in different accounts/profile connected to different accounts.

@BBopanna
Copy link
Author

BBopanna commented Aug 3, 2022

ok thankyou @ykethan . Not sure why we ran into this issue - for any one how do run into it, we ended up deleting the amplify env from one account before creating with the same name in another.

@ykethan - go ahead and close this, thankyou for your time.

@ykethan
Copy link
Member

ykethan commented Aug 3, 2022

Helllo @BBopanna, Glad to hear that you are back up and running. Do reach out to us again, we would be happy i assisting you.

@ykethan ykethan closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI ops-auth Operational theme: auth category ops-multienv Operational theme: multi-environment pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

3 participants