github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/workspaces/ipGroup.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 workspaces 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides an IP access control group in AWS WorkSpaces Service 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/workspaces" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := workspaces.NewIpGroup(ctx, "contractors", &workspaces.IpGroupArgs{ 32 // Name: pulumi.String("Contractors"), 33 // Description: pulumi.String("Contractors IP access control group"), 34 // Rules: workspaces.IpGroupRuleArray{ 35 // &workspaces.IpGroupRuleArgs{ 36 // Source: pulumi.String("150.24.14.0/24"), 37 // Description: pulumi.String("NY"), 38 // }, 39 // &workspaces.IpGroupRuleArgs{ 40 // Source: pulumi.String("125.191.14.85/32"), 41 // Description: pulumi.String("LA"), 42 // }, 43 // &workspaces.IpGroupRuleArgs{ 44 // Source: pulumi.String("44.98.100.0/24"), 45 // Description: pulumi.String("STL"), 46 // }, 47 // }, 48 // }) 49 // if err != nil { 50 // return err 51 // } 52 // return nil 53 // }) 54 // } 55 // 56 // ``` 57 // <!--End PulumiCodeChooser --> 58 // 59 // ## Import 60 // 61 // Using `pulumi import`, import WorkSpaces IP groups using their GroupID. For example: 62 // 63 // ```sh 64 // $ pulumi import aws:workspaces/ipGroup:IpGroup example wsipg-488lrtl3k 65 // ``` 66 type IpGroup struct { 67 pulumi.CustomResourceState 68 69 // The description of the IP group. 70 Description pulumi.StringPtrOutput `pulumi:"description"` 71 // The name of the IP group. 72 Name pulumi.StringOutput `pulumi:"name"` 73 // One or more pairs specifying the IP group rule (in CIDR format) from which web requests originate. 74 Rules IpGroupRuleArrayOutput `pulumi:"rules"` 75 // A map of tags assigned to the WorkSpaces directory. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 76 Tags pulumi.StringMapOutput `pulumi:"tags"` 77 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 78 // 79 // Deprecated: Please use `tags` instead. 80 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 81 } 82 83 // NewIpGroup registers a new resource with the given unique name, arguments, and options. 84 func NewIpGroup(ctx *pulumi.Context, 85 name string, args *IpGroupArgs, opts ...pulumi.ResourceOption) (*IpGroup, error) { 86 if args == nil { 87 args = &IpGroupArgs{} 88 } 89 90 opts = internal.PkgResourceDefaultOpts(opts) 91 var resource IpGroup 92 err := ctx.RegisterResource("aws:workspaces/ipGroup:IpGroup", name, args, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // GetIpGroup gets an existing IpGroup resource's state with the given name, ID, and optional 100 // state properties that are used to uniquely qualify the lookup (nil if not required). 101 func GetIpGroup(ctx *pulumi.Context, 102 name string, id pulumi.IDInput, state *IpGroupState, opts ...pulumi.ResourceOption) (*IpGroup, error) { 103 var resource IpGroup 104 err := ctx.ReadResource("aws:workspaces/ipGroup:IpGroup", name, id, state, &resource, opts...) 105 if err != nil { 106 return nil, err 107 } 108 return &resource, nil 109 } 110 111 // Input properties used for looking up and filtering IpGroup resources. 112 type ipGroupState struct { 113 // The description of the IP group. 114 Description *string `pulumi:"description"` 115 // The name of the IP group. 116 Name *string `pulumi:"name"` 117 // One or more pairs specifying the IP group rule (in CIDR format) from which web requests originate. 118 Rules []IpGroupRule `pulumi:"rules"` 119 // A map of tags assigned to the WorkSpaces directory. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 120 Tags map[string]string `pulumi:"tags"` 121 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 122 // 123 // Deprecated: Please use `tags` instead. 124 TagsAll map[string]string `pulumi:"tagsAll"` 125 } 126 127 type IpGroupState struct { 128 // The description of the IP group. 129 Description pulumi.StringPtrInput 130 // The name of the IP group. 131 Name pulumi.StringPtrInput 132 // One or more pairs specifying the IP group rule (in CIDR format) from which web requests originate. 133 Rules IpGroupRuleArrayInput 134 // A map of tags assigned to the WorkSpaces directory. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 135 Tags pulumi.StringMapInput 136 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 137 // 138 // Deprecated: Please use `tags` instead. 139 TagsAll pulumi.StringMapInput 140 } 141 142 func (IpGroupState) ElementType() reflect.Type { 143 return reflect.TypeOf((*ipGroupState)(nil)).Elem() 144 } 145 146 type ipGroupArgs struct { 147 // The description of the IP group. 148 Description *string `pulumi:"description"` 149 // The name of the IP group. 150 Name *string `pulumi:"name"` 151 // One or more pairs specifying the IP group rule (in CIDR format) from which web requests originate. 152 Rules []IpGroupRule `pulumi:"rules"` 153 // A map of tags assigned to the WorkSpaces directory. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 154 Tags map[string]string `pulumi:"tags"` 155 } 156 157 // The set of arguments for constructing a IpGroup resource. 158 type IpGroupArgs struct { 159 // The description of the IP group. 160 Description pulumi.StringPtrInput 161 // The name of the IP group. 162 Name pulumi.StringPtrInput 163 // One or more pairs specifying the IP group rule (in CIDR format) from which web requests originate. 164 Rules IpGroupRuleArrayInput 165 // A map of tags assigned to the WorkSpaces directory. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 166 Tags pulumi.StringMapInput 167 } 168 169 func (IpGroupArgs) ElementType() reflect.Type { 170 return reflect.TypeOf((*ipGroupArgs)(nil)).Elem() 171 } 172 173 type IpGroupInput interface { 174 pulumi.Input 175 176 ToIpGroupOutput() IpGroupOutput 177 ToIpGroupOutputWithContext(ctx context.Context) IpGroupOutput 178 } 179 180 func (*IpGroup) ElementType() reflect.Type { 181 return reflect.TypeOf((**IpGroup)(nil)).Elem() 182 } 183 184 func (i *IpGroup) ToIpGroupOutput() IpGroupOutput { 185 return i.ToIpGroupOutputWithContext(context.Background()) 186 } 187 188 func (i *IpGroup) ToIpGroupOutputWithContext(ctx context.Context) IpGroupOutput { 189 return pulumi.ToOutputWithContext(ctx, i).(IpGroupOutput) 190 } 191 192 // IpGroupArrayInput is an input type that accepts IpGroupArray and IpGroupArrayOutput values. 193 // You can construct a concrete instance of `IpGroupArrayInput` via: 194 // 195 // IpGroupArray{ IpGroupArgs{...} } 196 type IpGroupArrayInput interface { 197 pulumi.Input 198 199 ToIpGroupArrayOutput() IpGroupArrayOutput 200 ToIpGroupArrayOutputWithContext(context.Context) IpGroupArrayOutput 201 } 202 203 type IpGroupArray []IpGroupInput 204 205 func (IpGroupArray) ElementType() reflect.Type { 206 return reflect.TypeOf((*[]*IpGroup)(nil)).Elem() 207 } 208 209 func (i IpGroupArray) ToIpGroupArrayOutput() IpGroupArrayOutput { 210 return i.ToIpGroupArrayOutputWithContext(context.Background()) 211 } 212 213 func (i IpGroupArray) ToIpGroupArrayOutputWithContext(ctx context.Context) IpGroupArrayOutput { 214 return pulumi.ToOutputWithContext(ctx, i).(IpGroupArrayOutput) 215 } 216 217 // IpGroupMapInput is an input type that accepts IpGroupMap and IpGroupMapOutput values. 218 // You can construct a concrete instance of `IpGroupMapInput` via: 219 // 220 // IpGroupMap{ "key": IpGroupArgs{...} } 221 type IpGroupMapInput interface { 222 pulumi.Input 223 224 ToIpGroupMapOutput() IpGroupMapOutput 225 ToIpGroupMapOutputWithContext(context.Context) IpGroupMapOutput 226 } 227 228 type IpGroupMap map[string]IpGroupInput 229 230 func (IpGroupMap) ElementType() reflect.Type { 231 return reflect.TypeOf((*map[string]*IpGroup)(nil)).Elem() 232 } 233 234 func (i IpGroupMap) ToIpGroupMapOutput() IpGroupMapOutput { 235 return i.ToIpGroupMapOutputWithContext(context.Background()) 236 } 237 238 func (i IpGroupMap) ToIpGroupMapOutputWithContext(ctx context.Context) IpGroupMapOutput { 239 return pulumi.ToOutputWithContext(ctx, i).(IpGroupMapOutput) 240 } 241 242 type IpGroupOutput struct{ *pulumi.OutputState } 243 244 func (IpGroupOutput) ElementType() reflect.Type { 245 return reflect.TypeOf((**IpGroup)(nil)).Elem() 246 } 247 248 func (o IpGroupOutput) ToIpGroupOutput() IpGroupOutput { 249 return o 250 } 251 252 func (o IpGroupOutput) ToIpGroupOutputWithContext(ctx context.Context) IpGroupOutput { 253 return o 254 } 255 256 // The description of the IP group. 257 func (o IpGroupOutput) Description() pulumi.StringPtrOutput { 258 return o.ApplyT(func(v *IpGroup) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 259 } 260 261 // The name of the IP group. 262 func (o IpGroupOutput) Name() pulumi.StringOutput { 263 return o.ApplyT(func(v *IpGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 264 } 265 266 // One or more pairs specifying the IP group rule (in CIDR format) from which web requests originate. 267 func (o IpGroupOutput) Rules() IpGroupRuleArrayOutput { 268 return o.ApplyT(func(v *IpGroup) IpGroupRuleArrayOutput { return v.Rules }).(IpGroupRuleArrayOutput) 269 } 270 271 // A map of tags assigned to the WorkSpaces directory. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 272 func (o IpGroupOutput) Tags() pulumi.StringMapOutput { 273 return o.ApplyT(func(v *IpGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 274 } 275 276 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 277 // 278 // Deprecated: Please use `tags` instead. 279 func (o IpGroupOutput) TagsAll() pulumi.StringMapOutput { 280 return o.ApplyT(func(v *IpGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 281 } 282 283 type IpGroupArrayOutput struct{ *pulumi.OutputState } 284 285 func (IpGroupArrayOutput) ElementType() reflect.Type { 286 return reflect.TypeOf((*[]*IpGroup)(nil)).Elem() 287 } 288 289 func (o IpGroupArrayOutput) ToIpGroupArrayOutput() IpGroupArrayOutput { 290 return o 291 } 292 293 func (o IpGroupArrayOutput) ToIpGroupArrayOutputWithContext(ctx context.Context) IpGroupArrayOutput { 294 return o 295 } 296 297 func (o IpGroupArrayOutput) Index(i pulumi.IntInput) IpGroupOutput { 298 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IpGroup { 299 return vs[0].([]*IpGroup)[vs[1].(int)] 300 }).(IpGroupOutput) 301 } 302 303 type IpGroupMapOutput struct{ *pulumi.OutputState } 304 305 func (IpGroupMapOutput) ElementType() reflect.Type { 306 return reflect.TypeOf((*map[string]*IpGroup)(nil)).Elem() 307 } 308 309 func (o IpGroupMapOutput) ToIpGroupMapOutput() IpGroupMapOutput { 310 return o 311 } 312 313 func (o IpGroupMapOutput) ToIpGroupMapOutputWithContext(ctx context.Context) IpGroupMapOutput { 314 return o 315 } 316 317 func (o IpGroupMapOutput) MapIndex(k pulumi.StringInput) IpGroupOutput { 318 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IpGroup { 319 return vs[0].(map[string]*IpGroup)[vs[1].(string)] 320 }).(IpGroupOutput) 321 } 322 323 func init() { 324 pulumi.RegisterInputType(reflect.TypeOf((*IpGroupInput)(nil)).Elem(), &IpGroup{}) 325 pulumi.RegisterInputType(reflect.TypeOf((*IpGroupArrayInput)(nil)).Elem(), IpGroupArray{}) 326 pulumi.RegisterInputType(reflect.TypeOf((*IpGroupMapInput)(nil)).Elem(), IpGroupMap{}) 327 pulumi.RegisterOutputType(IpGroupOutput{}) 328 pulumi.RegisterOutputType(IpGroupArrayOutput{}) 329 pulumi.RegisterOutputType(IpGroupMapOutput{}) 330 }