File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# S3 bucket for Vault storage
22resource "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" {
6061resource "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
Original file line number Diff line number Diff line change 1+ variable "vpc_id" {
2+ type = string
3+ }
4+
5+ variable "subnet_id" {
6+ type = string
7+ }
You can’t perform that action at this time.
0 commit comments