Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Coalfire AWS Security Group Terraform Module

License

NotificationsYou must be signed in to change notification settings

CiscoOpsStack/terraform-aws-securitygroup-ops_stack

 
 

Repository files navigation

Coalfire

AWS Security Group Terraform Module

Description

This module creates an AWS security group with a network interface attachment to connect to an existing network interface.

Dependencies

Any resources requiring security groups

Resource List

  • Security Group
  • Network Interface Associations (optional)

Deployment Steps

This module can be called as outlined below.

  • Change directories to theexamples/simple directory.
  • From theexamples/simple directory runterraform init.
  • Ensure that thetfvars/example.tfvars variables are correct (especially the profile) or create a new tfvars file with the correct variables
  • Runterraform plan -var-file tfvars/examples.tfvars (or the newly created file) to review the resources being created.
  • If everything looks correct in the plan output, runterraform apply -var-file tfvars/examples.tfvars.

Usage

The directoryexamples/simple shows a basic declaration and use of the module, whereasexamples/network-associations demonstrates the module's ability to create associations between the security group and any network interfaces (when provided with a list of desired network interface ids).

Requirements

NameVersion
terraform>= 1.5.0
aws~> 5.0

Providers

NameVersion
aws~> 5.0

Modules

No modules.

Resources

NameType
aws_network_interface_sg_attachment.thisresource
aws_security_group.thisresource
aws_vpc_security_group_egress_rule.thisresource
aws_vpc_security_group_ingress_rule.thisresource
aws_network_interface.interfacesdata source

Inputs

NameDescriptionTypeDefaultRequired
descriptionThis overwrites the default generated description for the security groupstring"Managed by Terraform"no
egress_rulesThe list of rules for egress traffic. Required fields for each rule are 'protocol', 'from_port', 'to_port', and at least one of 'cidr_blocks', 'ipv6_cidr_blocks', 'security_groups', 'self', or 'prefix_list_sg'. Optional fields are 'description' and those not used from the previous list
map(object({
cidr_ipv4 = optional(string, null)
cidr_ipv6 = optional(string, null)
description = optional(string, "Managed by Terraform")
from_port = optional(string, null)
ip_protocol = optional(string, null)
prefix_list_id = optional(string, null)
referenced_security_group_id = optional(string, null)
to_port = optional(string, null)
}))
{}no
ingress_rulesThe list of rules for ingress traffic. Required fields for each rule are 'protocol', 'from_port', 'to_port', and at least one of 'cidr_blocks', 'ipv6_cidr_blocks', 'security_groups', 'self', or 'prefix_list_sg'. Optional fields are 'description' and those not used from the previous list
map(object({
cidr_ipv4 = optional(string, null)
cidr_ipv6 = optional(string, null)
description = optional(string, "Managed by Terraform")
from_port = optional(string, null)
ip_protocol = optional(string, null)
prefix_list_id = optional(string, null)
referenced_security_group_id = optional(string, null)
to_port = optional(string, null)
}))
{}no
nameThe name of the created security group. Conflicts with 'sg_name_prefix'string""no
network_interface_resource_associationsThe IDs of already existing network interfaces to be associated with the created security group. If used, do not declare sg in the creation of those resourceslist(string)[]no
sg_name_prefixThe prefix to be used while generating a unique name for the security group. Conflicts with 'sg_name'string""no
tagsTags to add to the created security groupmap(string){}no
vpc_idThe ID of the VPC that the security group will be associated withstringnullno

Outputs

NameDescription
associated_network_interfacesThe ARNs of the network interfaces associated to the security group by this module
idThe id of the created security group

Contributing

If you're interested in contributing to our projects, please review theContributing Guidelines. And send an email toour team to receive a copy of our CLA and start the onboarding process.

License

License

Copyright

Copyright © 2023 Coalfire Systems Inc.

About

Coalfire AWS Security Group Terraform Module

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL100.0%

[8]ページ先頭

©2009-2025 Movatter.jp