Skip to content

Commit

Permalink
structure for a module and add tf examples (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Z4ck404 authored Sep 18, 2023
1 parent a0a2f24 commit 4b1304c
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
58 changes: 58 additions & 0 deletions examples/default-with-k8s-resources/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
provider "aws" {
region = "us-west-1"
profile = "zack-aws-profile"
}

module "add-ebs-csi-driver" {
source = "../.."

aws_profile = "zack-aws-profile"
aws_region = "us-west-1"
eks_cluster_name = "zack-eks"
}

## k8s resources for testing:
provider "kubernetes" {
}

resource "kubernetes_persistent_volume" "pv-test-ebs-csi" {
metadata {
name = "pv-test-ebs-csi"
}
spec {
capacity {
storage = "1Gi"
}
access_modes = ["ReadWriteOnce"]

}
}

resource "kubernetes_pod" "pod-with-pvc" {
metadata {
name = "pod-with-pvc"
}

spec {
volume {
name = "pv-test-ebs-csi"
persistent_volume_claim {
claim_name = "pv-test-ebs-csi"
}
}
container {
name = "with-pvc"
image = nginx
port {
container_port = "80"
name = "http-server"
}
volume_mount {
name = "pv-test-ebs-csi"
mount_path = "/usr/share/nginx/html"
}
}
}
depends_on = [ kubernetes_persistent_volume.pv-test-ebs-csi ]
}

12 changes: 12 additions & 0 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
provider "aws" {
region = "us-west-1"
profile = "zack-aws-profile"
}

module "add-ebs-csi-driver" {
source = "../.."

aws_profile = "zack-aws-profile"
aws_region = "us-west-1"
eks_cluster_name = "zack-eks"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4b1304c

Please sign in to comment.