C4W4 Capstone Project Part 2, 3.1.2 terraform apply error: Connection/Role already exists

Hi,

I’ve encountered terminal crash problem whenever I run the command:
“terraform apply -target=module.data_quality”

And the output error message is like:
"
Error: creating Glue Connection (de-c4w4a2-connection-rds): operation error Glue: CreateConnection, https response error StatusCode: 400, RequestID: 776b63f7-0d1f-4a0f-bc48-1472e017bba6, AlreadyExistsException: Connection already exists.

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

Error: creating IAM Role (de-c4w4a2-glue-role): operation error IAM: CreateRole, https response error StatusCode: 409, RequestID: 73b42fec-ca97-4cdf-849a-853861f33b88, EntityAlreadyExists: Role with name de-c4w4a2-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” {
"

Could anyone help check what the problem may be? Thanks in advance!

Hello @xxhe.hk,

Those resources remained after the lab rebooted when you terraform apply and the terminal crashed. You could try and delete those resources from the AWS console:

  1. de-c4w4a2-connection-rds at AWS glue> connections

  1. de-c4w4a2-glue-role at IAM>roles

If the issue continues even after a new lab session (a few hours). You can try with the lab refresh form, it takes 1-2 business days. Thank you