Sasa
Sasa

Reputation: 1

Terraform init seems to work but nothing happens in AWS

I'm trying to create database with permissions on AWS using terraform.

resource "aws_glue_catalog_database" "database" {
  name = "database"
}

resource "aws_lakeformation_permissions" "db" {
  permissions = ["ALL"]
  principal = "arn:aws:iam::number:user/name”

  database {
    name       = aws_glue_catalog_database.database.name
    catalog_id = aws_glue_catalog_database.database.catalog_id
  }
}

When I run the terraform init it says Terraform has been successfully initialized! but in the AWS the database does not appear. I ran it multiple times and always the same.

Initializing the backend...
Initializing modules...

Initializing provider plugins...
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using previously-installed hashicorp/aws v4.59.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

I've tried to delete the .terraform folder and rerun it and I get the same result.

Upvotes: -3

Views: 155

Answers (1)

Marcin
Marcin

Reputation: 238131

You have to execute terraform apply to actually execute your code and provision the infrastructure. You can use plan to pre-view the execution if you want.

Upvotes: 1

Related Questions