/
securityGroup.ts
253 lines (244 loc) · 11 KB
/
securityGroup.ts
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
// *** 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! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as utilities from "../utilities";
/**
* > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/security_group.html.markdown.
*/
export class SecurityGroup extends pulumi.CustomResource {
/**
* Get an existing SecurityGroup resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SecurityGroupState, opts?: pulumi.CustomResourceOptions): SecurityGroup {
return new SecurityGroup(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'aws:ec2/securityGroup:SecurityGroup';
/**
* Returns true if the given object is an instance of SecurityGroup. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is SecurityGroup {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SecurityGroup.__pulumiType;
}
/**
* The ARN of the security group
*/
public /*out*/ readonly arn!: pulumi.Output<string>;
/**
* The security group description. Defaults to
* "Managed by Pulumi". Cannot be "". __NOTE__: This field maps to the AWS
* `GroupDescription` attribute, for which there is no Update API. If you'd like
* to classify your security groups in a way that can be updated, use `tags`.
*/
public readonly description!: pulumi.Output<string>;
/**
* Can be specified multiple times for each
* egress rule. Each egress block supports fields documented below.
* This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html).
*/
public readonly egress!: pulumi.Output<outputs.ec2.SecurityGroupEgress[]>;
/**
* Can be specified multiple times for each
* ingress rule. Each ingress block supports fields documented below.
* This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html).
*/
public readonly ingress!: pulumi.Output<outputs.ec2.SecurityGroupIngress[]>;
/**
* The name of the security group. If omitted, this provider will
* assign a random, unique name
*/
public readonly name!: pulumi.Output<string>;
/**
* Creates a unique name beginning with the specified
* prefix. Conflicts with `name`.
*/
public readonly namePrefix!: pulumi.Output<string | undefined>;
/**
* The owner ID.
*/
public /*out*/ readonly ownerId!: pulumi.Output<string>;
/**
* Instruct this provider to revoke all of the
* Security Groups attached ingress and egress rules before deleting the rule
* itself. This is normally not needed, however certain AWS services such as
* Elastic Map Reduce may automatically add required rules to security groups used
* with the service, and those rules may contain a cyclic dependency that prevent
* the security groups from being destroyed without removing the dependency first.
* Default `false`
*/
public readonly revokeRulesOnDelete!: pulumi.Output<boolean | undefined>;
/**
* A mapping of tags to assign to the resource.
*/
public readonly tags!: pulumi.Output<{[key: string]: any} | undefined>;
/**
* The VPC ID.
*/
public readonly vpcId!: pulumi.Output<string>;
/**
* Create a SecurityGroup resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: SecurityGroupArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: SecurityGroupArgs | SecurityGroupState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as SecurityGroupState | undefined;
inputs["arn"] = state ? state.arn : undefined;
inputs["description"] = state ? state.description : undefined;
inputs["egress"] = state ? state.egress : undefined;
inputs["ingress"] = state ? state.ingress : undefined;
inputs["name"] = state ? state.name : undefined;
inputs["namePrefix"] = state ? state.namePrefix : undefined;
inputs["ownerId"] = state ? state.ownerId : undefined;
inputs["revokeRulesOnDelete"] = state ? state.revokeRulesOnDelete : undefined;
inputs["tags"] = state ? state.tags : undefined;
inputs["vpcId"] = state ? state.vpcId : undefined;
} else {
const args = argsOrState as SecurityGroupArgs | undefined;
inputs["description"] = (args ? args.description : undefined) || "Managed by Pulumi";
inputs["egress"] = args ? args.egress : undefined;
inputs["ingress"] = args ? args.ingress : undefined;
inputs["name"] = args ? args.name : undefined;
inputs["namePrefix"] = args ? args.namePrefix : undefined;
inputs["revokeRulesOnDelete"] = args ? args.revokeRulesOnDelete : undefined;
inputs["tags"] = args ? args.tags : undefined;
inputs["vpcId"] = args ? args.vpcId : undefined;
inputs["arn"] = undefined /*out*/;
inputs["ownerId"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(SecurityGroup.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering SecurityGroup resources.
*/
export interface SecurityGroupState {
/**
* The ARN of the security group
*/
readonly arn?: pulumi.Input<string>;
/**
* The security group description. Defaults to
* "Managed by Pulumi". Cannot be "". __NOTE__: This field maps to the AWS
* `GroupDescription` attribute, for which there is no Update API. If you'd like
* to classify your security groups in a way that can be updated, use `tags`.
*/
readonly description?: pulumi.Input<string>;
/**
* Can be specified multiple times for each
* egress rule. Each egress block supports fields documented below.
* This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html).
*/
readonly egress?: pulumi.Input<pulumi.Input<inputs.ec2.SecurityGroupEgress>[]>;
/**
* Can be specified multiple times for each
* ingress rule. Each ingress block supports fields documented below.
* This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html).
*/
readonly ingress?: pulumi.Input<pulumi.Input<inputs.ec2.SecurityGroupIngress>[]>;
/**
* The name of the security group. If omitted, this provider will
* assign a random, unique name
*/
readonly name?: pulumi.Input<string>;
/**
* Creates a unique name beginning with the specified
* prefix. Conflicts with `name`.
*/
readonly namePrefix?: pulumi.Input<string>;
/**
* The owner ID.
*/
readonly ownerId?: pulumi.Input<string>;
/**
* Instruct this provider to revoke all of the
* Security Groups attached ingress and egress rules before deleting the rule
* itself. This is normally not needed, however certain AWS services such as
* Elastic Map Reduce may automatically add required rules to security groups used
* with the service, and those rules may contain a cyclic dependency that prevent
* the security groups from being destroyed without removing the dependency first.
* Default `false`
*/
readonly revokeRulesOnDelete?: pulumi.Input<boolean>;
/**
* A mapping of tags to assign to the resource.
*/
readonly tags?: pulumi.Input<{[key: string]: any}>;
/**
* The VPC ID.
*/
readonly vpcId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a SecurityGroup resource.
*/
export interface SecurityGroupArgs {
/**
* The security group description. Defaults to
* "Managed by Pulumi". Cannot be "". __NOTE__: This field maps to the AWS
* `GroupDescription` attribute, for which there is no Update API. If you'd like
* to classify your security groups in a way that can be updated, use `tags`.
*/
readonly description?: pulumi.Input<string>;
/**
* Can be specified multiple times for each
* egress rule. Each egress block supports fields documented below.
* This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html).
*/
readonly egress?: pulumi.Input<pulumi.Input<inputs.ec2.SecurityGroupEgress>[]>;
/**
* Can be specified multiple times for each
* ingress rule. Each ingress block supports fields documented below.
* This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html).
*/
readonly ingress?: pulumi.Input<pulumi.Input<inputs.ec2.SecurityGroupIngress>[]>;
/**
* The name of the security group. If omitted, this provider will
* assign a random, unique name
*/
readonly name?: pulumi.Input<string>;
/**
* Creates a unique name beginning with the specified
* prefix. Conflicts with `name`.
*/
readonly namePrefix?: pulumi.Input<string>;
/**
* Instruct this provider to revoke all of the
* Security Groups attached ingress and egress rules before deleting the rule
* itself. This is normally not needed, however certain AWS services such as
* Elastic Map Reduce may automatically add required rules to security groups used
* with the service, and those rules may contain a cyclic dependency that prevent
* the security groups from being destroyed without removing the dependency first.
* Default `false`
*/
readonly revokeRulesOnDelete?: pulumi.Input<boolean>;
/**
* A mapping of tags to assign to the resource.
*/
readonly tags?: pulumi.Input<{[key: string]: any}>;
/**
* The VPC ID.
*/
readonly vpcId?: pulumi.Input<string>;
}