/
securityGroup.go
101 lines (88 loc) · 3.53 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
// *** 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 redshift
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Creates a new Amazon Redshift security group. You use security groups to control access to non-VPC clusters
type SecurityGroup struct {
pulumi.CustomResourceState
// The description of the Redshift security group. Defaults to "Managed by Pulumi".
Description pulumi.StringOutput `pulumi:"description"`
// A list of ingress rules.
Ingress SecurityGroupIngressArrayOutput `pulumi:"ingress"`
// The name of the Redshift security group.
Name pulumi.StringOutput `pulumi:"name"`
}
// 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.Ingress == nil {
return nil, errors.New("missing required argument 'Ingress'")
}
if args == nil {
args = &SecurityGroupArgs{}
}
if args.Description == nil {
args.Description = pulumi.StringPtr("Managed by Pulumi")
}
var resource SecurityGroup
err := ctx.RegisterResource("aws:redshift/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:redshift/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 {
// The description of the Redshift security group. Defaults to "Managed by Pulumi".
Description *string `pulumi:"description"`
// A list of ingress rules.
Ingress []SecurityGroupIngress `pulumi:"ingress"`
// The name of the Redshift security group.
Name *string `pulumi:"name"`
}
type SecurityGroupState struct {
// The description of the Redshift security group. Defaults to "Managed by Pulumi".
Description pulumi.StringPtrInput
// A list of ingress rules.
Ingress SecurityGroupIngressArrayInput
// The name of the Redshift security group.
Name pulumi.StringPtrInput
}
func (SecurityGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*securityGroupState)(nil)).Elem()
}
type securityGroupArgs struct {
// The description of the Redshift security group. Defaults to "Managed by Pulumi".
Description *string `pulumi:"description"`
// A list of ingress rules.
Ingress []SecurityGroupIngress `pulumi:"ingress"`
// The name of the Redshift security group.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a SecurityGroup resource.
type SecurityGroupArgs struct {
// The description of the Redshift security group. Defaults to "Managed by Pulumi".
Description pulumi.StringPtrInput
// A list of ingress rules.
Ingress SecurityGroupIngressArrayInput
// The name of the Redshift security group.
Name pulumi.StringPtrInput
}
func (SecurityGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*securityGroupArgs)(nil)).Elem()
}