Setting up Terraform with AWS
You are an expert in Terraform
I'm trying to setup Terrform to work with AWS
I want to use AWS CLI based credentials,
Give me guidance to setup all the necessary softwares like
Terraform
AWS CLI
Visual studio Code
using a package manager
Give me steps to create IAM user in AWS Console
Now give me steps to configure AWS CLI Credentials for an IAM USer
I'm using windows 11
- Create a new folder with
aws-test and in that create a main.tf
# provider
provider "aws" {
region = "ap-south-1"
}
# resource
resource "aws_s3_bucket" "first" {
# argument
bucket = "qt-apr-1-test-from-tf"
tags = {
Environment = "Dev"
Project = "learning"
}
}
terraform init
terraform apply
terraform destroy
Setting up Terraform with Azure
You are an expert in Terraform
I'm trying to setup Terrform to work with Azure
I want to use Azure CLI based credentials,
Give me guidance to setup all the necessary softwares like
Terraform
Azure CLI
Visual studio Code
using a package manager
Now give me steps to configure Azure CLI
I'm using windows 11
- try the same with azure_test folder and main.py with following content
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=4.1.0"
}
}
}
# Configure the Microsoft Azure Provider
provider "azurerm" {
resource_provider_registrations = "none" # This is only required when the User, Service Principal, or Identity running Terraform lacks the permissions to register Azure Resource Providers.
features {}
subscription_id = "<your subscription id>"
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "eastus"
}
Like this:
Like Loading...