github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/gamelift/script.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 gamelift 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 GameLift Script resource. 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/gamelift" 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 := gamelift.NewScript(ctx, "example", &gamelift.ScriptArgs{ 32 // Name: pulumi.String("example-script"), 33 // StorageLocation: &gamelift.ScriptStorageLocationArgs{ 34 // Bucket: pulumi.Any(exampleAwsS3Bucket.Id), 35 // Key: pulumi.Any(exampleAwsS3Object.Key), 36 // RoleArn: pulumi.Any(exampleAwsIamRole.Arn), 37 // }, 38 // }) 39 // if err != nil { 40 // return err 41 // } 42 // return nil 43 // }) 44 // } 45 // 46 // ``` 47 // <!--End PulumiCodeChooser --> 48 // 49 // ## Import 50 // 51 // Using `pulumi import`, import GameLift Scripts using the ID. For example: 52 // 53 // ```sh 54 // $ pulumi import aws:gamelift/script:Script example <script-id> 55 // ``` 56 type Script struct { 57 pulumi.CustomResourceState 58 59 // GameLift Script ARN. 60 Arn pulumi.StringOutput `pulumi:"arn"` 61 // Name of the script 62 Name pulumi.StringOutput `pulumi:"name"` 63 // Information indicating where your game script files are stored. See below. 64 StorageLocation ScriptStorageLocationOutput `pulumi:"storageLocation"` 65 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 66 Tags pulumi.StringMapOutput `pulumi:"tags"` 67 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 68 // 69 // Deprecated: Please use `tags` instead. 70 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 71 // Version that is associated with this script. 72 Version pulumi.StringPtrOutput `pulumi:"version"` 73 // A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB. 74 ZipFile pulumi.StringPtrOutput `pulumi:"zipFile"` 75 } 76 77 // NewScript registers a new resource with the given unique name, arguments, and options. 78 func NewScript(ctx *pulumi.Context, 79 name string, args *ScriptArgs, opts ...pulumi.ResourceOption) (*Script, error) { 80 if args == nil { 81 args = &ScriptArgs{} 82 } 83 84 opts = internal.PkgResourceDefaultOpts(opts) 85 var resource Script 86 err := ctx.RegisterResource("aws:gamelift/script:Script", name, args, &resource, opts...) 87 if err != nil { 88 return nil, err 89 } 90 return &resource, nil 91 } 92 93 // GetScript gets an existing Script resource's state with the given name, ID, and optional 94 // state properties that are used to uniquely qualify the lookup (nil if not required). 95 func GetScript(ctx *pulumi.Context, 96 name string, id pulumi.IDInput, state *ScriptState, opts ...pulumi.ResourceOption) (*Script, error) { 97 var resource Script 98 err := ctx.ReadResource("aws:gamelift/script:Script", name, id, state, &resource, opts...) 99 if err != nil { 100 return nil, err 101 } 102 return &resource, nil 103 } 104 105 // Input properties used for looking up and filtering Script resources. 106 type scriptState struct { 107 // GameLift Script ARN. 108 Arn *string `pulumi:"arn"` 109 // Name of the script 110 Name *string `pulumi:"name"` 111 // Information indicating where your game script files are stored. See below. 112 StorageLocation *ScriptStorageLocation `pulumi:"storageLocation"` 113 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 114 Tags map[string]string `pulumi:"tags"` 115 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 116 // 117 // Deprecated: Please use `tags` instead. 118 TagsAll map[string]string `pulumi:"tagsAll"` 119 // Version that is associated with this script. 120 Version *string `pulumi:"version"` 121 // A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB. 122 ZipFile *string `pulumi:"zipFile"` 123 } 124 125 type ScriptState struct { 126 // GameLift Script ARN. 127 Arn pulumi.StringPtrInput 128 // Name of the script 129 Name pulumi.StringPtrInput 130 // Information indicating where your game script files are stored. See below. 131 StorageLocation ScriptStorageLocationPtrInput 132 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 133 Tags pulumi.StringMapInput 134 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 135 // 136 // Deprecated: Please use `tags` instead. 137 TagsAll pulumi.StringMapInput 138 // Version that is associated with this script. 139 Version pulumi.StringPtrInput 140 // A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB. 141 ZipFile pulumi.StringPtrInput 142 } 143 144 func (ScriptState) ElementType() reflect.Type { 145 return reflect.TypeOf((*scriptState)(nil)).Elem() 146 } 147 148 type scriptArgs struct { 149 // Name of the script 150 Name *string `pulumi:"name"` 151 // Information indicating where your game script files are stored. See below. 152 StorageLocation *ScriptStorageLocation `pulumi:"storageLocation"` 153 // Key-value map of resource tags. 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 // Version that is associated with this script. 156 Version *string `pulumi:"version"` 157 // A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB. 158 ZipFile *string `pulumi:"zipFile"` 159 } 160 161 // The set of arguments for constructing a Script resource. 162 type ScriptArgs struct { 163 // Name of the script 164 Name pulumi.StringPtrInput 165 // Information indicating where your game script files are stored. See below. 166 StorageLocation ScriptStorageLocationPtrInput 167 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 168 Tags pulumi.StringMapInput 169 // Version that is associated with this script. 170 Version pulumi.StringPtrInput 171 // A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB. 172 ZipFile pulumi.StringPtrInput 173 } 174 175 func (ScriptArgs) ElementType() reflect.Type { 176 return reflect.TypeOf((*scriptArgs)(nil)).Elem() 177 } 178 179 type ScriptInput interface { 180 pulumi.Input 181 182 ToScriptOutput() ScriptOutput 183 ToScriptOutputWithContext(ctx context.Context) ScriptOutput 184 } 185 186 func (*Script) ElementType() reflect.Type { 187 return reflect.TypeOf((**Script)(nil)).Elem() 188 } 189 190 func (i *Script) ToScriptOutput() ScriptOutput { 191 return i.ToScriptOutputWithContext(context.Background()) 192 } 193 194 func (i *Script) ToScriptOutputWithContext(ctx context.Context) ScriptOutput { 195 return pulumi.ToOutputWithContext(ctx, i).(ScriptOutput) 196 } 197 198 // ScriptArrayInput is an input type that accepts ScriptArray and ScriptArrayOutput values. 199 // You can construct a concrete instance of `ScriptArrayInput` via: 200 // 201 // ScriptArray{ ScriptArgs{...} } 202 type ScriptArrayInput interface { 203 pulumi.Input 204 205 ToScriptArrayOutput() ScriptArrayOutput 206 ToScriptArrayOutputWithContext(context.Context) ScriptArrayOutput 207 } 208 209 type ScriptArray []ScriptInput 210 211 func (ScriptArray) ElementType() reflect.Type { 212 return reflect.TypeOf((*[]*Script)(nil)).Elem() 213 } 214 215 func (i ScriptArray) ToScriptArrayOutput() ScriptArrayOutput { 216 return i.ToScriptArrayOutputWithContext(context.Background()) 217 } 218 219 func (i ScriptArray) ToScriptArrayOutputWithContext(ctx context.Context) ScriptArrayOutput { 220 return pulumi.ToOutputWithContext(ctx, i).(ScriptArrayOutput) 221 } 222 223 // ScriptMapInput is an input type that accepts ScriptMap and ScriptMapOutput values. 224 // You can construct a concrete instance of `ScriptMapInput` via: 225 // 226 // ScriptMap{ "key": ScriptArgs{...} } 227 type ScriptMapInput interface { 228 pulumi.Input 229 230 ToScriptMapOutput() ScriptMapOutput 231 ToScriptMapOutputWithContext(context.Context) ScriptMapOutput 232 } 233 234 type ScriptMap map[string]ScriptInput 235 236 func (ScriptMap) ElementType() reflect.Type { 237 return reflect.TypeOf((*map[string]*Script)(nil)).Elem() 238 } 239 240 func (i ScriptMap) ToScriptMapOutput() ScriptMapOutput { 241 return i.ToScriptMapOutputWithContext(context.Background()) 242 } 243 244 func (i ScriptMap) ToScriptMapOutputWithContext(ctx context.Context) ScriptMapOutput { 245 return pulumi.ToOutputWithContext(ctx, i).(ScriptMapOutput) 246 } 247 248 type ScriptOutput struct{ *pulumi.OutputState } 249 250 func (ScriptOutput) ElementType() reflect.Type { 251 return reflect.TypeOf((**Script)(nil)).Elem() 252 } 253 254 func (o ScriptOutput) ToScriptOutput() ScriptOutput { 255 return o 256 } 257 258 func (o ScriptOutput) ToScriptOutputWithContext(ctx context.Context) ScriptOutput { 259 return o 260 } 261 262 // GameLift Script ARN. 263 func (o ScriptOutput) Arn() pulumi.StringOutput { 264 return o.ApplyT(func(v *Script) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 265 } 266 267 // Name of the script 268 func (o ScriptOutput) Name() pulumi.StringOutput { 269 return o.ApplyT(func(v *Script) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 270 } 271 272 // Information indicating where your game script files are stored. See below. 273 func (o ScriptOutput) StorageLocation() ScriptStorageLocationOutput { 274 return o.ApplyT(func(v *Script) ScriptStorageLocationOutput { return v.StorageLocation }).(ScriptStorageLocationOutput) 275 } 276 277 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 278 func (o ScriptOutput) Tags() pulumi.StringMapOutput { 279 return o.ApplyT(func(v *Script) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 280 } 281 282 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 283 // 284 // Deprecated: Please use `tags` instead. 285 func (o ScriptOutput) TagsAll() pulumi.StringMapOutput { 286 return o.ApplyT(func(v *Script) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 287 } 288 289 // Version that is associated with this script. 290 func (o ScriptOutput) Version() pulumi.StringPtrOutput { 291 return o.ApplyT(func(v *Script) pulumi.StringPtrOutput { return v.Version }).(pulumi.StringPtrOutput) 292 } 293 294 // A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB. 295 func (o ScriptOutput) ZipFile() pulumi.StringPtrOutput { 296 return o.ApplyT(func(v *Script) pulumi.StringPtrOutput { return v.ZipFile }).(pulumi.StringPtrOutput) 297 } 298 299 type ScriptArrayOutput struct{ *pulumi.OutputState } 300 301 func (ScriptArrayOutput) ElementType() reflect.Type { 302 return reflect.TypeOf((*[]*Script)(nil)).Elem() 303 } 304 305 func (o ScriptArrayOutput) ToScriptArrayOutput() ScriptArrayOutput { 306 return o 307 } 308 309 func (o ScriptArrayOutput) ToScriptArrayOutputWithContext(ctx context.Context) ScriptArrayOutput { 310 return o 311 } 312 313 func (o ScriptArrayOutput) Index(i pulumi.IntInput) ScriptOutput { 314 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Script { 315 return vs[0].([]*Script)[vs[1].(int)] 316 }).(ScriptOutput) 317 } 318 319 type ScriptMapOutput struct{ *pulumi.OutputState } 320 321 func (ScriptMapOutput) ElementType() reflect.Type { 322 return reflect.TypeOf((*map[string]*Script)(nil)).Elem() 323 } 324 325 func (o ScriptMapOutput) ToScriptMapOutput() ScriptMapOutput { 326 return o 327 } 328 329 func (o ScriptMapOutput) ToScriptMapOutputWithContext(ctx context.Context) ScriptMapOutput { 330 return o 331 } 332 333 func (o ScriptMapOutput) MapIndex(k pulumi.StringInput) ScriptOutput { 334 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Script { 335 return vs[0].(map[string]*Script)[vs[1].(string)] 336 }).(ScriptOutput) 337 } 338 339 func init() { 340 pulumi.RegisterInputType(reflect.TypeOf((*ScriptInput)(nil)).Elem(), &Script{}) 341 pulumi.RegisterInputType(reflect.TypeOf((*ScriptArrayInput)(nil)).Elem(), ScriptArray{}) 342 pulumi.RegisterInputType(reflect.TypeOf((*ScriptMapInput)(nil)).Elem(), ScriptMap{}) 343 pulumi.RegisterOutputType(ScriptOutput{}) 344 pulumi.RegisterOutputType(ScriptArrayOutput{}) 345 pulumi.RegisterOutputType(ScriptMapOutput{}) 346 }