package securitygroup

import "github.com/oslokommune/okctl/pkg/cfn/components/securitygroup"

Package securitygroup knows how to create cloud formation for security groups

Index

Functions

func PatchAppendEgressRule

func PatchAppendEgressRule(originalTemplate []byte, resourceName string, rule api.Rule) ([]byte, error)

PatchAppendEgressRule appends an egress rule to an existing cfn stack template

func PatchAppendIngressRule

func PatchAppendIngressRule(originalTemplate []byte, resourceName string, rule api.Rule) ([]byte, error)

PatchAppendIngressRule appends an ingress rule to an existing cfn stack template

func PatchRemoveEgressRule

func PatchRemoveEgressRule(originalTemplate []byte, resourceName string, rule api.Rule) ([]byte, error)

PatchRemoveEgressRule removes an egress rule from an existing cfn stack template

func PatchRemoveIngressRule

func PatchRemoveIngressRule(originalTemplate []byte, resourceName string, rule api.Rule) ([]byte, error)

PatchRemoveIngressRule removes an ingress rule from an existing cfn stack template

Types

type NewSecurityGroupOpts

type NewSecurityGroupOpts struct {
	Name         string
	Description  string
	ResourceName string
	VPCID        string

	InboundRules  []api.Rule
	OutboundRules []api.Rule
}

NewSecurityGroupOpts contains required data for creating a security group

type SecurityGroup

type SecurityGroup struct {
	StoredName string
	Group      *ec2.SecurityGroup
}

SecurityGroup stores state required for creating a cloud formation security group

func NewLambdaFunctionOutgoing

func NewLambdaFunctionOutgoing(groupName, resourceName, vpcID string, cidrs []string) *SecurityGroup

NewLambdaFunctionOutgoing allows the lambda function to communicate on the correct ports and cidrs

func NewPostgresIncoming

func NewPostgresIncoming(groupName, resourceName, vpcID string, sources ...cfn.Namer) *SecurityGroup

NewPostgresIncoming returns an initialised security group that allows incoming traffic to the postgres database instance

func NewPostgresOutgoing

func NewPostgresOutgoing(groupName, resourceName, vpcID string, cidrs []string) *SecurityGroup

NewPostgresOutgoing returns an initialised security group that allows outgoing traffic from the pod or node to the postgres subnets on the postgres port

func NewRDSPGSMVPCEndpointIncoming

func NewRDSPGSMVPCEndpointIncoming(groupName, resourceName, vpcID string, source cfn.Namer) *SecurityGroup

NewRDSPGSMVPCEndpointIncoming allows incoming traffic to the VPC SM endpoint

func NewSecurityGroup

func NewSecurityGroup(opts NewSecurityGroupOpts) *SecurityGroup

NewSecurityGroup initializes a new SecurityGroup

func (*SecurityGroup) Name

func (s *SecurityGroup) Name() string

Name returns the name of the cloud formation resource

func (*SecurityGroup) NamedOutputs

func (s *SecurityGroup) NamedOutputs() map[string]cloudformation.Output

NamedOutputs returns the outputs commonly used by other stacks or components

func (*SecurityGroup) Ref

func (s *SecurityGroup) Ref() string

Ref returns a cloud formation intrinsic ref to the resource

func (*SecurityGroup) Resource

func (s *SecurityGroup) Resource() cloudformation.Resource

Resource returns the cloud formation resource for creating a SG

Source Files

helpers.go patching.go securitygroup.go

Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
10 packages
Last checked
4 days ago

Tools for package owners.