aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

Unable to create custom templates from the Amplify CLI. #4453

Closed Jay2113 closed 4 years ago

Jay2113 commented 4 years ago

Describe the bug I am trying to create custom templates within my Amplify application. However, while trying to push the sample template from the CLI I am observing the following error “An error occurred during the push operation: No such resource AWS::MediaConvert::Queue”.

Amplify CLI Version 4.18.0

To Reproduce Please kindly refer to this sample template: sample-cloudformation-template.zip

These are the steps that I used: https://docs.amplify.aws/cli/usage/customcf

I tried to create a CloudFormation stack from the CloudFormation console using the sample template and I was able to create the stack from the console.

I was also able to create a CloudFormation stack from the AWS CLI using the sample template by running the following command:

aws2 cloudformation create-stack --stack-name myteststack --template-body file://sample-cloudformation-template.yml --parameters ParameterKey=env,ParameterValue=dev

Expected behavior Create and successfully push the sample template from the CLI.

Screenshots CF-error

Desktop (please complete the following information):

venkatesh-kadiyala commented 4 years ago

We are looking to create AWS Media Convert Queue through amplify CLI, it creates the resource but when we try to get the ARN using Fn::GetAtt, we get the error saying "No such resource". The same behavior happens when we get the ARN for AWS::WAFv2::WebACL.

ammarkarachi commented 4 years ago

Is it the format {logicalusername}.Arn or similar?

venkatesh-kadiyala commented 4 years ago

Yes. Below is the sample snippet where we want to get the ARN. "QUEUE" is the logical ID.

Outputs:
  QueueArn:
    Description: "ARN of the Queue"
    Value: !GetAtt QUEUE.Arn
ammarkarachi commented 4 years ago

Can you also provide the snippet on how you import that particular ARN?

venkatesh-kadiyala commented 4 years ago

Below is the template we try to run using amplify CLI by having custom cloud formation template. If we remove outputs section, it creates fine but getting error if we want to get the ARN of the resource.

AWSTemplateFormatVersion: 2010-09-09

Parameters:
  env:
    Type: String

Resources:
  # BEGIN QUEUE RESOURCE
  QUEUE:
    Type: AWS::MediaConvert::Queue
    Properties: 
      Description: "Queue for processing transcoding jobs"
      Name: !Sub
      - CLIPS-VOD-${env}
      - { env: !Ref env }
      PricingPlan: "ON_DEMAND"
      Status: "ACTIVE"

Outputs:
  QueueArn:
    Description: "ARN of the Queue"
    Value: !GetAtt QUEUE.Arn
ammarkarachi commented 4 years ago

Are you able to share you zipped Amplify folder of the project to amplify-cli@amazon.com?

venkatesh-kadiyala commented 4 years ago

Sent. Got below email with subject "smtp-fw-9103.amazon.com Unscannable message detected ". Let me know if you didn't receive the file. The message (MID 771355238) could not be fully scanned by the anti-virus engine.

And, This message timed out during scanning.

Actions taken: Message quarantined

ammarkarachi commented 4 years ago

I am sorry for that can you share it by using your preferred file sharing application?

venkatesh-kadiyala commented 4 years ago

Shared through one drive.

ammarkarachi commented 4 years ago

Thanks!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed because of inactivity. Please open a new issue if you are still encountering problems.

hirenumradia commented 3 years ago

Hi, I am running into the same issue with "An error occurred during the push operation: No such resource AWS::EFS::AccessPoint". We have a very similar cloudformation template to the one mentioned by @venkatesh-kadiyala. Was this issue resolved?

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.