github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apprunner/connection.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 apprunner
     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  // Manages an App Runner Connection.
    16  //
    17  // > **NOTE:** After creation, you must complete the authentication handshake using the App Runner console.
    18  //
    19  // ## Example Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apprunner"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := apprunner.NewConnection(ctx, "example", &apprunner.ConnectionArgs{
    35  //				ConnectionName: pulumi.String("example"),
    36  //				ProviderType:   pulumi.String("GITHUB"),
    37  //				Tags: pulumi.StringMap{
    38  //					"Name": pulumi.String("example-apprunner-connection"),
    39  //				},
    40  //			})
    41  //			if err != nil {
    42  //				return err
    43  //			}
    44  //			return nil
    45  //		})
    46  //	}
    47  //
    48  // ```
    49  // <!--End PulumiCodeChooser -->
    50  //
    51  // ## Import
    52  //
    53  // Using `pulumi import`, import App Runner Connections using the `connection_name`. For example:
    54  //
    55  // ```sh
    56  // $ pulumi import aws:apprunner/connection:Connection example example
    57  // ```
    58  type Connection struct {
    59  	pulumi.CustomResourceState
    60  
    61  	// ARN of the connection.
    62  	Arn pulumi.StringOutput `pulumi:"arn"`
    63  	// Name of the connection.
    64  	ConnectionName pulumi.StringOutput `pulumi:"connectionName"`
    65  	// Source repository provider. Valid values: `GITHUB`.
    66  	ProviderType pulumi.StringOutput `pulumi:"providerType"`
    67  	// Current state of the App Runner connection. When the state is `AVAILABLE`, you can use the connection to create an `apprunner.Service` resource.
    68  	Status pulumi.StringOutput `pulumi:"status"`
    69  	// 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.
    70  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    71  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    72  	//
    73  	// Deprecated: Please use `tags` instead.
    74  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    75  }
    76  
    77  // NewConnection registers a new resource with the given unique name, arguments, and options.
    78  func NewConnection(ctx *pulumi.Context,
    79  	name string, args *ConnectionArgs, opts ...pulumi.ResourceOption) (*Connection, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.ConnectionName == nil {
    85  		return nil, errors.New("invalid value for required argument 'ConnectionName'")
    86  	}
    87  	if args.ProviderType == nil {
    88  		return nil, errors.New("invalid value for required argument 'ProviderType'")
    89  	}
    90  	opts = internal.PkgResourceDefaultOpts(opts)
    91  	var resource Connection
    92  	err := ctx.RegisterResource("aws:apprunner/connection:Connection", name, args, &resource, opts...)
    93  	if err != nil {
    94  		return nil, err
    95  	}
    96  	return &resource, nil
    97  }
    98  
    99  // GetConnection gets an existing Connection resource's state with the given name, ID, and optional
   100  // state properties that are used to uniquely qualify the lookup (nil if not required).
   101  func GetConnection(ctx *pulumi.Context,
   102  	name string, id pulumi.IDInput, state *ConnectionState, opts ...pulumi.ResourceOption) (*Connection, error) {
   103  	var resource Connection
   104  	err := ctx.ReadResource("aws:apprunner/connection:Connection", name, id, state, &resource, opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return &resource, nil
   109  }
   110  
   111  // Input properties used for looking up and filtering Connection resources.
   112  type connectionState struct {
   113  	// ARN of the connection.
   114  	Arn *string `pulumi:"arn"`
   115  	// Name of the connection.
   116  	ConnectionName *string `pulumi:"connectionName"`
   117  	// Source repository provider. Valid values: `GITHUB`.
   118  	ProviderType *string `pulumi:"providerType"`
   119  	// Current state of the App Runner connection. When the state is `AVAILABLE`, you can use the connection to create an `apprunner.Service` resource.
   120  	Status *string `pulumi:"status"`
   121  	// 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.
   122  	Tags map[string]string `pulumi:"tags"`
   123  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   124  	//
   125  	// Deprecated: Please use `tags` instead.
   126  	TagsAll map[string]string `pulumi:"tagsAll"`
   127  }
   128  
   129  type ConnectionState struct {
   130  	// ARN of the connection.
   131  	Arn pulumi.StringPtrInput
   132  	// Name of the connection.
   133  	ConnectionName pulumi.StringPtrInput
   134  	// Source repository provider. Valid values: `GITHUB`.
   135  	ProviderType pulumi.StringPtrInput
   136  	// Current state of the App Runner connection. When the state is `AVAILABLE`, you can use the connection to create an `apprunner.Service` resource.
   137  	Status pulumi.StringPtrInput
   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 pulumi.StringMapInput
   140  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   141  	//
   142  	// Deprecated: Please use `tags` instead.
   143  	TagsAll pulumi.StringMapInput
   144  }
   145  
   146  func (ConnectionState) ElementType() reflect.Type {
   147  	return reflect.TypeOf((*connectionState)(nil)).Elem()
   148  }
   149  
   150  type connectionArgs struct {
   151  	// Name of the connection.
   152  	ConnectionName string `pulumi:"connectionName"`
   153  	// Source repository provider. Valid values: `GITHUB`.
   154  	ProviderType string `pulumi:"providerType"`
   155  	// 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.
   156  	Tags map[string]string `pulumi:"tags"`
   157  }
   158  
   159  // The set of arguments for constructing a Connection resource.
   160  type ConnectionArgs struct {
   161  	// Name of the connection.
   162  	ConnectionName pulumi.StringInput
   163  	// Source repository provider. Valid values: `GITHUB`.
   164  	ProviderType pulumi.StringInput
   165  	// 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.
   166  	Tags pulumi.StringMapInput
   167  }
   168  
   169  func (ConnectionArgs) ElementType() reflect.Type {
   170  	return reflect.TypeOf((*connectionArgs)(nil)).Elem()
   171  }
   172  
   173  type ConnectionInput interface {
   174  	pulumi.Input
   175  
   176  	ToConnectionOutput() ConnectionOutput
   177  	ToConnectionOutputWithContext(ctx context.Context) ConnectionOutput
   178  }
   179  
   180  func (*Connection) ElementType() reflect.Type {
   181  	return reflect.TypeOf((**Connection)(nil)).Elem()
   182  }
   183  
   184  func (i *Connection) ToConnectionOutput() ConnectionOutput {
   185  	return i.ToConnectionOutputWithContext(context.Background())
   186  }
   187  
   188  func (i *Connection) ToConnectionOutputWithContext(ctx context.Context) ConnectionOutput {
   189  	return pulumi.ToOutputWithContext(ctx, i).(ConnectionOutput)
   190  }
   191  
   192  // ConnectionArrayInput is an input type that accepts ConnectionArray and ConnectionArrayOutput values.
   193  // You can construct a concrete instance of `ConnectionArrayInput` via:
   194  //
   195  //	ConnectionArray{ ConnectionArgs{...} }
   196  type ConnectionArrayInput interface {
   197  	pulumi.Input
   198  
   199  	ToConnectionArrayOutput() ConnectionArrayOutput
   200  	ToConnectionArrayOutputWithContext(context.Context) ConnectionArrayOutput
   201  }
   202  
   203  type ConnectionArray []ConnectionInput
   204  
   205  func (ConnectionArray) ElementType() reflect.Type {
   206  	return reflect.TypeOf((*[]*Connection)(nil)).Elem()
   207  }
   208  
   209  func (i ConnectionArray) ToConnectionArrayOutput() ConnectionArrayOutput {
   210  	return i.ToConnectionArrayOutputWithContext(context.Background())
   211  }
   212  
   213  func (i ConnectionArray) ToConnectionArrayOutputWithContext(ctx context.Context) ConnectionArrayOutput {
   214  	return pulumi.ToOutputWithContext(ctx, i).(ConnectionArrayOutput)
   215  }
   216  
   217  // ConnectionMapInput is an input type that accepts ConnectionMap and ConnectionMapOutput values.
   218  // You can construct a concrete instance of `ConnectionMapInput` via:
   219  //
   220  //	ConnectionMap{ "key": ConnectionArgs{...} }
   221  type ConnectionMapInput interface {
   222  	pulumi.Input
   223  
   224  	ToConnectionMapOutput() ConnectionMapOutput
   225  	ToConnectionMapOutputWithContext(context.Context) ConnectionMapOutput
   226  }
   227  
   228  type ConnectionMap map[string]ConnectionInput
   229  
   230  func (ConnectionMap) ElementType() reflect.Type {
   231  	return reflect.TypeOf((*map[string]*Connection)(nil)).Elem()
   232  }
   233  
   234  func (i ConnectionMap) ToConnectionMapOutput() ConnectionMapOutput {
   235  	return i.ToConnectionMapOutputWithContext(context.Background())
   236  }
   237  
   238  func (i ConnectionMap) ToConnectionMapOutputWithContext(ctx context.Context) ConnectionMapOutput {
   239  	return pulumi.ToOutputWithContext(ctx, i).(ConnectionMapOutput)
   240  }
   241  
   242  type ConnectionOutput struct{ *pulumi.OutputState }
   243  
   244  func (ConnectionOutput) ElementType() reflect.Type {
   245  	return reflect.TypeOf((**Connection)(nil)).Elem()
   246  }
   247  
   248  func (o ConnectionOutput) ToConnectionOutput() ConnectionOutput {
   249  	return o
   250  }
   251  
   252  func (o ConnectionOutput) ToConnectionOutputWithContext(ctx context.Context) ConnectionOutput {
   253  	return o
   254  }
   255  
   256  // ARN of the connection.
   257  func (o ConnectionOutput) Arn() pulumi.StringOutput {
   258  	return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   259  }
   260  
   261  // Name of the connection.
   262  func (o ConnectionOutput) ConnectionName() pulumi.StringOutput {
   263  	return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.ConnectionName }).(pulumi.StringOutput)
   264  }
   265  
   266  // Source repository provider. Valid values: `GITHUB`.
   267  func (o ConnectionOutput) ProviderType() pulumi.StringOutput {
   268  	return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.ProviderType }).(pulumi.StringOutput)
   269  }
   270  
   271  // Current state of the App Runner connection. When the state is `AVAILABLE`, you can use the connection to create an `apprunner.Service` resource.
   272  func (o ConnectionOutput) Status() pulumi.StringOutput {
   273  	return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   274  }
   275  
   276  // 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.
   277  func (o ConnectionOutput) Tags() pulumi.StringMapOutput {
   278  	return o.ApplyT(func(v *Connection) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   279  }
   280  
   281  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   282  //
   283  // Deprecated: Please use `tags` instead.
   284  func (o ConnectionOutput) TagsAll() pulumi.StringMapOutput {
   285  	return o.ApplyT(func(v *Connection) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   286  }
   287  
   288  type ConnectionArrayOutput struct{ *pulumi.OutputState }
   289  
   290  func (ConnectionArrayOutput) ElementType() reflect.Type {
   291  	return reflect.TypeOf((*[]*Connection)(nil)).Elem()
   292  }
   293  
   294  func (o ConnectionArrayOutput) ToConnectionArrayOutput() ConnectionArrayOutput {
   295  	return o
   296  }
   297  
   298  func (o ConnectionArrayOutput) ToConnectionArrayOutputWithContext(ctx context.Context) ConnectionArrayOutput {
   299  	return o
   300  }
   301  
   302  func (o ConnectionArrayOutput) Index(i pulumi.IntInput) ConnectionOutput {
   303  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Connection {
   304  		return vs[0].([]*Connection)[vs[1].(int)]
   305  	}).(ConnectionOutput)
   306  }
   307  
   308  type ConnectionMapOutput struct{ *pulumi.OutputState }
   309  
   310  func (ConnectionMapOutput) ElementType() reflect.Type {
   311  	return reflect.TypeOf((*map[string]*Connection)(nil)).Elem()
   312  }
   313  
   314  func (o ConnectionMapOutput) ToConnectionMapOutput() ConnectionMapOutput {
   315  	return o
   316  }
   317  
   318  func (o ConnectionMapOutput) ToConnectionMapOutputWithContext(ctx context.Context) ConnectionMapOutput {
   319  	return o
   320  }
   321  
   322  func (o ConnectionMapOutput) MapIndex(k pulumi.StringInput) ConnectionOutput {
   323  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Connection {
   324  		return vs[0].(map[string]*Connection)[vs[1].(string)]
   325  	}).(ConnectionOutput)
   326  }
   327  
   328  func init() {
   329  	pulumi.RegisterInputType(reflect.TypeOf((*ConnectionInput)(nil)).Elem(), &Connection{})
   330  	pulumi.RegisterInputType(reflect.TypeOf((*ConnectionArrayInput)(nil)).Elem(), ConnectionArray{})
   331  	pulumi.RegisterInputType(reflect.TypeOf((*ConnectionMapInput)(nil)).Elem(), ConnectionMap{})
   332  	pulumi.RegisterOutputType(ConnectionOutput{})
   333  	pulumi.RegisterOutputType(ConnectionArrayOutput{})
   334  	pulumi.RegisterOutputType(ConnectionMapOutput{})
   335  }