iann0036 / AWSConsoleRecorder

Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.
MIT License
1.43k stars 87 forks source link

AWS Console fails (requests blocked) while ACR is recording #48

Open PenelopeFudd opened 4 years ago

PenelopeFudd commented 4 years ago

Describe the bug Some AWS console pages break when ACR is recording messages.

Related Mapping sqs.createqueue

Related Language N/A

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://console.aws.amazon.com/sqs/home?region=us-west-2'
  2. Click on 'Get Started Now'
  3. Type a queue name, e.g. 'testqueue'
  4. Click on 'Quick Create Queue'
  5. See error message from AWS Console and AWS Console Recorder plugin
  6. On the ACR console, the SQS request has the region in the queue name: aws sqs create-queue --queue-name "us-west-2" --region us-east-1

Expected behavior A queue should be created.

Screenshots aws-console-recorder

Additional context

iann0036 commented 4 years ago

Hi Penelope,

This looks like the "Intercept Responses" feature. Can you confirm whether that is checked off in Dashboard > Settings > Intercept Responses?

iann0036 commented 4 years ago

Oh, I apologise, I meant the "Block Mutable Requests" feature*

Same location.

PenelopeFudd commented 4 years ago

Aha, that seems to be it.

However, it's still getting the queue name and region wrong (I'm doing all of my work in us-west-2):

aws sqs list-queues --region us-east-1

aws kms list-keys --region us-east-1

aws sqs create-queue --queue-name "us-west-2" --region us-east-1  # Actually the queue was 'test2'

aws sqs list-queues --region us-east-1

aws sqs get-queue-attributes --queue-url "https://sqs.us-west-2.amazonaws.com/123456789012/test" --attribute-names "All" --region us-east-1

aws sqs get-queue-attributes --queue-url "https://sqs.us-west-2.amazonaws.com/123456789012/test-queue" --attribute-names "All" --region us-east-1

aws sqs get-queue-attributes --queue-url "https://sqs.us-west-2.amazonaws.com/123456789012/test2" --attribute-names "All" --region us-east-1

aws sqs delete-queue --queue-url "https://sqs.us-west-2.amazonaws.com/123456789012/test2" --region us-east-1
PenelopeFudd commented 4 years ago

Perhaps make the error message about the mutable changes being blocked a little more idiot-proof, for idiots like me? :-)

Maybe say "The 'Block Mutable Requests' feature is on, click here to turn off: [x]" in the error message?

PenelopeFudd commented 4 years ago

I can imagine that mapping all of the AWS Consoles to the API is like trying to nail Jello(tm) to the wall, because they're always changing.

iann0036 commented 4 years ago

Hey Penelope,

Thanks for the feedback and apologies if I was blocking your work.

The mappings for all AWS Consoles is indeed...challenging, and it does appear that the SQS mappings have changed on me so I'll try to work on that bug sometime soon.

If you're interested, I also have another project available at https://former2.com/ (https://github.com/iann0036/former2) which does a similar thing except it scans for existing resources using the APIs which is much more reliable - so no need to record as you go. It's currently only for CloudFormation / Terraform / Troposphere and CDK outputs so if you're looking for CLI outputs this is the only thing available so far.

PenelopeFudd commented 4 years ago

I saw Former2 a few days ago, and definitely want to check it out!

I tried CloudFormer years ago and found it to be completely unusable, and then it was deprecated.

Thanks for your efforts; this really makes life easier!

AWS Console Recorder was recommended to me by an AWS Support Engineer, so you know it's got at least an unofficial seal of approval! :-)