github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/inspector/resourceGroup.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 inspector 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 // Provides an Amazon Inspector Classic Resource Group. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/inspector" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := inspector.NewResourceGroup(ctx, "example", &inspector.ResourceGroupArgs{ 33 // Tags: pulumi.StringMap{ 34 // "Name": pulumi.String("foo"), 35 // "Env": pulumi.String("bar"), 36 // }, 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 type ResourceGroup struct { 48 pulumi.CustomResourceState 49 50 // The resource group ARN. 51 Arn pulumi.StringOutput `pulumi:"arn"` 52 // Key-value map of tags that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. 53 Tags pulumi.StringMapOutput `pulumi:"tags"` 54 } 55 56 // NewResourceGroup registers a new resource with the given unique name, arguments, and options. 57 func NewResourceGroup(ctx *pulumi.Context, 58 name string, args *ResourceGroupArgs, opts ...pulumi.ResourceOption) (*ResourceGroup, error) { 59 if args == nil { 60 return nil, errors.New("missing one or more required arguments") 61 } 62 63 if args.Tags == nil { 64 return nil, errors.New("invalid value for required argument 'Tags'") 65 } 66 opts = internal.PkgResourceDefaultOpts(opts) 67 var resource ResourceGroup 68 err := ctx.RegisterResource("aws:inspector/resourceGroup:ResourceGroup", name, args, &resource, opts...) 69 if err != nil { 70 return nil, err 71 } 72 return &resource, nil 73 } 74 75 // GetResourceGroup gets an existing ResourceGroup resource's state with the given name, ID, and optional 76 // state properties that are used to uniquely qualify the lookup (nil if not required). 77 func GetResourceGroup(ctx *pulumi.Context, 78 name string, id pulumi.IDInput, state *ResourceGroupState, opts ...pulumi.ResourceOption) (*ResourceGroup, error) { 79 var resource ResourceGroup 80 err := ctx.ReadResource("aws:inspector/resourceGroup:ResourceGroup", name, id, state, &resource, opts...) 81 if err != nil { 82 return nil, err 83 } 84 return &resource, nil 85 } 86 87 // Input properties used for looking up and filtering ResourceGroup resources. 88 type resourceGroupState struct { 89 // The resource group ARN. 90 Arn *string `pulumi:"arn"` 91 // Key-value map of tags that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. 92 Tags map[string]string `pulumi:"tags"` 93 } 94 95 type ResourceGroupState struct { 96 // The resource group ARN. 97 Arn pulumi.StringPtrInput 98 // Key-value map of tags that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. 99 Tags pulumi.StringMapInput 100 } 101 102 func (ResourceGroupState) ElementType() reflect.Type { 103 return reflect.TypeOf((*resourceGroupState)(nil)).Elem() 104 } 105 106 type resourceGroupArgs struct { 107 // Key-value map of tags that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. 108 Tags map[string]string `pulumi:"tags"` 109 } 110 111 // The set of arguments for constructing a ResourceGroup resource. 112 type ResourceGroupArgs struct { 113 // Key-value map of tags that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. 114 Tags pulumi.StringMapInput 115 } 116 117 func (ResourceGroupArgs) ElementType() reflect.Type { 118 return reflect.TypeOf((*resourceGroupArgs)(nil)).Elem() 119 } 120 121 type ResourceGroupInput interface { 122 pulumi.Input 123 124 ToResourceGroupOutput() ResourceGroupOutput 125 ToResourceGroupOutputWithContext(ctx context.Context) ResourceGroupOutput 126 } 127 128 func (*ResourceGroup) ElementType() reflect.Type { 129 return reflect.TypeOf((**ResourceGroup)(nil)).Elem() 130 } 131 132 func (i *ResourceGroup) ToResourceGroupOutput() ResourceGroupOutput { 133 return i.ToResourceGroupOutputWithContext(context.Background()) 134 } 135 136 func (i *ResourceGroup) ToResourceGroupOutputWithContext(ctx context.Context) ResourceGroupOutput { 137 return pulumi.ToOutputWithContext(ctx, i).(ResourceGroupOutput) 138 } 139 140 // ResourceGroupArrayInput is an input type that accepts ResourceGroupArray and ResourceGroupArrayOutput values. 141 // You can construct a concrete instance of `ResourceGroupArrayInput` via: 142 // 143 // ResourceGroupArray{ ResourceGroupArgs{...} } 144 type ResourceGroupArrayInput interface { 145 pulumi.Input 146 147 ToResourceGroupArrayOutput() ResourceGroupArrayOutput 148 ToResourceGroupArrayOutputWithContext(context.Context) ResourceGroupArrayOutput 149 } 150 151 type ResourceGroupArray []ResourceGroupInput 152 153 func (ResourceGroupArray) ElementType() reflect.Type { 154 return reflect.TypeOf((*[]*ResourceGroup)(nil)).Elem() 155 } 156 157 func (i ResourceGroupArray) ToResourceGroupArrayOutput() ResourceGroupArrayOutput { 158 return i.ToResourceGroupArrayOutputWithContext(context.Background()) 159 } 160 161 func (i ResourceGroupArray) ToResourceGroupArrayOutputWithContext(ctx context.Context) ResourceGroupArrayOutput { 162 return pulumi.ToOutputWithContext(ctx, i).(ResourceGroupArrayOutput) 163 } 164 165 // ResourceGroupMapInput is an input type that accepts ResourceGroupMap and ResourceGroupMapOutput values. 166 // You can construct a concrete instance of `ResourceGroupMapInput` via: 167 // 168 // ResourceGroupMap{ "key": ResourceGroupArgs{...} } 169 type ResourceGroupMapInput interface { 170 pulumi.Input 171 172 ToResourceGroupMapOutput() ResourceGroupMapOutput 173 ToResourceGroupMapOutputWithContext(context.Context) ResourceGroupMapOutput 174 } 175 176 type ResourceGroupMap map[string]ResourceGroupInput 177 178 func (ResourceGroupMap) ElementType() reflect.Type { 179 return reflect.TypeOf((*map[string]*ResourceGroup)(nil)).Elem() 180 } 181 182 func (i ResourceGroupMap) ToResourceGroupMapOutput() ResourceGroupMapOutput { 183 return i.ToResourceGroupMapOutputWithContext(context.Background()) 184 } 185 186 func (i ResourceGroupMap) ToResourceGroupMapOutputWithContext(ctx context.Context) ResourceGroupMapOutput { 187 return pulumi.ToOutputWithContext(ctx, i).(ResourceGroupMapOutput) 188 } 189 190 type ResourceGroupOutput struct{ *pulumi.OutputState } 191 192 func (ResourceGroupOutput) ElementType() reflect.Type { 193 return reflect.TypeOf((**ResourceGroup)(nil)).Elem() 194 } 195 196 func (o ResourceGroupOutput) ToResourceGroupOutput() ResourceGroupOutput { 197 return o 198 } 199 200 func (o ResourceGroupOutput) ToResourceGroupOutputWithContext(ctx context.Context) ResourceGroupOutput { 201 return o 202 } 203 204 // The resource group ARN. 205 func (o ResourceGroupOutput) Arn() pulumi.StringOutput { 206 return o.ApplyT(func(v *ResourceGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 207 } 208 209 // Key-value map of tags that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. 210 func (o ResourceGroupOutput) Tags() pulumi.StringMapOutput { 211 return o.ApplyT(func(v *ResourceGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 212 } 213 214 type ResourceGroupArrayOutput struct{ *pulumi.OutputState } 215 216 func (ResourceGroupArrayOutput) ElementType() reflect.Type { 217 return reflect.TypeOf((*[]*ResourceGroup)(nil)).Elem() 218 } 219 220 func (o ResourceGroupArrayOutput) ToResourceGroupArrayOutput() ResourceGroupArrayOutput { 221 return o 222 } 223 224 func (o ResourceGroupArrayOutput) ToResourceGroupArrayOutputWithContext(ctx context.Context) ResourceGroupArrayOutput { 225 return o 226 } 227 228 func (o ResourceGroupArrayOutput) Index(i pulumi.IntInput) ResourceGroupOutput { 229 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResourceGroup { 230 return vs[0].([]*ResourceGroup)[vs[1].(int)] 231 }).(ResourceGroupOutput) 232 } 233 234 type ResourceGroupMapOutput struct{ *pulumi.OutputState } 235 236 func (ResourceGroupMapOutput) ElementType() reflect.Type { 237 return reflect.TypeOf((*map[string]*ResourceGroup)(nil)).Elem() 238 } 239 240 func (o ResourceGroupMapOutput) ToResourceGroupMapOutput() ResourceGroupMapOutput { 241 return o 242 } 243 244 func (o ResourceGroupMapOutput) ToResourceGroupMapOutputWithContext(ctx context.Context) ResourceGroupMapOutput { 245 return o 246 } 247 248 func (o ResourceGroupMapOutput) MapIndex(k pulumi.StringInput) ResourceGroupOutput { 249 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResourceGroup { 250 return vs[0].(map[string]*ResourceGroup)[vs[1].(string)] 251 }).(ResourceGroupOutput) 252 } 253 254 func init() { 255 pulumi.RegisterInputType(reflect.TypeOf((*ResourceGroupInput)(nil)).Elem(), &ResourceGroup{}) 256 pulumi.RegisterInputType(reflect.TypeOf((*ResourceGroupArrayInput)(nil)).Elem(), ResourceGroupArray{}) 257 pulumi.RegisterInputType(reflect.TypeOf((*ResourceGroupMapInput)(nil)).Elem(), ResourceGroupMap{}) 258 pulumi.RegisterOutputType(ResourceGroupOutput{}) 259 pulumi.RegisterOutputType(ResourceGroupArrayOutput{}) 260 pulumi.RegisterOutputType(ResourceGroupMapOutput{}) 261 }