Aws_glue_connection Issue Programming Assignment: Assignment 2: Building a Data Lakehouse with AWS Lake Formation and Apache Iceberg

Module

Programming Assignment: Assignment 2: Building a Data Lakehouse with AWS Lake Formation and Apache Iceberg

Issue

I am unable to complete the lab because of a discrepancy between the resources in AWS and the state of the terraform file. The resources exist in AWS, but are not reflected in the Terraform state file.

Description

While working on the lap, I got a message in the terminal (see screenshot). I believe this happened when deploying to terraform. When I re-loaded the lab and tried things again, I got an error that flashes for a moment saying that the aws_glue_connection already exists and it appears that it is trying to re-create all the resources again.

I tried to use terraform destroy but since the state doesn’t match the resources, it can’t destroy the resources. I guess my only option is to wait and try the assignment again later.

I tried to reboot the server, as well as deleted files and clicked the “get latest version” button

Hey all, I ended up getting past it by manually removing the connection. The next issue I faced was related to the tables not being created.

Output exceeds the size limit. Open the full output data in a text editor
INFO:root:Grant Data location access to: arn:aws:iam::757279685015:role/de-c3w2a1-glue-role 

ERROR:root:Error details: Traceback (most recent call last):
  File "/home/coder/project/scripts/lf_utils.py", line 86, in grant_database_access
    response_grant_permissions = lf_client.grant_permissions(
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py", line 553, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py", line 1009, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.InvalidInputException: An error occurred (InvalidInputException) when calling the GrantPermissions operation: Database not found.
 An error occurred (InvalidInputException) when calling the GrantPermissions operation: Database not found. 

ERROR:root:Couldn't grant curated_zone access: arn:aws:iam::757279685015:role/de-c3w2a1-glue-role

ERROR:root:Error details: Traceback (most recent call last):
  File "/home/coder/project/scripts/lf_utils.py", line 86, in grant_database_access
    response_grant_permissions = lf_client.grant_permissions(
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py", line 553, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py", line 1009, in _make_api_call
    raise error_class(parsed_response, operation_name)
...
 An error occurred (InvalidInputException) when calling the GrantPermissions operation: Database not found. 

ERROR:root:Couldn't grant presentation_zone access: arn:aws:iam::757279685015:role/de-c3w2a1-glue-role

When I tried to get permissions . I guess the tables were removed at some point though it wasn’t manually done when I was trying to fix my previous issue.

I tried removing files, clicking “getting latest version”, as well as tried “reboot”

Hello @Seandburt,

Sorry for the late response. Since some of your resources are already there but looks missing I suggest to fill this form. You should wait 2-3 business days for the process to complete and let us know when it is resolved. Hope it helps