Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Aveek aveek22

🏠
Working from home
View GitHub Profile
View s3.tf
variable "bucket_name" {}
resource aws_s3_bucket "tf_multi_workspace_bucket" {
bucket = var.bucket_name
}
View main.tf
locals {
bucket_name = "tf-multi-account-test-1234-${terraform.workspace}"
}
module "s3_bucket_dev" {
source = "./modules/s3"
count = terraform.workspace == "dev" ? 1 : 0
providers = {
aws = aws.dev
}
View provider.tf
terraform {
required_version = "1.1.9"
required_providers {
aws = {
source = "hashicorp/aws"
version = "> 4.26.0"
}
}
}
View terraform.apply.out
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.s3_main_bucket.aws_s3_bucket.main_bucket will be created
+ resource "aws_s3_bucket" "main_bucket" {
+ acceleration_status = (known after apply)
+ acl = (known after apply)
+ arn = (known after apply)
View terraform.plan.out
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.s3_dependent_bucket.aws_s3_bucket.dependent_bucket will be created
+ resource "aws_s3_bucket" "dependent_bucket" {
+ acceleration_status = (known after apply)
+ acl = (known after apply)
View dependent.main.tf
resource "aws_s3_bucket" "dependent_bucket" {
bucket = "dependent-bucket-00721"
tags = {
"Name" = "Dependent Bucket"
"Environment" = "Test"
}
}
View main.tf
resource "aws_s3_bucket" "main_bucket" {
bucket = "main-bucket-00721"
tags = {
"Name" = "Main Bucket"
"Environment" = "Test"
}
}
View root.tf
module "s3_main_bucket" {
source = "./modules/main-bucket"
}
module "s3_dependent_bucket" {
source = "./modules/dependent-bucket"
depends_on = [
module.s3_main_bucket
]
}
View social_linkedin_share_post_organization.py
url = "https://api.linkedin.com/v2/shares"
headers = {
'Authorization' : f'Bearer {access_token}',
'Content-Type' : 'application/json'
}
payload = {
"content": {
"contentEntities": [
View social_linkedin_share_post_personal.py
url = "https://api.linkedin.com/v2/shares"
headers = {
'Authorization' : f'Bearer {access_token}',
'Content-Type' : 'application/json'
}
payload = {
"content": {
"contentEntities": [