C4W4 Capstone Project Part 1

I am having issues with the capstone project part1, I ran out of time (3hs) and recieved a message from AWS (my lab expired). Can i get graded or restart the lab from scratch? How can I do it? I tried rebooting, but now when I try to apply terraform i get an error because the IAM Role already exists…
"
Error: creating Glue Connection (de-c4w4a1-connection-rds): operation error Glue: CreateConnection, https response error StatusCode: 400, RequestID: 6339731b-6d7a-4da3-8ab1-64498076f57a, 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-c4w4a1-glue-role): operation error IAM: CreateRole, https response error StatusCode: 409, RequestID: 647c2f58-fbd9-4f21-ae50-335ad78f31d9, 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” {
"

Also, I found a mistake (dont know if it was on purpose)— in the glue-tf file detailed below i was instructed to set the subnet to private, but only works using public…
Error trying to apply terraform…

In the following line of glue.tf in module/extract_job:
At the physical_connection_requirements configuration, set the subnet_id to data.aws_subnet.private_a.id and
the security_group_id_list to a list containing the element data.aws_security_group.db_sg.id
physical_connection_requirements {
availability_zone = data.aws_subnet.public_a.availability_zone
security_group_id_list = [data.aws_security_group.db_sg.id]
subnet_id = data.aws_subnet.private_a.id
}
}
Error:
Reference to undeclared resource

│ on modules/extract_job/glue.tf line 17, in resource “aws_glue_connection” “rds_connection”:
│ 17: subnet_id = data.aws_subnet.private_a.id

│ A data resource “aws_subnet” “private_a” has not been declared in module.extract_job.

coder@5b018b7982b2:~/project/terraform$

Thanks!!!

Hello @joaco368
Please, fill out this form which directs you to the lab refresh form, and then try the lab again once your lab has been refreshed. It usually takes our engineers about 2 business days after you fill out the form to refresh your lab.

1 Like

Thanks Amir! The issues with capstone part 2 were solved. I dont know if changes were made in the aws account… I am only missing the capstone project part 1 to complete the course, the lab refresh will enable me to start the lab from scratch? since the issues made me change lots of terraform files that i cant restore to the original versions. I already filled the form: issue insufficient lake formation… Thank you!!

You are welcome. Yes, I think all your files will be reset after the lab refresh.

I recieved a message that they restarted the lab succesfully but they didnt erase me all the files so i can start from scratch. They duplicated some files from the glue.tf (maintaining previous files) and add a new ones (scratch) but the lab is still not working… even the source scripts/setup.sh is raising errors… It cant be… now i have to wait for 2 more days (tomorrow i have to pay again because of deeplearning.ai/coursera/aws mistakes

@Amir_Zare source scripts/setup.sh
: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [–] [arg …]

’ doesn’t match a supported format.
bash: $‘\r’: command not found

’ doesn’t match a supported format.

’ doesn’t match a supported format.

’ doesn’t match a supported format.

:slight_smile: && ends_with(Name, data-lake)].Name: Bad jmespath expression: Bad token de-c4w4a1
) && ends_with(Name, data-lake`)].Name
^

’ doesn’t match a supported format.

’ doesn’t match a supported format.
bash: '\r': command not found bash: ‘\r’: command not found

’ doesn’t match a supported format.
: No such file or directory/project/scripts
bash: $‘\r’: command not found
Setup completed successfully. All environment variables and Terraform backend configurations have been set.

Hello @joaco368
Sorry for the inconvenience. I will try my best to understand the issue you are facing and help you resolve it.
First of all, are you using the Vocareum UI or Coursera UI? Can you please give me a screenshot of the page where you open the notebook?
Secondly, can you please try running sed -i 's/\r$//' scripts/setup.sh command before source scripts/setup.sh?

im running into same issue. after typing the command you suggest i got the error messages:
An error occurred (InvalidClientTokenId) when calling the DescribeDBInstances operation: The security token included in the request is invalid.

An error occurred (AuthFailure) when calling the DescribeSubnets operation: Authorization header or parameters are not formatted correctly.

An error occurred (InvalidClientTokenId) when calling the DescribeDBInstances operation: The security token included in the request is invalid.

An error occurred (InvalidClientTokenId) when calling the DescribeDBInstances operation: The security token included in the request is invalid.

An error occurred (AuthorizationHeaderMalformed) when calling the ListBuckets operation: The authorization header is malformed; a non-empty Access Key (AKID) must be provided in the credential.

An error occurred (InvalidClientTokenId) when calling the DescribeClusters operation: The security token included in the request is invalid.

An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.

An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.

Hello @evandrocardozo
Are you getting this error after runing sed -i 's/\r$//' scripts/setup.sh?

after source scripts/setup.sh