github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/location/trackerAssociation.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 location 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 Location Tracker Association. 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/location" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // example, err := location.NewGeofenceCollection(ctx, "example", &location.GeofenceCollectionArgs{ 33 // CollectionName: pulumi.String("example"), 34 // }) 35 // if err != nil { 36 // return err 37 // } 38 // exampleTracker, err := location.NewTracker(ctx, "example", &location.TrackerArgs{ 39 // TrackerName: pulumi.String("example"), 40 // }) 41 // if err != nil { 42 // return err 43 // } 44 // _, err = location.NewTrackerAssociation(ctx, "example", &location.TrackerAssociationArgs{ 45 // ConsumerArn: example.CollectionArn, 46 // TrackerName: exampleTracker.TrackerName, 47 // }) 48 // if err != nil { 49 // return err 50 // } 51 // return nil 52 // }) 53 // } 54 // 55 // ``` 56 // <!--End PulumiCodeChooser --> 57 // 58 // ## Import 59 // 60 // Using `pulumi import`, import Location Tracker Association using the `tracker_name|consumer_arn`. For example: 61 // 62 // ```sh 63 // $ pulumi import aws:location/trackerAssociation:TrackerAssociation example "tracker_name|consumer_arn" 64 // ``` 65 type TrackerAssociation struct { 66 pulumi.CustomResourceState 67 68 // The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all AWS. 69 ConsumerArn pulumi.StringOutput `pulumi:"consumerArn"` 70 // The name of the tracker resource to be associated with a geofence collection. 71 TrackerName pulumi.StringOutput `pulumi:"trackerName"` 72 } 73 74 // NewTrackerAssociation registers a new resource with the given unique name, arguments, and options. 75 func NewTrackerAssociation(ctx *pulumi.Context, 76 name string, args *TrackerAssociationArgs, opts ...pulumi.ResourceOption) (*TrackerAssociation, error) { 77 if args == nil { 78 return nil, errors.New("missing one or more required arguments") 79 } 80 81 if args.ConsumerArn == nil { 82 return nil, errors.New("invalid value for required argument 'ConsumerArn'") 83 } 84 if args.TrackerName == nil { 85 return nil, errors.New("invalid value for required argument 'TrackerName'") 86 } 87 opts = internal.PkgResourceDefaultOpts(opts) 88 var resource TrackerAssociation 89 err := ctx.RegisterResource("aws:location/trackerAssociation:TrackerAssociation", name, args, &resource, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return &resource, nil 94 } 95 96 // GetTrackerAssociation gets an existing TrackerAssociation resource's state with the given name, ID, and optional 97 // state properties that are used to uniquely qualify the lookup (nil if not required). 98 func GetTrackerAssociation(ctx *pulumi.Context, 99 name string, id pulumi.IDInput, state *TrackerAssociationState, opts ...pulumi.ResourceOption) (*TrackerAssociation, error) { 100 var resource TrackerAssociation 101 err := ctx.ReadResource("aws:location/trackerAssociation:TrackerAssociation", name, id, state, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // Input properties used for looking up and filtering TrackerAssociation resources. 109 type trackerAssociationState struct { 110 // The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all AWS. 111 ConsumerArn *string `pulumi:"consumerArn"` 112 // The name of the tracker resource to be associated with a geofence collection. 113 TrackerName *string `pulumi:"trackerName"` 114 } 115 116 type TrackerAssociationState struct { 117 // The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all AWS. 118 ConsumerArn pulumi.StringPtrInput 119 // The name of the tracker resource to be associated with a geofence collection. 120 TrackerName pulumi.StringPtrInput 121 } 122 123 func (TrackerAssociationState) ElementType() reflect.Type { 124 return reflect.TypeOf((*trackerAssociationState)(nil)).Elem() 125 } 126 127 type trackerAssociationArgs struct { 128 // The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all AWS. 129 ConsumerArn string `pulumi:"consumerArn"` 130 // The name of the tracker resource to be associated with a geofence collection. 131 TrackerName string `pulumi:"trackerName"` 132 } 133 134 // The set of arguments for constructing a TrackerAssociation resource. 135 type TrackerAssociationArgs struct { 136 // The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all AWS. 137 ConsumerArn pulumi.StringInput 138 // The name of the tracker resource to be associated with a geofence collection. 139 TrackerName pulumi.StringInput 140 } 141 142 func (TrackerAssociationArgs) ElementType() reflect.Type { 143 return reflect.TypeOf((*trackerAssociationArgs)(nil)).Elem() 144 } 145 146 type TrackerAssociationInput interface { 147 pulumi.Input 148 149 ToTrackerAssociationOutput() TrackerAssociationOutput 150 ToTrackerAssociationOutputWithContext(ctx context.Context) TrackerAssociationOutput 151 } 152 153 func (*TrackerAssociation) ElementType() reflect.Type { 154 return reflect.TypeOf((**TrackerAssociation)(nil)).Elem() 155 } 156 157 func (i *TrackerAssociation) ToTrackerAssociationOutput() TrackerAssociationOutput { 158 return i.ToTrackerAssociationOutputWithContext(context.Background()) 159 } 160 161 func (i *TrackerAssociation) ToTrackerAssociationOutputWithContext(ctx context.Context) TrackerAssociationOutput { 162 return pulumi.ToOutputWithContext(ctx, i).(TrackerAssociationOutput) 163 } 164 165 // TrackerAssociationArrayInput is an input type that accepts TrackerAssociationArray and TrackerAssociationArrayOutput values. 166 // You can construct a concrete instance of `TrackerAssociationArrayInput` via: 167 // 168 // TrackerAssociationArray{ TrackerAssociationArgs{...} } 169 type TrackerAssociationArrayInput interface { 170 pulumi.Input 171 172 ToTrackerAssociationArrayOutput() TrackerAssociationArrayOutput 173 ToTrackerAssociationArrayOutputWithContext(context.Context) TrackerAssociationArrayOutput 174 } 175 176 type TrackerAssociationArray []TrackerAssociationInput 177 178 func (TrackerAssociationArray) ElementType() reflect.Type { 179 return reflect.TypeOf((*[]*TrackerAssociation)(nil)).Elem() 180 } 181 182 func (i TrackerAssociationArray) ToTrackerAssociationArrayOutput() TrackerAssociationArrayOutput { 183 return i.ToTrackerAssociationArrayOutputWithContext(context.Background()) 184 } 185 186 func (i TrackerAssociationArray) ToTrackerAssociationArrayOutputWithContext(ctx context.Context) TrackerAssociationArrayOutput { 187 return pulumi.ToOutputWithContext(ctx, i).(TrackerAssociationArrayOutput) 188 } 189 190 // TrackerAssociationMapInput is an input type that accepts TrackerAssociationMap and TrackerAssociationMapOutput values. 191 // You can construct a concrete instance of `TrackerAssociationMapInput` via: 192 // 193 // TrackerAssociationMap{ "key": TrackerAssociationArgs{...} } 194 type TrackerAssociationMapInput interface { 195 pulumi.Input 196 197 ToTrackerAssociationMapOutput() TrackerAssociationMapOutput 198 ToTrackerAssociationMapOutputWithContext(context.Context) TrackerAssociationMapOutput 199 } 200 201 type TrackerAssociationMap map[string]TrackerAssociationInput 202 203 func (TrackerAssociationMap) ElementType() reflect.Type { 204 return reflect.TypeOf((*map[string]*TrackerAssociation)(nil)).Elem() 205 } 206 207 func (i TrackerAssociationMap) ToTrackerAssociationMapOutput() TrackerAssociationMapOutput { 208 return i.ToTrackerAssociationMapOutputWithContext(context.Background()) 209 } 210 211 func (i TrackerAssociationMap) ToTrackerAssociationMapOutputWithContext(ctx context.Context) TrackerAssociationMapOutput { 212 return pulumi.ToOutputWithContext(ctx, i).(TrackerAssociationMapOutput) 213 } 214 215 type TrackerAssociationOutput struct{ *pulumi.OutputState } 216 217 func (TrackerAssociationOutput) ElementType() reflect.Type { 218 return reflect.TypeOf((**TrackerAssociation)(nil)).Elem() 219 } 220 221 func (o TrackerAssociationOutput) ToTrackerAssociationOutput() TrackerAssociationOutput { 222 return o 223 } 224 225 func (o TrackerAssociationOutput) ToTrackerAssociationOutputWithContext(ctx context.Context) TrackerAssociationOutput { 226 return o 227 } 228 229 // The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all AWS. 230 func (o TrackerAssociationOutput) ConsumerArn() pulumi.StringOutput { 231 return o.ApplyT(func(v *TrackerAssociation) pulumi.StringOutput { return v.ConsumerArn }).(pulumi.StringOutput) 232 } 233 234 // The name of the tracker resource to be associated with a geofence collection. 235 func (o TrackerAssociationOutput) TrackerName() pulumi.StringOutput { 236 return o.ApplyT(func(v *TrackerAssociation) pulumi.StringOutput { return v.TrackerName }).(pulumi.StringOutput) 237 } 238 239 type TrackerAssociationArrayOutput struct{ *pulumi.OutputState } 240 241 func (TrackerAssociationArrayOutput) ElementType() reflect.Type { 242 return reflect.TypeOf((*[]*TrackerAssociation)(nil)).Elem() 243 } 244 245 func (o TrackerAssociationArrayOutput) ToTrackerAssociationArrayOutput() TrackerAssociationArrayOutput { 246 return o 247 } 248 249 func (o TrackerAssociationArrayOutput) ToTrackerAssociationArrayOutputWithContext(ctx context.Context) TrackerAssociationArrayOutput { 250 return o 251 } 252 253 func (o TrackerAssociationArrayOutput) Index(i pulumi.IntInput) TrackerAssociationOutput { 254 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TrackerAssociation { 255 return vs[0].([]*TrackerAssociation)[vs[1].(int)] 256 }).(TrackerAssociationOutput) 257 } 258 259 type TrackerAssociationMapOutput struct{ *pulumi.OutputState } 260 261 func (TrackerAssociationMapOutput) ElementType() reflect.Type { 262 return reflect.TypeOf((*map[string]*TrackerAssociation)(nil)).Elem() 263 } 264 265 func (o TrackerAssociationMapOutput) ToTrackerAssociationMapOutput() TrackerAssociationMapOutput { 266 return o 267 } 268 269 func (o TrackerAssociationMapOutput) ToTrackerAssociationMapOutputWithContext(ctx context.Context) TrackerAssociationMapOutput { 270 return o 271 } 272 273 func (o TrackerAssociationMapOutput) MapIndex(k pulumi.StringInput) TrackerAssociationOutput { 274 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TrackerAssociation { 275 return vs[0].(map[string]*TrackerAssociation)[vs[1].(string)] 276 }).(TrackerAssociationOutput) 277 } 278 279 func init() { 280 pulumi.RegisterInputType(reflect.TypeOf((*TrackerAssociationInput)(nil)).Elem(), &TrackerAssociation{}) 281 pulumi.RegisterInputType(reflect.TypeOf((*TrackerAssociationArrayInput)(nil)).Elem(), TrackerAssociationArray{}) 282 pulumi.RegisterInputType(reflect.TypeOf((*TrackerAssociationMapInput)(nil)).Elem(), TrackerAssociationMap{}) 283 pulumi.RegisterOutputType(TrackerAssociationOutput{}) 284 pulumi.RegisterOutputType(TrackerAssociationArrayOutput{}) 285 pulumi.RegisterOutputType(TrackerAssociationMapOutput{}) 286 }