Capstone Project Part 1 - Connection already exists

When creating a post, please add:

  • Module # must be added in the tags option of the post. (ex: Module-1)
  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook)

Keep getting the error when running the terraform command:


│ Error: creating Glue Connection (de-c4w4a1-connection-rds): operation error Glue: CreateConnection, https response error StatusCode: 400, RequestID: c2005b62-9eb1-4427-b5c6-49934d90957b, AlreadyExistsException: Connection already exists.

│ with module.extract_job.aws_glue_connection.rds_connection,
│ on modules/extract_job/glue.tf line 122, in resource “aws_glue_connection” “rds_connection”:
│ 122: resource “aws_glue_connection” “rds_connection” {



│ Error: creating IAM Role (de-c4w4a1-glue-role): operation error IAM: CreateRole, https response error StatusCode: 409, RequestID: dbe0d335-03c7-46b9-a7d1-62d1b89854e8, EntityAlreadyExists: Role with name de-c4w4a1-glue-role already exists.

│ with module.extract_job.aws_iam_role.glue_role,
│ on modules/extract_job/iam.tf line 1, in resource “aws_iam_role” “glue_role”:
│ 1: resource “aws_iam_role” “glue_role” {

try run sed -i ‘s/\r$//’ scripts/setup.sh
source scripts/setup.sh
also keep getting the same error.

Hello @HeyChong,

I couldn’t reproduce your issue but It seems your terraform apply finds those two existing resources and terminates. Then you need to run source scripts/setup.sh to set environment variables again. Can you check in the AWS console and follow these instructions to delete those resources. Then successfully run terraform apply -no-color 2> errors.txt without any erros. Hope it helps

  1. For de-c4w4a1-connection-rds go to AWS glue >connections

  1. Then IAM >roles for de-c4w4a1-glue-role: