Skip to content

Commit b350c69

Browse files
committed
add resources for organizational-unit module
1 parent 8677803 commit b350c69

File tree

6 files changed

+32
-0
lines changed

6 files changed

+32
-0
lines changed

data.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data "aws_organizations_organization" "org" {}

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resource "aws_organizations_organizational_unit" "this" {
2+
name = var.name
3+
parent_id = data.aws_organizations_organization.org.roots[0].id
4+
}

outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "id" {
2+
description = "The ID of the organizational unit"
3+
value = aws_organizations_organizational_unit.this.id
4+
}

provider.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
provider "aws" {
2+
region = "ap-south-1"
3+
4+
default_tags {
5+
tags = {
6+
ManagedBy = "Terraform"
7+
}
8+
}
9+
}

variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
variable "name" {
2+
description = "The name of the organizational unit"
3+
type = string
4+
}

versions.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
version = "~> 5.51.0"
6+
}
7+
}
8+
9+
required_version = "~> 1.8.4"
10+
}

0 commit comments

Comments
 (0)