Skip to content

Commit f97b458

Browse files
MukeshMukesh
authored andcommitted
update
1 parent 3d9c493 commit f97b458

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

modules/vault/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# S3 bucket for Vault storage
22
resource "aws_s3_bucket" "vault_storage" {
33
bucket = "vault-backend-bucket"
4+
force_destroy = true
45
}
56

67
# IAM policy for Vault to access the S3 bucket
@@ -60,6 +61,7 @@ resource "aws_iam_role_policy_attachment" "vault_policy_attach" {
6061
resource "aws_security_group" "vault_sg" {
6162
name = "vault-security-group"
6263
description = "Allow Vault traffic"
64+
vpc_id = var.vpc_id
6365

6466
ingress {
6567
from_port = 8200
@@ -103,6 +105,7 @@ resource "aws_instance" "vault" {
103105
instance_type = "t3.medium"
104106
iam_instance_profile = aws_iam_role.vault_role.name
105107
security_groups = [aws_security_group.vault_sg.name]
108+
subnet_id = var.subnet_id
106109

107110
user_data = <<-EOF
108111
#!/bin/bash

modules/vault/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
variable "vpc_id" {
2+
type = string
3+
}
4+
5+
variable "subnet_id" {
6+
type = string
7+
}

0 commit comments

Comments
 (0)