github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appsync/apiCache.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 appsync 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 AppSync API Cache. 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/appsync" 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 := appsync.NewGraphQLApi(ctx, "example", &appsync.GraphQLApiArgs{ 33 // AuthenticationType: pulumi.String("API_KEY"), 34 // Name: pulumi.String("example"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // _, err = appsync.NewApiCache(ctx, "example", &appsync.ApiCacheArgs{ 40 // ApiId: example.ID(), 41 // ApiCachingBehavior: pulumi.String("FULL_REQUEST_CACHING"), 42 // Type: pulumi.String("LARGE"), 43 // Ttl: pulumi.Int(900), 44 // }) 45 // if err != nil { 46 // return err 47 // } 48 // return nil 49 // }) 50 // } 51 // 52 // ``` 53 // <!--End PulumiCodeChooser --> 54 // 55 // ## Import 56 // 57 // Using `pulumi import`, import `aws_appsync_api_cache` using the AppSync API ID. For example: 58 // 59 // ```sh 60 // $ pulumi import aws:appsync/apiCache:ApiCache example xxxxx 61 // ``` 62 type ApiCache struct { 63 pulumi.CustomResourceState 64 65 // Caching behavior. Valid values are `FULL_REQUEST_CACHING` and `PER_RESOLVER_CACHING`. 66 ApiCachingBehavior pulumi.StringOutput `pulumi:"apiCachingBehavior"` 67 // GraphQL API ID. 68 ApiId pulumi.StringOutput `pulumi:"apiId"` 69 // At-rest encryption flag for cache. You cannot update this setting after creation. 70 AtRestEncryptionEnabled pulumi.BoolPtrOutput `pulumi:"atRestEncryptionEnabled"` 71 // Transit encryption flag when connecting to cache. You cannot update this setting after creation. 72 TransitEncryptionEnabled pulumi.BoolPtrOutput `pulumi:"transitEncryptionEnabled"` 73 // TTL in seconds for cache entries. 74 Ttl pulumi.IntOutput `pulumi:"ttl"` 75 // Cache instance type. Valid values are `SMALL`, `MEDIUM`, `LARGE`, `XLARGE`, `LARGE_2X`, `LARGE_4X`, `LARGE_8X`, `LARGE_12X`, `T2_SMALL`, `T2_MEDIUM`, `R4_LARGE`, `R4_XLARGE`, `R4_2XLARGE`, `R4_4XLARGE`, `R4_8XLARGE`. 76 Type pulumi.StringOutput `pulumi:"type"` 77 } 78 79 // NewApiCache registers a new resource with the given unique name, arguments, and options. 80 func NewApiCache(ctx *pulumi.Context, 81 name string, args *ApiCacheArgs, opts ...pulumi.ResourceOption) (*ApiCache, error) { 82 if args == nil { 83 return nil, errors.New("missing one or more required arguments") 84 } 85 86 if args.ApiCachingBehavior == nil { 87 return nil, errors.New("invalid value for required argument 'ApiCachingBehavior'") 88 } 89 if args.ApiId == nil { 90 return nil, errors.New("invalid value for required argument 'ApiId'") 91 } 92 if args.Ttl == nil { 93 return nil, errors.New("invalid value for required argument 'Ttl'") 94 } 95 if args.Type == nil { 96 return nil, errors.New("invalid value for required argument 'Type'") 97 } 98 opts = internal.PkgResourceDefaultOpts(opts) 99 var resource ApiCache 100 err := ctx.RegisterResource("aws:appsync/apiCache:ApiCache", name, args, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // GetApiCache gets an existing ApiCache resource's state with the given name, ID, and optional 108 // state properties that are used to uniquely qualify the lookup (nil if not required). 109 func GetApiCache(ctx *pulumi.Context, 110 name string, id pulumi.IDInput, state *ApiCacheState, opts ...pulumi.ResourceOption) (*ApiCache, error) { 111 var resource ApiCache 112 err := ctx.ReadResource("aws:appsync/apiCache:ApiCache", name, id, state, &resource, opts...) 113 if err != nil { 114 return nil, err 115 } 116 return &resource, nil 117 } 118 119 // Input properties used for looking up and filtering ApiCache resources. 120 type apiCacheState struct { 121 // Caching behavior. Valid values are `FULL_REQUEST_CACHING` and `PER_RESOLVER_CACHING`. 122 ApiCachingBehavior *string `pulumi:"apiCachingBehavior"` 123 // GraphQL API ID. 124 ApiId *string `pulumi:"apiId"` 125 // At-rest encryption flag for cache. You cannot update this setting after creation. 126 AtRestEncryptionEnabled *bool `pulumi:"atRestEncryptionEnabled"` 127 // Transit encryption flag when connecting to cache. You cannot update this setting after creation. 128 TransitEncryptionEnabled *bool `pulumi:"transitEncryptionEnabled"` 129 // TTL in seconds for cache entries. 130 Ttl *int `pulumi:"ttl"` 131 // Cache instance type. Valid values are `SMALL`, `MEDIUM`, `LARGE`, `XLARGE`, `LARGE_2X`, `LARGE_4X`, `LARGE_8X`, `LARGE_12X`, `T2_SMALL`, `T2_MEDIUM`, `R4_LARGE`, `R4_XLARGE`, `R4_2XLARGE`, `R4_4XLARGE`, `R4_8XLARGE`. 132 Type *string `pulumi:"type"` 133 } 134 135 type ApiCacheState struct { 136 // Caching behavior. Valid values are `FULL_REQUEST_CACHING` and `PER_RESOLVER_CACHING`. 137 ApiCachingBehavior pulumi.StringPtrInput 138 // GraphQL API ID. 139 ApiId pulumi.StringPtrInput 140 // At-rest encryption flag for cache. You cannot update this setting after creation. 141 AtRestEncryptionEnabled pulumi.BoolPtrInput 142 // Transit encryption flag when connecting to cache. You cannot update this setting after creation. 143 TransitEncryptionEnabled pulumi.BoolPtrInput 144 // TTL in seconds for cache entries. 145 Ttl pulumi.IntPtrInput 146 // Cache instance type. Valid values are `SMALL`, `MEDIUM`, `LARGE`, `XLARGE`, `LARGE_2X`, `LARGE_4X`, `LARGE_8X`, `LARGE_12X`, `T2_SMALL`, `T2_MEDIUM`, `R4_LARGE`, `R4_XLARGE`, `R4_2XLARGE`, `R4_4XLARGE`, `R4_8XLARGE`. 147 Type pulumi.StringPtrInput 148 } 149 150 func (ApiCacheState) ElementType() reflect.Type { 151 return reflect.TypeOf((*apiCacheState)(nil)).Elem() 152 } 153 154 type apiCacheArgs struct { 155 // Caching behavior. Valid values are `FULL_REQUEST_CACHING` and `PER_RESOLVER_CACHING`. 156 ApiCachingBehavior string `pulumi:"apiCachingBehavior"` 157 // GraphQL API ID. 158 ApiId string `pulumi:"apiId"` 159 // At-rest encryption flag for cache. You cannot update this setting after creation. 160 AtRestEncryptionEnabled *bool `pulumi:"atRestEncryptionEnabled"` 161 // Transit encryption flag when connecting to cache. You cannot update this setting after creation. 162 TransitEncryptionEnabled *bool `pulumi:"transitEncryptionEnabled"` 163 // TTL in seconds for cache entries. 164 Ttl int `pulumi:"ttl"` 165 // Cache instance type. Valid values are `SMALL`, `MEDIUM`, `LARGE`, `XLARGE`, `LARGE_2X`, `LARGE_4X`, `LARGE_8X`, `LARGE_12X`, `T2_SMALL`, `T2_MEDIUM`, `R4_LARGE`, `R4_XLARGE`, `R4_2XLARGE`, `R4_4XLARGE`, `R4_8XLARGE`. 166 Type string `pulumi:"type"` 167 } 168 169 // The set of arguments for constructing a ApiCache resource. 170 type ApiCacheArgs struct { 171 // Caching behavior. Valid values are `FULL_REQUEST_CACHING` and `PER_RESOLVER_CACHING`. 172 ApiCachingBehavior pulumi.StringInput 173 // GraphQL API ID. 174 ApiId pulumi.StringInput 175 // At-rest encryption flag for cache. You cannot update this setting after creation. 176 AtRestEncryptionEnabled pulumi.BoolPtrInput 177 // Transit encryption flag when connecting to cache. You cannot update this setting after creation. 178 TransitEncryptionEnabled pulumi.BoolPtrInput 179 // TTL in seconds for cache entries. 180 Ttl pulumi.IntInput 181 // Cache instance type. Valid values are `SMALL`, `MEDIUM`, `LARGE`, `XLARGE`, `LARGE_2X`, `LARGE_4X`, `LARGE_8X`, `LARGE_12X`, `T2_SMALL`, `T2_MEDIUM`, `R4_LARGE`, `R4_XLARGE`, `R4_2XLARGE`, `R4_4XLARGE`, `R4_8XLARGE`. 182 Type pulumi.StringInput 183 } 184 185 func (ApiCacheArgs) ElementType() reflect.Type { 186 return reflect.TypeOf((*apiCacheArgs)(nil)).Elem() 187 } 188 189 type ApiCacheInput interface { 190 pulumi.Input 191 192 ToApiCacheOutput() ApiCacheOutput 193 ToApiCacheOutputWithContext(ctx context.Context) ApiCacheOutput 194 } 195 196 func (*ApiCache) ElementType() reflect.Type { 197 return reflect.TypeOf((**ApiCache)(nil)).Elem() 198 } 199 200 func (i *ApiCache) ToApiCacheOutput() ApiCacheOutput { 201 return i.ToApiCacheOutputWithContext(context.Background()) 202 } 203 204 func (i *ApiCache) ToApiCacheOutputWithContext(ctx context.Context) ApiCacheOutput { 205 return pulumi.ToOutputWithContext(ctx, i).(ApiCacheOutput) 206 } 207 208 // ApiCacheArrayInput is an input type that accepts ApiCacheArray and ApiCacheArrayOutput values. 209 // You can construct a concrete instance of `ApiCacheArrayInput` via: 210 // 211 // ApiCacheArray{ ApiCacheArgs{...} } 212 type ApiCacheArrayInput interface { 213 pulumi.Input 214 215 ToApiCacheArrayOutput() ApiCacheArrayOutput 216 ToApiCacheArrayOutputWithContext(context.Context) ApiCacheArrayOutput 217 } 218 219 type ApiCacheArray []ApiCacheInput 220 221 func (ApiCacheArray) ElementType() reflect.Type { 222 return reflect.TypeOf((*[]*ApiCache)(nil)).Elem() 223 } 224 225 func (i ApiCacheArray) ToApiCacheArrayOutput() ApiCacheArrayOutput { 226 return i.ToApiCacheArrayOutputWithContext(context.Background()) 227 } 228 229 func (i ApiCacheArray) ToApiCacheArrayOutputWithContext(ctx context.Context) ApiCacheArrayOutput { 230 return pulumi.ToOutputWithContext(ctx, i).(ApiCacheArrayOutput) 231 } 232 233 // ApiCacheMapInput is an input type that accepts ApiCacheMap and ApiCacheMapOutput values. 234 // You can construct a concrete instance of `ApiCacheMapInput` via: 235 // 236 // ApiCacheMap{ "key": ApiCacheArgs{...} } 237 type ApiCacheMapInput interface { 238 pulumi.Input 239 240 ToApiCacheMapOutput() ApiCacheMapOutput 241 ToApiCacheMapOutputWithContext(context.Context) ApiCacheMapOutput 242 } 243 244 type ApiCacheMap map[string]ApiCacheInput 245 246 func (ApiCacheMap) ElementType() reflect.Type { 247 return reflect.TypeOf((*map[string]*ApiCache)(nil)).Elem() 248 } 249 250 func (i ApiCacheMap) ToApiCacheMapOutput() ApiCacheMapOutput { 251 return i.ToApiCacheMapOutputWithContext(context.Background()) 252 } 253 254 func (i ApiCacheMap) ToApiCacheMapOutputWithContext(ctx context.Context) ApiCacheMapOutput { 255 return pulumi.ToOutputWithContext(ctx, i).(ApiCacheMapOutput) 256 } 257 258 type ApiCacheOutput struct{ *pulumi.OutputState } 259 260 func (ApiCacheOutput) ElementType() reflect.Type { 261 return reflect.TypeOf((**ApiCache)(nil)).Elem() 262 } 263 264 func (o ApiCacheOutput) ToApiCacheOutput() ApiCacheOutput { 265 return o 266 } 267 268 func (o ApiCacheOutput) ToApiCacheOutputWithContext(ctx context.Context) ApiCacheOutput { 269 return o 270 } 271 272 // Caching behavior. Valid values are `FULL_REQUEST_CACHING` and `PER_RESOLVER_CACHING`. 273 func (o ApiCacheOutput) ApiCachingBehavior() pulumi.StringOutput { 274 return o.ApplyT(func(v *ApiCache) pulumi.StringOutput { return v.ApiCachingBehavior }).(pulumi.StringOutput) 275 } 276 277 // GraphQL API ID. 278 func (o ApiCacheOutput) ApiId() pulumi.StringOutput { 279 return o.ApplyT(func(v *ApiCache) pulumi.StringOutput { return v.ApiId }).(pulumi.StringOutput) 280 } 281 282 // At-rest encryption flag for cache. You cannot update this setting after creation. 283 func (o ApiCacheOutput) AtRestEncryptionEnabled() pulumi.BoolPtrOutput { 284 return o.ApplyT(func(v *ApiCache) pulumi.BoolPtrOutput { return v.AtRestEncryptionEnabled }).(pulumi.BoolPtrOutput) 285 } 286 287 // Transit encryption flag when connecting to cache. You cannot update this setting after creation. 288 func (o ApiCacheOutput) TransitEncryptionEnabled() pulumi.BoolPtrOutput { 289 return o.ApplyT(func(v *ApiCache) pulumi.BoolPtrOutput { return v.TransitEncryptionEnabled }).(pulumi.BoolPtrOutput) 290 } 291 292 // TTL in seconds for cache entries. 293 func (o ApiCacheOutput) Ttl() pulumi.IntOutput { 294 return o.ApplyT(func(v *ApiCache) pulumi.IntOutput { return v.Ttl }).(pulumi.IntOutput) 295 } 296 297 // Cache instance type. Valid values are `SMALL`, `MEDIUM`, `LARGE`, `XLARGE`, `LARGE_2X`, `LARGE_4X`, `LARGE_8X`, `LARGE_12X`, `T2_SMALL`, `T2_MEDIUM`, `R4_LARGE`, `R4_XLARGE`, `R4_2XLARGE`, `R4_4XLARGE`, `R4_8XLARGE`. 298 func (o ApiCacheOutput) Type() pulumi.StringOutput { 299 return o.ApplyT(func(v *ApiCache) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput) 300 } 301 302 type ApiCacheArrayOutput struct{ *pulumi.OutputState } 303 304 func (ApiCacheArrayOutput) ElementType() reflect.Type { 305 return reflect.TypeOf((*[]*ApiCache)(nil)).Elem() 306 } 307 308 func (o ApiCacheArrayOutput) ToApiCacheArrayOutput() ApiCacheArrayOutput { 309 return o 310 } 311 312 func (o ApiCacheArrayOutput) ToApiCacheArrayOutputWithContext(ctx context.Context) ApiCacheArrayOutput { 313 return o 314 } 315 316 func (o ApiCacheArrayOutput) Index(i pulumi.IntInput) ApiCacheOutput { 317 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApiCache { 318 return vs[0].([]*ApiCache)[vs[1].(int)] 319 }).(ApiCacheOutput) 320 } 321 322 type ApiCacheMapOutput struct{ *pulumi.OutputState } 323 324 func (ApiCacheMapOutput) ElementType() reflect.Type { 325 return reflect.TypeOf((*map[string]*ApiCache)(nil)).Elem() 326 } 327 328 func (o ApiCacheMapOutput) ToApiCacheMapOutput() ApiCacheMapOutput { 329 return o 330 } 331 332 func (o ApiCacheMapOutput) ToApiCacheMapOutputWithContext(ctx context.Context) ApiCacheMapOutput { 333 return o 334 } 335 336 func (o ApiCacheMapOutput) MapIndex(k pulumi.StringInput) ApiCacheOutput { 337 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApiCache { 338 return vs[0].(map[string]*ApiCache)[vs[1].(string)] 339 }).(ApiCacheOutput) 340 } 341 342 func init() { 343 pulumi.RegisterInputType(reflect.TypeOf((*ApiCacheInput)(nil)).Elem(), &ApiCache{}) 344 pulumi.RegisterInputType(reflect.TypeOf((*ApiCacheArrayInput)(nil)).Elem(), ApiCacheArray{}) 345 pulumi.RegisterInputType(reflect.TypeOf((*ApiCacheMapInput)(nil)).Elem(), ApiCacheMap{}) 346 pulumi.RegisterOutputType(ApiCacheOutput{}) 347 pulumi.RegisterOutputType(ApiCacheArrayOutput{}) 348 pulumi.RegisterOutputType(ApiCacheMapOutput{}) 349 }