/
securityGroup.go
111 lines (98 loc) · 4.27 KB
/
securityGroup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package elasticache
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// 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.
type SecurityGroup struct {
pulumi.CustomResourceState
// description for the cache security group. Defaults to "Managed by Pulumi".
Description pulumi.StringOutput `pulumi:"description"`
// Name for the cache security group. This value is stored as a lowercase string.
Name pulumi.StringOutput `pulumi:"name"`
// List of EC2 security group names to be
// authorized for ingress to the cache security group
SecurityGroupNames pulumi.StringArrayOutput `pulumi:"securityGroupNames"`
}
// NewSecurityGroup registers a new resource with the given unique name, arguments, and options.
func NewSecurityGroup(ctx *pulumi.Context,
name string, args *SecurityGroupArgs, opts ...pulumi.ResourceOption) (*SecurityGroup, error) {
if args == nil || args.SecurityGroupNames == nil {
return nil, errors.New("missing required argument 'SecurityGroupNames'")
}
if args == nil {
args = &SecurityGroupArgs{}
}
if args.Description == nil {
args.Description = pulumi.StringPtr("Managed by Pulumi")
}
var resource SecurityGroup
err := ctx.RegisterResource("aws:elasticache/securityGroup:SecurityGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSecurityGroup gets an existing SecurityGroup resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSecurityGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SecurityGroupState, opts ...pulumi.ResourceOption) (*SecurityGroup, error) {
var resource SecurityGroup
err := ctx.ReadResource("aws:elasticache/securityGroup:SecurityGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SecurityGroup resources.
type securityGroupState struct {
// description for the cache security group. Defaults to "Managed by Pulumi".
Description *string `pulumi:"description"`
// Name for the cache security group. This value is stored as a lowercase string.
Name *string `pulumi:"name"`
// List of EC2 security group names to be
// authorized for ingress to the cache security group
SecurityGroupNames []string `pulumi:"securityGroupNames"`
}
type SecurityGroupState struct {
// description for the cache security group. Defaults to "Managed by Pulumi".
Description pulumi.StringPtrInput
// Name for the cache security group. This value is stored as a lowercase string.
Name pulumi.StringPtrInput
// List of EC2 security group names to be
// authorized for ingress to the cache security group
SecurityGroupNames pulumi.StringArrayInput
}
func (SecurityGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*securityGroupState)(nil)).Elem()
}
type securityGroupArgs struct {
// description for the cache security group. Defaults to "Managed by Pulumi".
Description *string `pulumi:"description"`
// Name for the cache security group. This value is stored as a lowercase string.
Name *string `pulumi:"name"`
// List of EC2 security group names to be
// authorized for ingress to the cache security group
SecurityGroupNames []string `pulumi:"securityGroupNames"`
}
// The set of arguments for constructing a SecurityGroup resource.
type SecurityGroupArgs struct {
// description for the cache security group. Defaults to "Managed by Pulumi".
Description pulumi.StringPtrInput
// Name for the cache security group. This value is stored as a lowercase string.
Name pulumi.StringPtrInput
// List of EC2 security group names to be
// authorized for ingress to the cache security group
SecurityGroupNames pulumi.StringArrayInput
}
func (SecurityGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*securityGroupArgs)(nil)).Elem()
}