github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/medialive/inputSecurityGroup.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package medialive 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Resource for managing an AWS MediaLive InputSecurityGroup. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/medialive" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := medialive.NewInputSecurityGroup(ctx, "example", &medialive.InputSecurityGroupArgs{ 35 // WhitelistRules: medialive.InputSecurityGroupWhitelistRuleArray{ 36 // &medialive.InputSecurityGroupWhitelistRuleArgs{ 37 // Cidr: pulumi.String("10.0.0.8/32"), 38 // }, 39 // }, 40 // Tags: pulumi.StringMap{ 41 // "ENVIRONMENT": pulumi.String("prod"), 42 // }, 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 // 54 // ## Import 55 // 56 // Using `pulumi import`, import MediaLive InputSecurityGroup using the `id`. For example: 57 // 58 // ```sh 59 // $ pulumi import aws:medialive/inputSecurityGroup:InputSecurityGroup example 123456 60 // ``` 61 type InputSecurityGroup struct { 62 pulumi.CustomResourceState 63 64 // ARN of the InputSecurityGroup. 65 Arn pulumi.StringOutput `pulumi:"arn"` 66 // The list of inputs currently using this InputSecurityGroup. 67 Inputs pulumi.StringArrayOutput `pulumi:"inputs"` 68 // A map of tags to assign to the InputSecurityGroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 69 Tags pulumi.StringMapOutput `pulumi:"tags"` 70 // Deprecated: Please use `tags` instead. 71 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 72 // Whitelist rules. See Whitelist Rules for more details. 73 // 74 // The following arguments are optional: 75 WhitelistRules InputSecurityGroupWhitelistRuleArrayOutput `pulumi:"whitelistRules"` 76 } 77 78 // NewInputSecurityGroup registers a new resource with the given unique name, arguments, and options. 79 func NewInputSecurityGroup(ctx *pulumi.Context, 80 name string, args *InputSecurityGroupArgs, opts ...pulumi.ResourceOption) (*InputSecurityGroup, error) { 81 if args == nil { 82 return nil, errors.New("missing one or more required arguments") 83 } 84 85 if args.WhitelistRules == nil { 86 return nil, errors.New("invalid value for required argument 'WhitelistRules'") 87 } 88 opts = internal.PkgResourceDefaultOpts(opts) 89 var resource InputSecurityGroup 90 err := ctx.RegisterResource("aws:medialive/inputSecurityGroup:InputSecurityGroup", name, args, &resource, opts...) 91 if err != nil { 92 return nil, err 93 } 94 return &resource, nil 95 } 96 97 // GetInputSecurityGroup gets an existing InputSecurityGroup resource's state with the given name, ID, and optional 98 // state properties that are used to uniquely qualify the lookup (nil if not required). 99 func GetInputSecurityGroup(ctx *pulumi.Context, 100 name string, id pulumi.IDInput, state *InputSecurityGroupState, opts ...pulumi.ResourceOption) (*InputSecurityGroup, error) { 101 var resource InputSecurityGroup 102 err := ctx.ReadResource("aws:medialive/inputSecurityGroup:InputSecurityGroup", name, id, state, &resource, opts...) 103 if err != nil { 104 return nil, err 105 } 106 return &resource, nil 107 } 108 109 // Input properties used for looking up and filtering InputSecurityGroup resources. 110 type inputSecurityGroupState struct { 111 // ARN of the InputSecurityGroup. 112 Arn *string `pulumi:"arn"` 113 // The list of inputs currently using this InputSecurityGroup. 114 Inputs []string `pulumi:"inputs"` 115 // A map of tags to assign to the InputSecurityGroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 116 Tags map[string]string `pulumi:"tags"` 117 // Deprecated: Please use `tags` instead. 118 TagsAll map[string]string `pulumi:"tagsAll"` 119 // Whitelist rules. See Whitelist Rules for more details. 120 // 121 // The following arguments are optional: 122 WhitelistRules []InputSecurityGroupWhitelistRule `pulumi:"whitelistRules"` 123 } 124 125 type InputSecurityGroupState struct { 126 // ARN of the InputSecurityGroup. 127 Arn pulumi.StringPtrInput 128 // The list of inputs currently using this InputSecurityGroup. 129 Inputs pulumi.StringArrayInput 130 // A map of tags to assign to the InputSecurityGroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 131 Tags pulumi.StringMapInput 132 // Deprecated: Please use `tags` instead. 133 TagsAll pulumi.StringMapInput 134 // Whitelist rules. See Whitelist Rules for more details. 135 // 136 // The following arguments are optional: 137 WhitelistRules InputSecurityGroupWhitelistRuleArrayInput 138 } 139 140 func (InputSecurityGroupState) ElementType() reflect.Type { 141 return reflect.TypeOf((*inputSecurityGroupState)(nil)).Elem() 142 } 143 144 type inputSecurityGroupArgs struct { 145 // A map of tags to assign to the InputSecurityGroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 146 Tags map[string]string `pulumi:"tags"` 147 // Whitelist rules. See Whitelist Rules for more details. 148 // 149 // The following arguments are optional: 150 WhitelistRules []InputSecurityGroupWhitelistRule `pulumi:"whitelistRules"` 151 } 152 153 // The set of arguments for constructing a InputSecurityGroup resource. 154 type InputSecurityGroupArgs struct { 155 // A map of tags to assign to the InputSecurityGroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 156 Tags pulumi.StringMapInput 157 // Whitelist rules. See Whitelist Rules for more details. 158 // 159 // The following arguments are optional: 160 WhitelistRules InputSecurityGroupWhitelistRuleArrayInput 161 } 162 163 func (InputSecurityGroupArgs) ElementType() reflect.Type { 164 return reflect.TypeOf((*inputSecurityGroupArgs)(nil)).Elem() 165 } 166 167 type InputSecurityGroupInput interface { 168 pulumi.Input 169 170 ToInputSecurityGroupOutput() InputSecurityGroupOutput 171 ToInputSecurityGroupOutputWithContext(ctx context.Context) InputSecurityGroupOutput 172 } 173 174 func (*InputSecurityGroup) ElementType() reflect.Type { 175 return reflect.TypeOf((**InputSecurityGroup)(nil)).Elem() 176 } 177 178 func (i *InputSecurityGroup) ToInputSecurityGroupOutput() InputSecurityGroupOutput { 179 return i.ToInputSecurityGroupOutputWithContext(context.Background()) 180 } 181 182 func (i *InputSecurityGroup) ToInputSecurityGroupOutputWithContext(ctx context.Context) InputSecurityGroupOutput { 183 return pulumi.ToOutputWithContext(ctx, i).(InputSecurityGroupOutput) 184 } 185 186 // InputSecurityGroupArrayInput is an input type that accepts InputSecurityGroupArray and InputSecurityGroupArrayOutput values. 187 // You can construct a concrete instance of `InputSecurityGroupArrayInput` via: 188 // 189 // InputSecurityGroupArray{ InputSecurityGroupArgs{...} } 190 type InputSecurityGroupArrayInput interface { 191 pulumi.Input 192 193 ToInputSecurityGroupArrayOutput() InputSecurityGroupArrayOutput 194 ToInputSecurityGroupArrayOutputWithContext(context.Context) InputSecurityGroupArrayOutput 195 } 196 197 type InputSecurityGroupArray []InputSecurityGroupInput 198 199 func (InputSecurityGroupArray) ElementType() reflect.Type { 200 return reflect.TypeOf((*[]*InputSecurityGroup)(nil)).Elem() 201 } 202 203 func (i InputSecurityGroupArray) ToInputSecurityGroupArrayOutput() InputSecurityGroupArrayOutput { 204 return i.ToInputSecurityGroupArrayOutputWithContext(context.Background()) 205 } 206 207 func (i InputSecurityGroupArray) ToInputSecurityGroupArrayOutputWithContext(ctx context.Context) InputSecurityGroupArrayOutput { 208 return pulumi.ToOutputWithContext(ctx, i).(InputSecurityGroupArrayOutput) 209 } 210 211 // InputSecurityGroupMapInput is an input type that accepts InputSecurityGroupMap and InputSecurityGroupMapOutput values. 212 // You can construct a concrete instance of `InputSecurityGroupMapInput` via: 213 // 214 // InputSecurityGroupMap{ "key": InputSecurityGroupArgs{...} } 215 type InputSecurityGroupMapInput interface { 216 pulumi.Input 217 218 ToInputSecurityGroupMapOutput() InputSecurityGroupMapOutput 219 ToInputSecurityGroupMapOutputWithContext(context.Context) InputSecurityGroupMapOutput 220 } 221 222 type InputSecurityGroupMap map[string]InputSecurityGroupInput 223 224 func (InputSecurityGroupMap) ElementType() reflect.Type { 225 return reflect.TypeOf((*map[string]*InputSecurityGroup)(nil)).Elem() 226 } 227 228 func (i InputSecurityGroupMap) ToInputSecurityGroupMapOutput() InputSecurityGroupMapOutput { 229 return i.ToInputSecurityGroupMapOutputWithContext(context.Background()) 230 } 231 232 func (i InputSecurityGroupMap) ToInputSecurityGroupMapOutputWithContext(ctx context.Context) InputSecurityGroupMapOutput { 233 return pulumi.ToOutputWithContext(ctx, i).(InputSecurityGroupMapOutput) 234 } 235 236 type InputSecurityGroupOutput struct{ *pulumi.OutputState } 237 238 func (InputSecurityGroupOutput) ElementType() reflect.Type { 239 return reflect.TypeOf((**InputSecurityGroup)(nil)).Elem() 240 } 241 242 func (o InputSecurityGroupOutput) ToInputSecurityGroupOutput() InputSecurityGroupOutput { 243 return o 244 } 245 246 func (o InputSecurityGroupOutput) ToInputSecurityGroupOutputWithContext(ctx context.Context) InputSecurityGroupOutput { 247 return o 248 } 249 250 // ARN of the InputSecurityGroup. 251 func (o InputSecurityGroupOutput) Arn() pulumi.StringOutput { 252 return o.ApplyT(func(v *InputSecurityGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 253 } 254 255 // The list of inputs currently using this InputSecurityGroup. 256 func (o InputSecurityGroupOutput) Inputs() pulumi.StringArrayOutput { 257 return o.ApplyT(func(v *InputSecurityGroup) pulumi.StringArrayOutput { return v.Inputs }).(pulumi.StringArrayOutput) 258 } 259 260 // A map of tags to assign to the InputSecurityGroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 261 func (o InputSecurityGroupOutput) Tags() pulumi.StringMapOutput { 262 return o.ApplyT(func(v *InputSecurityGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 263 } 264 265 // Deprecated: Please use `tags` instead. 266 func (o InputSecurityGroupOutput) TagsAll() pulumi.StringMapOutput { 267 return o.ApplyT(func(v *InputSecurityGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 268 } 269 270 // Whitelist rules. See Whitelist Rules for more details. 271 // 272 // The following arguments are optional: 273 func (o InputSecurityGroupOutput) WhitelistRules() InputSecurityGroupWhitelistRuleArrayOutput { 274 return o.ApplyT(func(v *InputSecurityGroup) InputSecurityGroupWhitelistRuleArrayOutput { return v.WhitelistRules }).(InputSecurityGroupWhitelistRuleArrayOutput) 275 } 276 277 type InputSecurityGroupArrayOutput struct{ *pulumi.OutputState } 278 279 func (InputSecurityGroupArrayOutput) ElementType() reflect.Type { 280 return reflect.TypeOf((*[]*InputSecurityGroup)(nil)).Elem() 281 } 282 283 func (o InputSecurityGroupArrayOutput) ToInputSecurityGroupArrayOutput() InputSecurityGroupArrayOutput { 284 return o 285 } 286 287 func (o InputSecurityGroupArrayOutput) ToInputSecurityGroupArrayOutputWithContext(ctx context.Context) InputSecurityGroupArrayOutput { 288 return o 289 } 290 291 func (o InputSecurityGroupArrayOutput) Index(i pulumi.IntInput) InputSecurityGroupOutput { 292 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *InputSecurityGroup { 293 return vs[0].([]*InputSecurityGroup)[vs[1].(int)] 294 }).(InputSecurityGroupOutput) 295 } 296 297 type InputSecurityGroupMapOutput struct{ *pulumi.OutputState } 298 299 func (InputSecurityGroupMapOutput) ElementType() reflect.Type { 300 return reflect.TypeOf((*map[string]*InputSecurityGroup)(nil)).Elem() 301 } 302 303 func (o InputSecurityGroupMapOutput) ToInputSecurityGroupMapOutput() InputSecurityGroupMapOutput { 304 return o 305 } 306 307 func (o InputSecurityGroupMapOutput) ToInputSecurityGroupMapOutputWithContext(ctx context.Context) InputSecurityGroupMapOutput { 308 return o 309 } 310 311 func (o InputSecurityGroupMapOutput) MapIndex(k pulumi.StringInput) InputSecurityGroupOutput { 312 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *InputSecurityGroup { 313 return vs[0].(map[string]*InputSecurityGroup)[vs[1].(string)] 314 }).(InputSecurityGroupOutput) 315 } 316 317 func init() { 318 pulumi.RegisterInputType(reflect.TypeOf((*InputSecurityGroupInput)(nil)).Elem(), &InputSecurityGroup{}) 319 pulumi.RegisterInputType(reflect.TypeOf((*InputSecurityGroupArrayInput)(nil)).Elem(), InputSecurityGroupArray{}) 320 pulumi.RegisterInputType(reflect.TypeOf((*InputSecurityGroupMapInput)(nil)).Elem(), InputSecurityGroupMap{}) 321 pulumi.RegisterOutputType(InputSecurityGroupOutput{}) 322 pulumi.RegisterOutputType(InputSecurityGroupArrayOutput{}) 323 pulumi.RegisterOutputType(InputSecurityGroupMapOutput{}) 324 }