This example provisions the resources to simulate the scenario2:
- EFS file system exists and optionally encrypted using KMS.
- EFS access point does not exist. It is owned by the SFTP server.
- EFS mount points exist in the target VPC Subnets.
- EFS Security Group exists and attached to the EFS mount points.
- Terraform backend provider and state locking providers are identified and bootstrapped.
- A bootstrap module/example is provided that provisions Amazon S3 for Terraform state storage and Amazon DynamoDB for Terraform state locking.
- The target VPC along with the target Subnets exist and identified via Tags.
- A vpc example is provided that provisions VPC, Subnets and related resources with example tagging.
- The example uses the following tags to identify the target VPC and Subnets.
"transfer/sftp/efs" = "1" "Env" = "DEV"
- cd to
examples/efs/scenario2
folder. - Modify the
backend "S3"
section inprovider.tf
with correct values forregion
,bucket
,dynamodb_table
, andkey
.- Use provided values as guidance.
- Modify
terraform.tfvars
to your requirements.- Use provided values as guidance.
- Make sure you are using the correct AWS Profile that has permission to provision the target resources.
aws sts get-caller-identity
- Execute
terraform init
to initialize Terraform. - Execute
terraform plan
and verify the changes. - Execute
terraform apply
and approve the changes to provision the resources.
Name | Version |
---|---|
terraform | >= v1.1.9 |
aws | >= 4.13.0 |
No providers.
Name | Source | Version |
---|---|---|
common_efs | github.com/aws-samples/aws-tf-efs//modules/aws/efs | v1.0.0 |
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
env_name | Environment name e.g. dev, prod | string |
n/a | yes |
project | Project name (prefix/suffix) to be used on all the resources identification | string |
n/a | yes |
region | The AWS Region e.g. us-east-1 for the environment | string |
n/a | yes |
subnet_tags | Tags to discover target subnets in the VPC, these tags should identify one or more subnets | map(string) |
n/a | yes |
tags | Common and mandatory tags for the resources | map(string) |
n/a | yes |
vpc_tags | Tags to discover target VPC, these tags should uniquely identify a VPC | map(string) |
n/a | yes |
efs_access_point_specs | List of EFS Access Point Specs to be created. It can be empty list. | list(object({ |
[] |
no |
efs_id | EFS File System Id, if not provided a new EFS will be created | string |
null |
no |
kms_alias | KMS Alias to discover KMS for EFS encryption, if not provided a new CMK will be created | string |
"" |
no |
security_group_tags | Tags used to discover EFS Security Group, if not provided new EFS security group will be created | map(string) |
null |
no |
Name | Description |
---|---|
efs | Elastic File System info |
efs_ap | Elastic File System Access Points |
efs_kms | KMS Keys created for EFS |