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

AWS_Lambda auth type not supported in headless [amplify add api --headless] #13728

Open
2 tasks done
aroradev-dms opened this issue Apr 19, 2024 · 1 comment
Open
2 tasks done
Labels
feature-request Request a new feature headless Headless mode for CI/CD

Comments

@aroradev-dms
Copy link

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

12.10.3

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.

No

Describe the bug

Unable to add/modify GraphQL API with Lambda authorisation using headless.

Expected behavior

We should be able to add/modify GraphQL API with Lambda authorisation using headless.

Reproduction steps

  1. amplify init
  2. amplify add function (Give function name as "hello")
  3. Create a JSON which will have configuration for the GraphQL API. You may refer the below example

myAddApiRequest.json

{
    "version": 1,
    "serviceConfiguration": {
        "serviceName": "AppSync",
        "apiName": "newHeadlessApi",
        "transformSchema": "type Salary @model @auth(rules: [{ allow: custom }]) {\r\n  id: ID!\r\n  wage: Int\r\n  currency: String\r\n}",
        "defaultAuthType": {
            "mode": "AWS_LAMBDA",
            "lambdaFunction": "hello"
        }
    }
} 
  1. Perform command cat myAddApiRequest.json | jq -c | amplify add api --headless

===Error

{"errorName":"UnknownFault","errorMessage":"Data did not validate against the supplied schema. Underlying errors were [{\"keyword\":\"enum\",\"dataPath\":\".serviceConfiguration.defaultAuthType.mode\",\"schemaPath\":\"#/definitions/AppSyncAPIKeyAuthType/properties/mode/enum\",\"params\":{\"allowedValues\":[\"API_KEY\"]},\"message\":\"should be equal to one of the allowed values\"},{\"keyword\":\"enum\",\"dataPath\":\".serviceConfiguration.defaultAuthType.mode\",\"schemaPath\":\"#/definitions/AppSyncAWSIAMAuthType/properties/mode/enum\",\"params\":{\"allowedValues\":[\"AWS_IAM\"]},\"message\":\"should be equal to one of the allowed values\"},{\"keyword\":\"enum\",\"dataPath\":\".serviceConfiguration.defaultAuthType.mode\",\"schemaPath\":\"#/definitions/AppSyncCognitoUserPoolsAuthType/properties/mode/enum\",\"params\":{\"allowedValues\":[\"AMAZON_COGNITO_USER_POOLS\"]},\"message\":\"should be equal to one of the allowed values\"},{\"keyword\":\"enum\",\"dataPath\":\".serviceConfiguration.defaultAuthType.mode\",\"schemaPath\":\"#/definitions/AppSyncOpenIDConnectAuthType/properties/mode/enum\",\"params\":{\"allowedValues\":[\"OPENID_CONNECT\"]},\"message\":\"should be equal to one of the allowed values\"},{\"keyword\":\"anyOf\",\"dataPath\":\".serviceConfiguration.defaultAuthType\",\"schemaPath\":\"#/properties/defaultAuthType/anyOf\",\"params\":{},\"message\":\"should match some schema in anyOf\"}]","resolution":"Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'","link":"https://docs.amplify.aws/cli/project/troubleshooting/"}

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • 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.
@aroradev-dms aroradev-dms added the pending-triage Issue is pending triage label Apr 19, 2024
@ykethan ykethan added feature-request Request a new feature headless Headless mode for CI/CD and removed pending-triage Issue is pending triage labels Apr 22, 2024
@vishal-dms
Copy link
Contributor

PR #13729 is merged and hence this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature headless Headless mode for CI/CD
Projects
None yet
Development

No branches or pull requests

3 participants