Skip to content

opsd-io/terraform-module-aws-security-group

Repository files navigation

OPSd

Meet OPSd. The unique and effortless way of managing cloud infrastructure.

terraform-module-template

Introduction

What does the module provide?

Usage

module "module_name" {
  source  = "github.com/opsd-io/module_name?ref=v0.0.1"

  # Variables
  variable_1 = "foo"
  variable_2 = "bar"
}

IMPORTANT: Make sure not to pin to master because there may be breaking changes between releases.

Requirements

Name Version
terraform >= 1.3.1
aws ~> 5.0

Providers

Name Version
aws ~> 5.0

Modules

No modules.

Resources

Name Type
aws_security_group.main resource
aws_vpc_security_group_egress_rule.main resource
aws_vpc_security_group_ingress_rule.main resource

Inputs

Name Description Type Default Required
common_tags A map of tags to assign to every resource in this module. map(string) {} no
description Security group description. string null no
egress_rules Outbound rules (egress) for this security group.
map(object({
description = optional(string, null)
ip_protocol = optional(string, "tcp")

port_number = optional(number, null)
from_port = optional(number, null)
to_port = optional(number, null)

icmp_type = optional(number, null)
icmp_code = optional(number, null)

cidr_ipv4 = optional(string, null)
cidr_ipv6 = optional(string, null)
prefix_list_id = optional(string, null)
security_group_id = optional(string, null)
extra_tags = optional(map(string), {})
}))
{} no
ingress_rules Inbound rules (ingress) for this security group.
map(object({
description = optional(string, null)
ip_protocol = optional(string, "tcp")

port_number = optional(number, null)
from_port = optional(number, null)
to_port = optional(number, null)

icmp_type = optional(number, null)
icmp_code = optional(number, null)

cidr_ipv4 = optional(string, null)
cidr_ipv6 = optional(string, null)
prefix_list_id = optional(string, null)
security_group_id = optional(string, null)
extra_tags = optional(map(string), {})
}))
{} no
name Name of the security group. string null no
vpc_id The ID of the VPC. string n/a yes

Outputs

Name Description
arn The ARN of the security group.
egress_rules_arns The ARNs of the security group egress rules.
egress_rules_ids The IDs of the security group egress rules.
id The ID of the security group.
ingress_rules_arns The ARNs of the security group ingress rules.
ingress_rules_ids The IDs of the security group ingress rules.
name The name of the security group.

Examples of usage

Do you want to see how the module works? See all the usage examples.

Related modules

The list of related modules (if present).

Contributing

If you are interested in contributing to the project, see see our guide.

Support

If you have a problem with the module or want to propose a new feature, you can report it via the project's (Github) issue tracker.

If you want to discuss something in person, you can join our community on Slack.

License

Apache License 2.0