github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/usagePlan.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 apigateway
     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 API Gateway Usage Plan.
    15  //
    16  // ## Import
    17  //
    18  // Using `pulumi import`, import AWS API Gateway Usage Plan using the `id`. For example:
    19  //
    20  // ```sh
    21  // $ pulumi import aws:apigateway/usagePlan:UsagePlan myusageplan <usage_plan_id>
    22  // ```
    23  type UsagePlan struct {
    24  	pulumi.CustomResourceState
    25  
    26  	// Associated API stages of the usage plan.
    27  	ApiStages UsagePlanApiStageArrayOutput `pulumi:"apiStages"`
    28  	// ARN
    29  	Arn pulumi.StringOutput `pulumi:"arn"`
    30  	// Description of a usage plan.
    31  	Description pulumi.StringPtrOutput `pulumi:"description"`
    32  	// Name of the usage plan.
    33  	Name pulumi.StringOutput `pulumi:"name"`
    34  	// AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
    35  	ProductCode pulumi.StringPtrOutput `pulumi:"productCode"`
    36  	// The quota settings of the usage plan.
    37  	QuotaSettings UsagePlanQuotaSettingsPtrOutput `pulumi:"quotaSettings"`
    38  	// 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.
    39  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    40  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    41  	//
    42  	// Deprecated: Please use `tags` instead.
    43  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    44  	// The throttling limits of the usage plan.
    45  	ThrottleSettings UsagePlanThrottleSettingsPtrOutput `pulumi:"throttleSettings"`
    46  }
    47  
    48  // NewUsagePlan registers a new resource with the given unique name, arguments, and options.
    49  func NewUsagePlan(ctx *pulumi.Context,
    50  	name string, args *UsagePlanArgs, opts ...pulumi.ResourceOption) (*UsagePlan, error) {
    51  	if args == nil {
    52  		args = &UsagePlanArgs{}
    53  	}
    54  
    55  	opts = internal.PkgResourceDefaultOpts(opts)
    56  	var resource UsagePlan
    57  	err := ctx.RegisterResource("aws:apigateway/usagePlan:UsagePlan", name, args, &resource, opts...)
    58  	if err != nil {
    59  		return nil, err
    60  	}
    61  	return &resource, nil
    62  }
    63  
    64  // GetUsagePlan gets an existing UsagePlan resource's state with the given name, ID, and optional
    65  // state properties that are used to uniquely qualify the lookup (nil if not required).
    66  func GetUsagePlan(ctx *pulumi.Context,
    67  	name string, id pulumi.IDInput, state *UsagePlanState, opts ...pulumi.ResourceOption) (*UsagePlan, error) {
    68  	var resource UsagePlan
    69  	err := ctx.ReadResource("aws:apigateway/usagePlan:UsagePlan", name, id, state, &resource, opts...)
    70  	if err != nil {
    71  		return nil, err
    72  	}
    73  	return &resource, nil
    74  }
    75  
    76  // Input properties used for looking up and filtering UsagePlan resources.
    77  type usagePlanState struct {
    78  	// Associated API stages of the usage plan.
    79  	ApiStages []UsagePlanApiStage `pulumi:"apiStages"`
    80  	// ARN
    81  	Arn *string `pulumi:"arn"`
    82  	// Description of a usage plan.
    83  	Description *string `pulumi:"description"`
    84  	// Name of the usage plan.
    85  	Name *string `pulumi:"name"`
    86  	// AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
    87  	ProductCode *string `pulumi:"productCode"`
    88  	// The quota settings of the usage plan.
    89  	QuotaSettings *UsagePlanQuotaSettings `pulumi:"quotaSettings"`
    90  	// 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.
    91  	Tags map[string]string `pulumi:"tags"`
    92  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    93  	//
    94  	// Deprecated: Please use `tags` instead.
    95  	TagsAll map[string]string `pulumi:"tagsAll"`
    96  	// The throttling limits of the usage plan.
    97  	ThrottleSettings *UsagePlanThrottleSettings `pulumi:"throttleSettings"`
    98  }
    99  
   100  type UsagePlanState struct {
   101  	// Associated API stages of the usage plan.
   102  	ApiStages UsagePlanApiStageArrayInput
   103  	// ARN
   104  	Arn pulumi.StringPtrInput
   105  	// Description of a usage plan.
   106  	Description pulumi.StringPtrInput
   107  	// Name of the usage plan.
   108  	Name pulumi.StringPtrInput
   109  	// AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
   110  	ProductCode pulumi.StringPtrInput
   111  	// The quota settings of the usage plan.
   112  	QuotaSettings UsagePlanQuotaSettingsPtrInput
   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 pulumi.StringMapInput
   115  	// 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 pulumi.StringMapInput
   119  	// The throttling limits of the usage plan.
   120  	ThrottleSettings UsagePlanThrottleSettingsPtrInput
   121  }
   122  
   123  func (UsagePlanState) ElementType() reflect.Type {
   124  	return reflect.TypeOf((*usagePlanState)(nil)).Elem()
   125  }
   126  
   127  type usagePlanArgs struct {
   128  	// Associated API stages of the usage plan.
   129  	ApiStages []UsagePlanApiStage `pulumi:"apiStages"`
   130  	// Description of a usage plan.
   131  	Description *string `pulumi:"description"`
   132  	// Name of the usage plan.
   133  	Name *string `pulumi:"name"`
   134  	// AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
   135  	ProductCode *string `pulumi:"productCode"`
   136  	// The quota settings of the usage plan.
   137  	QuotaSettings *UsagePlanQuotaSettings `pulumi:"quotaSettings"`
   138  	// 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.
   139  	Tags map[string]string `pulumi:"tags"`
   140  	// The throttling limits of the usage plan.
   141  	ThrottleSettings *UsagePlanThrottleSettings `pulumi:"throttleSettings"`
   142  }
   143  
   144  // The set of arguments for constructing a UsagePlan resource.
   145  type UsagePlanArgs struct {
   146  	// Associated API stages of the usage plan.
   147  	ApiStages UsagePlanApiStageArrayInput
   148  	// Description of a usage plan.
   149  	Description pulumi.StringPtrInput
   150  	// Name of the usage plan.
   151  	Name pulumi.StringPtrInput
   152  	// AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
   153  	ProductCode pulumi.StringPtrInput
   154  	// The quota settings of the usage plan.
   155  	QuotaSettings UsagePlanQuotaSettingsPtrInput
   156  	// 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.
   157  	Tags pulumi.StringMapInput
   158  	// The throttling limits of the usage plan.
   159  	ThrottleSettings UsagePlanThrottleSettingsPtrInput
   160  }
   161  
   162  func (UsagePlanArgs) ElementType() reflect.Type {
   163  	return reflect.TypeOf((*usagePlanArgs)(nil)).Elem()
   164  }
   165  
   166  type UsagePlanInput interface {
   167  	pulumi.Input
   168  
   169  	ToUsagePlanOutput() UsagePlanOutput
   170  	ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput
   171  }
   172  
   173  func (*UsagePlan) ElementType() reflect.Type {
   174  	return reflect.TypeOf((**UsagePlan)(nil)).Elem()
   175  }
   176  
   177  func (i *UsagePlan) ToUsagePlanOutput() UsagePlanOutput {
   178  	return i.ToUsagePlanOutputWithContext(context.Background())
   179  }
   180  
   181  func (i *UsagePlan) ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput {
   182  	return pulumi.ToOutputWithContext(ctx, i).(UsagePlanOutput)
   183  }
   184  
   185  // UsagePlanArrayInput is an input type that accepts UsagePlanArray and UsagePlanArrayOutput values.
   186  // You can construct a concrete instance of `UsagePlanArrayInput` via:
   187  //
   188  //	UsagePlanArray{ UsagePlanArgs{...} }
   189  type UsagePlanArrayInput interface {
   190  	pulumi.Input
   191  
   192  	ToUsagePlanArrayOutput() UsagePlanArrayOutput
   193  	ToUsagePlanArrayOutputWithContext(context.Context) UsagePlanArrayOutput
   194  }
   195  
   196  type UsagePlanArray []UsagePlanInput
   197  
   198  func (UsagePlanArray) ElementType() reflect.Type {
   199  	return reflect.TypeOf((*[]*UsagePlan)(nil)).Elem()
   200  }
   201  
   202  func (i UsagePlanArray) ToUsagePlanArrayOutput() UsagePlanArrayOutput {
   203  	return i.ToUsagePlanArrayOutputWithContext(context.Background())
   204  }
   205  
   206  func (i UsagePlanArray) ToUsagePlanArrayOutputWithContext(ctx context.Context) UsagePlanArrayOutput {
   207  	return pulumi.ToOutputWithContext(ctx, i).(UsagePlanArrayOutput)
   208  }
   209  
   210  // UsagePlanMapInput is an input type that accepts UsagePlanMap and UsagePlanMapOutput values.
   211  // You can construct a concrete instance of `UsagePlanMapInput` via:
   212  //
   213  //	UsagePlanMap{ "key": UsagePlanArgs{...} }
   214  type UsagePlanMapInput interface {
   215  	pulumi.Input
   216  
   217  	ToUsagePlanMapOutput() UsagePlanMapOutput
   218  	ToUsagePlanMapOutputWithContext(context.Context) UsagePlanMapOutput
   219  }
   220  
   221  type UsagePlanMap map[string]UsagePlanInput
   222  
   223  func (UsagePlanMap) ElementType() reflect.Type {
   224  	return reflect.TypeOf((*map[string]*UsagePlan)(nil)).Elem()
   225  }
   226  
   227  func (i UsagePlanMap) ToUsagePlanMapOutput() UsagePlanMapOutput {
   228  	return i.ToUsagePlanMapOutputWithContext(context.Background())
   229  }
   230  
   231  func (i UsagePlanMap) ToUsagePlanMapOutputWithContext(ctx context.Context) UsagePlanMapOutput {
   232  	return pulumi.ToOutputWithContext(ctx, i).(UsagePlanMapOutput)
   233  }
   234  
   235  type UsagePlanOutput struct{ *pulumi.OutputState }
   236  
   237  func (UsagePlanOutput) ElementType() reflect.Type {
   238  	return reflect.TypeOf((**UsagePlan)(nil)).Elem()
   239  }
   240  
   241  func (o UsagePlanOutput) ToUsagePlanOutput() UsagePlanOutput {
   242  	return o
   243  }
   244  
   245  func (o UsagePlanOutput) ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput {
   246  	return o
   247  }
   248  
   249  // Associated API stages of the usage plan.
   250  func (o UsagePlanOutput) ApiStages() UsagePlanApiStageArrayOutput {
   251  	return o.ApplyT(func(v *UsagePlan) UsagePlanApiStageArrayOutput { return v.ApiStages }).(UsagePlanApiStageArrayOutput)
   252  }
   253  
   254  // ARN
   255  func (o UsagePlanOutput) Arn() pulumi.StringOutput {
   256  	return o.ApplyT(func(v *UsagePlan) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   257  }
   258  
   259  // Description of a usage plan.
   260  func (o UsagePlanOutput) Description() pulumi.StringPtrOutput {
   261  	return o.ApplyT(func(v *UsagePlan) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   262  }
   263  
   264  // Name of the usage plan.
   265  func (o UsagePlanOutput) Name() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *UsagePlan) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   267  }
   268  
   269  // AWS Marketplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
   270  func (o UsagePlanOutput) ProductCode() pulumi.StringPtrOutput {
   271  	return o.ApplyT(func(v *UsagePlan) pulumi.StringPtrOutput { return v.ProductCode }).(pulumi.StringPtrOutput)
   272  }
   273  
   274  // The quota settings of the usage plan.
   275  func (o UsagePlanOutput) QuotaSettings() UsagePlanQuotaSettingsPtrOutput {
   276  	return o.ApplyT(func(v *UsagePlan) UsagePlanQuotaSettingsPtrOutput { return v.QuotaSettings }).(UsagePlanQuotaSettingsPtrOutput)
   277  }
   278  
   279  // 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.
   280  func (o UsagePlanOutput) Tags() pulumi.StringMapOutput {
   281  	return o.ApplyT(func(v *UsagePlan) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   282  }
   283  
   284  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   285  //
   286  // Deprecated: Please use `tags` instead.
   287  func (o UsagePlanOutput) TagsAll() pulumi.StringMapOutput {
   288  	return o.ApplyT(func(v *UsagePlan) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   289  }
   290  
   291  // The throttling limits of the usage plan.
   292  func (o UsagePlanOutput) ThrottleSettings() UsagePlanThrottleSettingsPtrOutput {
   293  	return o.ApplyT(func(v *UsagePlan) UsagePlanThrottleSettingsPtrOutput { return v.ThrottleSettings }).(UsagePlanThrottleSettingsPtrOutput)
   294  }
   295  
   296  type UsagePlanArrayOutput struct{ *pulumi.OutputState }
   297  
   298  func (UsagePlanArrayOutput) ElementType() reflect.Type {
   299  	return reflect.TypeOf((*[]*UsagePlan)(nil)).Elem()
   300  }
   301  
   302  func (o UsagePlanArrayOutput) ToUsagePlanArrayOutput() UsagePlanArrayOutput {
   303  	return o
   304  }
   305  
   306  func (o UsagePlanArrayOutput) ToUsagePlanArrayOutputWithContext(ctx context.Context) UsagePlanArrayOutput {
   307  	return o
   308  }
   309  
   310  func (o UsagePlanArrayOutput) Index(i pulumi.IntInput) UsagePlanOutput {
   311  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UsagePlan {
   312  		return vs[0].([]*UsagePlan)[vs[1].(int)]
   313  	}).(UsagePlanOutput)
   314  }
   315  
   316  type UsagePlanMapOutput struct{ *pulumi.OutputState }
   317  
   318  func (UsagePlanMapOutput) ElementType() reflect.Type {
   319  	return reflect.TypeOf((*map[string]*UsagePlan)(nil)).Elem()
   320  }
   321  
   322  func (o UsagePlanMapOutput) ToUsagePlanMapOutput() UsagePlanMapOutput {
   323  	return o
   324  }
   325  
   326  func (o UsagePlanMapOutput) ToUsagePlanMapOutputWithContext(ctx context.Context) UsagePlanMapOutput {
   327  	return o
   328  }
   329  
   330  func (o UsagePlanMapOutput) MapIndex(k pulumi.StringInput) UsagePlanOutput {
   331  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UsagePlan {
   332  		return vs[0].(map[string]*UsagePlan)[vs[1].(string)]
   333  	}).(UsagePlanOutput)
   334  }
   335  
   336  func init() {
   337  	pulumi.RegisterInputType(reflect.TypeOf((*UsagePlanInput)(nil)).Elem(), &UsagePlan{})
   338  	pulumi.RegisterInputType(reflect.TypeOf((*UsagePlanArrayInput)(nil)).Elem(), UsagePlanArray{})
   339  	pulumi.RegisterInputType(reflect.TypeOf((*UsagePlanMapInput)(nil)).Elem(), UsagePlanMap{})
   340  	pulumi.RegisterOutputType(UsagePlanOutput{})
   341  	pulumi.RegisterOutputType(UsagePlanArrayOutput{})
   342  	pulumi.RegisterOutputType(UsagePlanMapOutput{})
   343  }