loading...

Discussion on: Deploying Elixir (2 of 3): Terraforming an AWS EC2 Instance

Collapse
mazz profile image
Michael

Hi thanks for putting this together.

I'm encountering an error at 'terraform apply'. I can't seem to make a security group.

This is my aws block

provider "aws" {
  region = "us-west-1" # Set the region available to you
  shared_credentials_file = "~/.aws/credentials"
  profile = "default"
}

and my ~/.aws/credentials file:

[default]
aws_access_key_id = secret
aws_secret_access_key = secret

any suggestions? I just generated the keys so I'm pretty sure they should work.


aws_key_pair.webhook_processor_kp: Creating...
aws_security_group.webhook_processor_sg: Creating...

Error: Error creating Security Group: UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message: qCmU-SF-TxAb-pYfkSH6sR-Vn0CVDLDanDiiv4L9RTbOU9pU8DUH41XxSM5ZY0xsaX1-t-DUFAhzmZdJ7_ssFmRmyf_9-ZuLl9x90Ny-AeO2oErwyb8vn2ncvH80OwsCPfAFVhnURjdP-ScEXPPOGQSBl9HN4VDFvZIjE8aMN24y-lNGer3UlsHuMSmAzPp-NVLl4ZaAv0Wb6Ut3vaq0yloBAmBQhqQ3RAd5hbfD6NE4SA-CNQ4u1_2U7NUCdXJW4wLwWVlUljWnXcBGSpZF-P8LmDL1qTvmlzB3FrdbKgGhevb7E6dweNBA4LGynez-cktWtD31iDh0nIIVy7tW-ImjxWqZoAgx1EgKrm-Yk6FXeIrNLIbrOpxujKnbDo_ONASgQxZNFViWQU9ZwvF2A6OUkaEUCT0C2LNOVXlSRA69ccmDY-tA7onnbIujFbvjVxV-e8MdfcUEEAh9D75m3X837gvwL4USfl-jCpuau9r48bz0eXtBart685EWn5Su-JtNQB8H20qwnSU7aHZpYjPXSr8_N5o
    status code: 403, request id: cf69bd63-9855-4f1f-a192-414d520c3864

  on webhook_processor.tf line 10, in resource "aws_security_group" "webhook_processor_sg":
  10: resource "aws_security_group" "webhook_processor_sg" {



Error: Error import KeyPair: UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message: _aR8ZUoQxse8lt9c3DBn6SwXgteZD32KMigZ3YN3ZJ0qhYzZASdRyv1_bN0HAJwvdQwVCKVae3ImWEVoI6l0G8APA4zhGdxzOeaeihPwvqddE9b1Qp_O06t2e62YgAAhPTJp5rA8Vnn1t3zsK-N2Lf--AVb5QwmFiAvzusjsAtTS0P-xfDUHwfhV_7qW8aCONfnYl7mjhyx98V7-tz9PmBJCfJ-gJKBI6eFwDcuep7rc30Pl8p7h8shU0jSZGvH8f5Txoz_oYGOorIRFSDTeLh-H2nqDekcXtqFBqD4PzcsZ_OuT4fc6c-K-s2uMGDEGr5RZGQEfQAEtF2Y2F_rGV80MnLDDLdjqtfoNb6_LB6riYu0DrnTANu09vUBOfZFFqfT0QojqHbHvEKMDmh6qdJMc-zvtUHtjaJbWcp9uNMoOQUqcaQG8h72gX3DwhIqVzxERDUlBkhla9kOF0V5vsbKVzstfwBf7wXCApOgMeLib32MlpgDs4tbF6GnxQXay5AB9ewl7rGpXDFh0Ct72VsEDiaX_ZAk9cqwze1UnNhzPcg
    status code: 403, request id: 5a659db4-46fe-404b-b554-a35f3c24a665

  on webhook_processor.tf line 37, in resource "aws_key_pair" "webhook_processor_kp":
  37: resource "aws_key_pair" "webhook_processor_kp" {
Collapse
mazz profile image
Michael

Nevermind! The problem was that I was using an IAM key. When I used a Root Key it worked.. Leaving this here for others.