On deleting AWS Rest API from UI or through AWS console or terminal with command:
aws apigateway delete-rest-api --rest-api-id 1234123412
(mentioned in aws docs)
I faced the error saying to delete base-path mappings related to RestApi in your domain,
I tried deleting it with the following cmd given in aws docs:
aws apigateway delete-base-path-mapping --domain-name 'api.domain.tld' --base-path 'dev'
I got error: An error occurred (NotFoundException) when calling DeleteBasePathMapping operation. Invalid base path mapping identifier specified
Delete the corresponding domain name from the UI (under 'Custom domain names').
After which, the RestApi can be deleted.
Related
Is it possible to use the AWS CLI tool to list the Kafka MSK topics and describe the configuration of them?
The AWS documentation defines the topic's arn as this: arn:aws:kafka:region:account-id:topic/cluster-name/cluster-uuid/topic-name
I tried to execute the following command (some parts of the id is replaced wit X and the topic name with Y):
aws --profile dev --region eu-central-1 kafka describe-configuration --arn 'arn:aws:kafka:eu-central-1:XXXXXXXXXXX:topic/sre-dev-central-km-msk/0c4e35a9-XXXX-4d32-XXXX-76aa15890225-8/YYYYYYY
But I get the following error:
An error occurred (BadRequestException) when calling the DescribeConfiguration operation: One or more of the parameters are not valid.
You are using topic ARN. But you should be using ARN of MSK configuration:
The Amazon Resource Name (ARN) that uniquely identifies an MSK configuration and all of its revisions.
You can use list-configurations to find ARN of configurations.
How could I change Stage name in AWS API Gateway? I haven't found rename function in console and neither in CLI.
For example creating new stage with CLI:
aws apigateway create-deployment --rest-api-id ${RESTAPIID} --stage-name ''
or
aws apigateway create-stage --rest-api-id abcde123456 --stage-name ThisIsMyStageName --deployment-id abdcde
My best guess is to use "update-stage" function but don't know how to do this.
The API Gateway's stage name is a ressource ID. This mean you cannot edit it.
However, you can easily create a new stage and delete the old one
I am trying to view and add tags on my web acls using aws wafv2 cli command.
Other command seems to be working properly but I am getting the following error when using ARN in tagging.
The command:
aws wafv2 list-tags-for-resource \
--resource-arn arn:aws:wafv2:us-east-1:<account_id>:global/webacl/<acl_name>/<acl_id>
Output:
An error occurred (WAFInvalidParameterException) when calling the TagResource operation:
Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other
information separated by colons or slashes., field: RESOURCE_ARN, parameter: <arn>
Any idea on why this is happening? I understand that the old version aws waf uses a different format. But I am using wafv2 now so I think I am using the correct URL format already.
Just confirmed the fix. As the comment above indicated, I just need to add the --region parameter and it needs to match the region indicated in the ARN.
Though I am not sure why this is happening as the region in my ~/.aws/config is default to us-east-1 already.
I am trying to follow this otherwise excellent post to deploy a Java-based AWS lambda app. I'm scripting it out as instructed in that post. I receive the following error when calling aws apigateway put-integration:
An error occurred (BadRequestException) when calling the
PutIntegration operation: Lambda function ARN must be in same account
I'm trying to script the creation of an API gateway to a lambda function. Here's the full deploy.sh script. I have on my local machine the requisite AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_ACCOUNT_ID environment variables.
I don't know enough to understand what that error is telling me. AFAIK, the access secret and id and account ID are all from the same IAM user.
My AWS CLI Script
aws apigateway put-integration --region ap-south-1 --rest-api-id xxttj6inea --resource-id bgncc0 --http-method GET --type AWS --integration-http-method POST --uri arn:aws:apigateway:ap-south-1:lambda:path/2019-09-20/functions/arn:arn:aws:lambda:ap-south-1:***********:function:Hello/invocations
Thank you very much in advance for any ideas/help.
This error can happen because of two reasons:
Your AWS CLI settings are incorrect. I'll implore you to check the AWS CLI configuration file, and run test API calls for the same to verify if everything is set up appropriately.
Your Lambda function belongs in one account, and your REST API in API GW belongs in another account.
I am attempting to add index fields to a cloudSearch domain I have just created, but I am getting errors doing so.
I create the domain using:
aws cloudsearch create-domain --domain-name test-run
If I view information about the domain using the below command I get results including indication the the domain has been created.
aws cloudsearch describe-domains --domain-name test-run
I can also view this information using the CloudSearch console.
However, when I try to run
cs-configure-from-batches --domain-name test-run --source scripts/SeedFile.json -c ~/.aws/credentials
I get the below error
Domain not found: test-run (Service: AmazonCloudSearchv2; Status Code: 409; Error Code: ResourceNotFound;
Solution:
the endpoint defaults to a us east endpoint. I needed to specify us-west with --endpoint on the command