SecurityGroup

Provides an ElastiCache Security Group to control access to one or more cache clusters.

NOTE: ElastiCache Security Groups are for use only when working with an ElastiCache cluster outside of a VPC. If you are using a VPC, see the ElastiCache Subnet Group resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var barSecurityGroup = new Aws.Ec2.SecurityGroup("barSecurityGroup", new Aws.Ec2.SecurityGroupArgs
        {
        });
        var barElasticache_securityGroupSecurityGroup = new Aws.ElastiCache.SecurityGroup("barElasticache/securityGroupSecurityGroup", new Aws.ElastiCache.SecurityGroupArgs
        {
            SecurityGroupNames = 
            {
                barSecurityGroup.Name,
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/elasticache"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        barSecurityGroup, err := ec2.NewSecurityGroup(ctx, "barSecurityGroup", nil)
        if err != nil {
            return err
        }
        _, err = elasticache.NewSecurityGroup(ctx, "barElasticache_securityGroupSecurityGroup", &elasticache.SecurityGroupArgs{
            SecurityGroupNames: pulumi.StringArray{
                barSecurityGroup.Name,
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

bar_security_group = aws.ec2.SecurityGroup("barSecurityGroup")
bar_elasticache_security_group_security_group = aws.elasticache.SecurityGroup("barElasticache/securityGroupSecurityGroup", security_group_names=[bar_security_group.name])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const barEc2SecurityGroup = new aws.ec2.SecurityGroup("bar", {});
const barSecurityGroup = new aws.elasticache.SecurityGroup("bar", {
    securityGroupNames: [barEc2SecurityGroup.name],
});

Create a SecurityGroup Resource

def SecurityGroup(resource_name, opts=None, description=None, name=None, security_group_names=None, __props__=None);
name string
The unique name of the resource.
args SecurityGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SecurityGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SecurityGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

SecurityGroup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The SecurityGroup resource accepts the following input properties:

SecurityGroupNames List<string>

List of EC2 security group names to be authorized for ingress to the cache security group

Description string

description for the cache security group. Defaults to “Managed by Pulumi”.

Name string

Name for the cache security group. This value is stored as a lowercase string.

SecurityGroupNames []string

List of EC2 security group names to be authorized for ingress to the cache security group

Description string

description for the cache security group. Defaults to “Managed by Pulumi”.

Name string

Name for the cache security group. This value is stored as a lowercase string.

securityGroupNames string[]

List of EC2 security group names to be authorized for ingress to the cache security group

description string

description for the cache security group. Defaults to “Managed by Pulumi”.

name string

Name for the cache security group. This value is stored as a lowercase string.

security_group_names List[str]

List of EC2 security group names to be authorized for ingress to the cache security group

description str

description for the cache security group. Defaults to “Managed by Pulumi”.

name str

Name for the cache security group. This value is stored as a lowercase string.

Outputs

All input properties are implicitly available as output properties. Additionally, the SecurityGroup resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing SecurityGroup Resource

Get an existing SecurityGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SecurityGroupState, opts?: CustomResourceOptions): SecurityGroup
static get(resource_name, id, opts=None, description=None, name=None, security_group_names=None, __props__=None);
func GetSecurityGroup(ctx *Context, name string, id IDInput, state *SecurityGroupState, opts ...ResourceOption) (*SecurityGroup, error)
public static SecurityGroup Get(string name, Input<string> id, SecurityGroupState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Description string

description for the cache security group. Defaults to “Managed by Pulumi”.

Name string

Name for the cache security group. This value is stored as a lowercase string.

SecurityGroupNames List<string>

List of EC2 security group names to be authorized for ingress to the cache security group

Description string

description for the cache security group. Defaults to “Managed by Pulumi”.

Name string

Name for the cache security group. This value is stored as a lowercase string.

SecurityGroupNames []string

List of EC2 security group names to be authorized for ingress to the cache security group

description string

description for the cache security group. Defaults to “Managed by Pulumi”.

name string

Name for the cache security group. This value is stored as a lowercase string.

securityGroupNames string[]

List of EC2 security group names to be authorized for ingress to the cache security group

description str

description for the cache security group. Defaults to “Managed by Pulumi”.

name str

Name for the cache security group. This value is stored as a lowercase string.

security_group_names List[str]

List of EC2 security group names to be authorized for ingress to the cache security group

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.