github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appmesh/mesh.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 appmesh
     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 AWS App Mesh service mesh resource.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appmesh"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := appmesh.NewMesh(ctx, "simple", &appmesh.MeshArgs{
    34  //				Name: pulumi.String("simpleapp"),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ### Egress Filter
    47  //
    48  // <!--Start PulumiCodeChooser -->
    49  // ```go
    50  // package main
    51  //
    52  // import (
    53  //
    54  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appmesh"
    55  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    56  //
    57  // )
    58  //
    59  //	func main() {
    60  //		pulumi.Run(func(ctx *pulumi.Context) error {
    61  //			_, err := appmesh.NewMesh(ctx, "simple", &appmesh.MeshArgs{
    62  //				Name: pulumi.String("simpleapp"),
    63  //				Spec: &appmesh.MeshSpecArgs{
    64  //					EgressFilter: &appmesh.MeshSpecEgressFilterArgs{
    65  //						Type: pulumi.String("ALLOW_ALL"),
    66  //					},
    67  //				},
    68  //			})
    69  //			if err != nil {
    70  //				return err
    71  //			}
    72  //			return nil
    73  //		})
    74  //	}
    75  //
    76  // ```
    77  // <!--End PulumiCodeChooser -->
    78  //
    79  // ## Import
    80  //
    81  // Using `pulumi import`, import App Mesh service meshes using the `name`. For example:
    82  //
    83  // ```sh
    84  // $ pulumi import aws:appmesh/mesh:Mesh simple simpleapp
    85  // ```
    86  type Mesh struct {
    87  	pulumi.CustomResourceState
    88  
    89  	// ARN of the service mesh.
    90  	Arn pulumi.StringOutput `pulumi:"arn"`
    91  	// Creation date of the service mesh.
    92  	CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
    93  	// Last update date of the service mesh.
    94  	LastUpdatedDate pulumi.StringOutput `pulumi:"lastUpdatedDate"`
    95  	// AWS account ID of the service mesh's owner.
    96  	MeshOwner pulumi.StringOutput `pulumi:"meshOwner"`
    97  	// Name to use for the service mesh. Must be between 1 and 255 characters in length.
    98  	Name pulumi.StringOutput `pulumi:"name"`
    99  	// Resource owner's AWS account ID.
   100  	ResourceOwner pulumi.StringOutput `pulumi:"resourceOwner"`
   101  	// Service mesh specification to apply.
   102  	Spec MeshSpecPtrOutput `pulumi:"spec"`
   103  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   104  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   105  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   106  	//
   107  	// Deprecated: Please use `tags` instead.
   108  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   109  }
   110  
   111  // NewMesh registers a new resource with the given unique name, arguments, and options.
   112  func NewMesh(ctx *pulumi.Context,
   113  	name string, args *MeshArgs, opts ...pulumi.ResourceOption) (*Mesh, error) {
   114  	if args == nil {
   115  		args = &MeshArgs{}
   116  	}
   117  
   118  	opts = internal.PkgResourceDefaultOpts(opts)
   119  	var resource Mesh
   120  	err := ctx.RegisterResource("aws:appmesh/mesh:Mesh", name, args, &resource, opts...)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return &resource, nil
   125  }
   126  
   127  // GetMesh gets an existing Mesh resource's state with the given name, ID, and optional
   128  // state properties that are used to uniquely qualify the lookup (nil if not required).
   129  func GetMesh(ctx *pulumi.Context,
   130  	name string, id pulumi.IDInput, state *MeshState, opts ...pulumi.ResourceOption) (*Mesh, error) {
   131  	var resource Mesh
   132  	err := ctx.ReadResource("aws:appmesh/mesh:Mesh", name, id, state, &resource, opts...)
   133  	if err != nil {
   134  		return nil, err
   135  	}
   136  	return &resource, nil
   137  }
   138  
   139  // Input properties used for looking up and filtering Mesh resources.
   140  type meshState struct {
   141  	// ARN of the service mesh.
   142  	Arn *string `pulumi:"arn"`
   143  	// Creation date of the service mesh.
   144  	CreatedDate *string `pulumi:"createdDate"`
   145  	// Last update date of the service mesh.
   146  	LastUpdatedDate *string `pulumi:"lastUpdatedDate"`
   147  	// AWS account ID of the service mesh's owner.
   148  	MeshOwner *string `pulumi:"meshOwner"`
   149  	// Name to use for the service mesh. Must be between 1 and 255 characters in length.
   150  	Name *string `pulumi:"name"`
   151  	// Resource owner's AWS account ID.
   152  	ResourceOwner *string `pulumi:"resourceOwner"`
   153  	// Service mesh specification to apply.
   154  	Spec *MeshSpec `pulumi:"spec"`
   155  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   156  	Tags map[string]string `pulumi:"tags"`
   157  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   158  	//
   159  	// Deprecated: Please use `tags` instead.
   160  	TagsAll map[string]string `pulumi:"tagsAll"`
   161  }
   162  
   163  type MeshState struct {
   164  	// ARN of the service mesh.
   165  	Arn pulumi.StringPtrInput
   166  	// Creation date of the service mesh.
   167  	CreatedDate pulumi.StringPtrInput
   168  	// Last update date of the service mesh.
   169  	LastUpdatedDate pulumi.StringPtrInput
   170  	// AWS account ID of the service mesh's owner.
   171  	MeshOwner pulumi.StringPtrInput
   172  	// Name to use for the service mesh. Must be between 1 and 255 characters in length.
   173  	Name pulumi.StringPtrInput
   174  	// Resource owner's AWS account ID.
   175  	ResourceOwner pulumi.StringPtrInput
   176  	// Service mesh specification to apply.
   177  	Spec MeshSpecPtrInput
   178  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   179  	Tags pulumi.StringMapInput
   180  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   181  	//
   182  	// Deprecated: Please use `tags` instead.
   183  	TagsAll pulumi.StringMapInput
   184  }
   185  
   186  func (MeshState) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*meshState)(nil)).Elem()
   188  }
   189  
   190  type meshArgs struct {
   191  	// Name to use for the service mesh. Must be between 1 and 255 characters in length.
   192  	Name *string `pulumi:"name"`
   193  	// Service mesh specification to apply.
   194  	Spec *MeshSpec `pulumi:"spec"`
   195  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   196  	Tags map[string]string `pulumi:"tags"`
   197  }
   198  
   199  // The set of arguments for constructing a Mesh resource.
   200  type MeshArgs struct {
   201  	// Name to use for the service mesh. Must be between 1 and 255 characters in length.
   202  	Name pulumi.StringPtrInput
   203  	// Service mesh specification to apply.
   204  	Spec MeshSpecPtrInput
   205  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   206  	Tags pulumi.StringMapInput
   207  }
   208  
   209  func (MeshArgs) ElementType() reflect.Type {
   210  	return reflect.TypeOf((*meshArgs)(nil)).Elem()
   211  }
   212  
   213  type MeshInput interface {
   214  	pulumi.Input
   215  
   216  	ToMeshOutput() MeshOutput
   217  	ToMeshOutputWithContext(ctx context.Context) MeshOutput
   218  }
   219  
   220  func (*Mesh) ElementType() reflect.Type {
   221  	return reflect.TypeOf((**Mesh)(nil)).Elem()
   222  }
   223  
   224  func (i *Mesh) ToMeshOutput() MeshOutput {
   225  	return i.ToMeshOutputWithContext(context.Background())
   226  }
   227  
   228  func (i *Mesh) ToMeshOutputWithContext(ctx context.Context) MeshOutput {
   229  	return pulumi.ToOutputWithContext(ctx, i).(MeshOutput)
   230  }
   231  
   232  // MeshArrayInput is an input type that accepts MeshArray and MeshArrayOutput values.
   233  // You can construct a concrete instance of `MeshArrayInput` via:
   234  //
   235  //	MeshArray{ MeshArgs{...} }
   236  type MeshArrayInput interface {
   237  	pulumi.Input
   238  
   239  	ToMeshArrayOutput() MeshArrayOutput
   240  	ToMeshArrayOutputWithContext(context.Context) MeshArrayOutput
   241  }
   242  
   243  type MeshArray []MeshInput
   244  
   245  func (MeshArray) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*[]*Mesh)(nil)).Elem()
   247  }
   248  
   249  func (i MeshArray) ToMeshArrayOutput() MeshArrayOutput {
   250  	return i.ToMeshArrayOutputWithContext(context.Background())
   251  }
   252  
   253  func (i MeshArray) ToMeshArrayOutputWithContext(ctx context.Context) MeshArrayOutput {
   254  	return pulumi.ToOutputWithContext(ctx, i).(MeshArrayOutput)
   255  }
   256  
   257  // MeshMapInput is an input type that accepts MeshMap and MeshMapOutput values.
   258  // You can construct a concrete instance of `MeshMapInput` via:
   259  //
   260  //	MeshMap{ "key": MeshArgs{...} }
   261  type MeshMapInput interface {
   262  	pulumi.Input
   263  
   264  	ToMeshMapOutput() MeshMapOutput
   265  	ToMeshMapOutputWithContext(context.Context) MeshMapOutput
   266  }
   267  
   268  type MeshMap map[string]MeshInput
   269  
   270  func (MeshMap) ElementType() reflect.Type {
   271  	return reflect.TypeOf((*map[string]*Mesh)(nil)).Elem()
   272  }
   273  
   274  func (i MeshMap) ToMeshMapOutput() MeshMapOutput {
   275  	return i.ToMeshMapOutputWithContext(context.Background())
   276  }
   277  
   278  func (i MeshMap) ToMeshMapOutputWithContext(ctx context.Context) MeshMapOutput {
   279  	return pulumi.ToOutputWithContext(ctx, i).(MeshMapOutput)
   280  }
   281  
   282  type MeshOutput struct{ *pulumi.OutputState }
   283  
   284  func (MeshOutput) ElementType() reflect.Type {
   285  	return reflect.TypeOf((**Mesh)(nil)).Elem()
   286  }
   287  
   288  func (o MeshOutput) ToMeshOutput() MeshOutput {
   289  	return o
   290  }
   291  
   292  func (o MeshOutput) ToMeshOutputWithContext(ctx context.Context) MeshOutput {
   293  	return o
   294  }
   295  
   296  // ARN of the service mesh.
   297  func (o MeshOutput) Arn() pulumi.StringOutput {
   298  	return o.ApplyT(func(v *Mesh) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   299  }
   300  
   301  // Creation date of the service mesh.
   302  func (o MeshOutput) CreatedDate() pulumi.StringOutput {
   303  	return o.ApplyT(func(v *Mesh) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
   304  }
   305  
   306  // Last update date of the service mesh.
   307  func (o MeshOutput) LastUpdatedDate() pulumi.StringOutput {
   308  	return o.ApplyT(func(v *Mesh) pulumi.StringOutput { return v.LastUpdatedDate }).(pulumi.StringOutput)
   309  }
   310  
   311  // AWS account ID of the service mesh's owner.
   312  func (o MeshOutput) MeshOwner() pulumi.StringOutput {
   313  	return o.ApplyT(func(v *Mesh) pulumi.StringOutput { return v.MeshOwner }).(pulumi.StringOutput)
   314  }
   315  
   316  // Name to use for the service mesh. Must be between 1 and 255 characters in length.
   317  func (o MeshOutput) Name() pulumi.StringOutput {
   318  	return o.ApplyT(func(v *Mesh) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   319  }
   320  
   321  // Resource owner's AWS account ID.
   322  func (o MeshOutput) ResourceOwner() pulumi.StringOutput {
   323  	return o.ApplyT(func(v *Mesh) pulumi.StringOutput { return v.ResourceOwner }).(pulumi.StringOutput)
   324  }
   325  
   326  // Service mesh specification to apply.
   327  func (o MeshOutput) Spec() MeshSpecPtrOutput {
   328  	return o.ApplyT(func(v *Mesh) MeshSpecPtrOutput { return v.Spec }).(MeshSpecPtrOutput)
   329  }
   330  
   331  // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   332  func (o MeshOutput) Tags() pulumi.StringMapOutput {
   333  	return o.ApplyT(func(v *Mesh) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   334  }
   335  
   336  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   337  //
   338  // Deprecated: Please use `tags` instead.
   339  func (o MeshOutput) TagsAll() pulumi.StringMapOutput {
   340  	return o.ApplyT(func(v *Mesh) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   341  }
   342  
   343  type MeshArrayOutput struct{ *pulumi.OutputState }
   344  
   345  func (MeshArrayOutput) ElementType() reflect.Type {
   346  	return reflect.TypeOf((*[]*Mesh)(nil)).Elem()
   347  }
   348  
   349  func (o MeshArrayOutput) ToMeshArrayOutput() MeshArrayOutput {
   350  	return o
   351  }
   352  
   353  func (o MeshArrayOutput) ToMeshArrayOutputWithContext(ctx context.Context) MeshArrayOutput {
   354  	return o
   355  }
   356  
   357  func (o MeshArrayOutput) Index(i pulumi.IntInput) MeshOutput {
   358  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Mesh {
   359  		return vs[0].([]*Mesh)[vs[1].(int)]
   360  	}).(MeshOutput)
   361  }
   362  
   363  type MeshMapOutput struct{ *pulumi.OutputState }
   364  
   365  func (MeshMapOutput) ElementType() reflect.Type {
   366  	return reflect.TypeOf((*map[string]*Mesh)(nil)).Elem()
   367  }
   368  
   369  func (o MeshMapOutput) ToMeshMapOutput() MeshMapOutput {
   370  	return o
   371  }
   372  
   373  func (o MeshMapOutput) ToMeshMapOutputWithContext(ctx context.Context) MeshMapOutput {
   374  	return o
   375  }
   376  
   377  func (o MeshMapOutput) MapIndex(k pulumi.StringInput) MeshOutput {
   378  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Mesh {
   379  		return vs[0].(map[string]*Mesh)[vs[1].(string)]
   380  	}).(MeshOutput)
   381  }
   382  
   383  func init() {
   384  	pulumi.RegisterInputType(reflect.TypeOf((*MeshInput)(nil)).Elem(), &Mesh{})
   385  	pulumi.RegisterInputType(reflect.TypeOf((*MeshArrayInput)(nil)).Elem(), MeshArray{})
   386  	pulumi.RegisterInputType(reflect.TypeOf((*MeshMapInput)(nil)).Elem(), MeshMap{})
   387  	pulumi.RegisterOutputType(MeshOutput{})
   388  	pulumi.RegisterOutputType(MeshArrayOutput{})
   389  	pulumi.RegisterOutputType(MeshMapOutput{})
   390  }