github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codestarconnections/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 codestarconnections 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 a CodeStar Connection. 15 // 16 // > **NOTE:** The `codestarconnections.Connection` resource is created in the state `PENDING`. Authentication with the connection provider must be completed in the AWS Console. See the [AWS documentation](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-update.html) for details. 17 // 18 // ## Example Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codepipeline" 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codestarconnections" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // example, err := codestarconnections.NewConnection(ctx, "example", &codestarconnections.ConnectionArgs{ 35 // Name: pulumi.String("example-connection"), 36 // ProviderType: pulumi.String("Bitbucket"), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // _, err = codepipeline.NewPipeline(ctx, "example", &codepipeline.PipelineArgs{ 42 // ArtifactStores: codepipeline.PipelineArtifactStoreArray{ 43 // nil, 44 // }, 45 // Stages: codepipeline.PipelineStageArray{ 46 // &codepipeline.PipelineStageArgs{ 47 // Name: pulumi.String("Source"), 48 // Actions: codepipeline.PipelineStageActionArray{ 49 // &codepipeline.PipelineStageActionArgs{ 50 // Name: pulumi.String("Source"), 51 // Category: pulumi.String("Source"), 52 // Owner: pulumi.String("AWS"), 53 // Provider: pulumi.String("CodeStarSourceConnection"), 54 // Version: pulumi.String("1"), 55 // OutputArtifacts: pulumi.StringArray{ 56 // pulumi.String("source_output"), 57 // }, 58 // Configuration: pulumi.StringMap{ 59 // "ConnectionArn": example.Arn, 60 // "FullRepositoryId": pulumi.String("my-organization/test"), 61 // "BranchName": pulumi.String("main"), 62 // }, 63 // }, 64 // }, 65 // }, 66 // &codepipeline.PipelineStageArgs{ 67 // Actions: codepipeline.PipelineStageActionArray{ 68 // nil, 69 // }, 70 // Name: pulumi.String("Build"), 71 // }, 72 // &codepipeline.PipelineStageArgs{ 73 // Actions: codepipeline.PipelineStageActionArray{ 74 // nil, 75 // }, 76 // Name: pulumi.String("Deploy"), 77 // }, 78 // }, 79 // Name: pulumi.String("tf-test-pipeline"), 80 // RoleArn: pulumi.Any(codepipelineRole.Arn), 81 // }) 82 // if err != nil { 83 // return err 84 // } 85 // return nil 86 // }) 87 // } 88 // 89 // ``` 90 // <!--End PulumiCodeChooser --> 91 // 92 // ## Import 93 // 94 // Using `pulumi import`, import CodeStar connections using the ARN. For example: 95 // 96 // ```sh 97 // $ pulumi import aws:codestarconnections/connection:Connection test-connection arn:aws:codestar-connections:us-west-1:0123456789:connection/79d4d357-a2ee-41e4-b350-2fe39ae59448 98 // ``` 99 type Connection struct { 100 pulumi.CustomResourceState 101 102 // The codestar connection ARN. 103 Arn pulumi.StringOutput `pulumi:"arn"` 104 // The codestar connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`. 105 ConnectionStatus pulumi.StringOutput `pulumi:"connectionStatus"` 106 // The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `providerType` 107 HostArn pulumi.StringPtrOutput `pulumi:"hostArn"` 108 // The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. 109 Name pulumi.StringOutput `pulumi:"name"` 110 // The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `providerType` will create a new resource. Conflicts with `hostArn` 111 ProviderType pulumi.StringOutput `pulumi:"providerType"` 112 // Map of key-value resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 113 Tags pulumi.StringMapOutput `pulumi:"tags"` 114 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 115 // 116 // Deprecated: Please use `tags` instead. 117 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 118 } 119 120 // NewConnection registers a new resource with the given unique name, arguments, and options. 121 func NewConnection(ctx *pulumi.Context, 122 name string, args *ConnectionArgs, opts ...pulumi.ResourceOption) (*Connection, error) { 123 if args == nil { 124 args = &ConnectionArgs{} 125 } 126 127 opts = internal.PkgResourceDefaultOpts(opts) 128 var resource Connection 129 err := ctx.RegisterResource("aws:codestarconnections/connection:Connection", name, args, &resource, opts...) 130 if err != nil { 131 return nil, err 132 } 133 return &resource, nil 134 } 135 136 // GetConnection gets an existing Connection resource's state with the given name, ID, and optional 137 // state properties that are used to uniquely qualify the lookup (nil if not required). 138 func GetConnection(ctx *pulumi.Context, 139 name string, id pulumi.IDInput, state *ConnectionState, opts ...pulumi.ResourceOption) (*Connection, error) { 140 var resource Connection 141 err := ctx.ReadResource("aws:codestarconnections/connection:Connection", name, id, state, &resource, opts...) 142 if err != nil { 143 return nil, err 144 } 145 return &resource, nil 146 } 147 148 // Input properties used for looking up and filtering Connection resources. 149 type connectionState struct { 150 // The codestar connection ARN. 151 Arn *string `pulumi:"arn"` 152 // The codestar connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`. 153 ConnectionStatus *string `pulumi:"connectionStatus"` 154 // The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `providerType` 155 HostArn *string `pulumi:"hostArn"` 156 // The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. 157 Name *string `pulumi:"name"` 158 // The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `providerType` will create a new resource. Conflicts with `hostArn` 159 ProviderType *string `pulumi:"providerType"` 160 // Map of key-value resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 161 Tags map[string]string `pulumi:"tags"` 162 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 163 // 164 // Deprecated: Please use `tags` instead. 165 TagsAll map[string]string `pulumi:"tagsAll"` 166 } 167 168 type ConnectionState struct { 169 // The codestar connection ARN. 170 Arn pulumi.StringPtrInput 171 // The codestar connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`. 172 ConnectionStatus pulumi.StringPtrInput 173 // The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `providerType` 174 HostArn pulumi.StringPtrInput 175 // The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. 176 Name pulumi.StringPtrInput 177 // The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `providerType` will create a new resource. Conflicts with `hostArn` 178 ProviderType pulumi.StringPtrInput 179 // Map of key-value resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 180 Tags pulumi.StringMapInput 181 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 182 // 183 // Deprecated: Please use `tags` instead. 184 TagsAll pulumi.StringMapInput 185 } 186 187 func (ConnectionState) ElementType() reflect.Type { 188 return reflect.TypeOf((*connectionState)(nil)).Elem() 189 } 190 191 type connectionArgs struct { 192 // The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `providerType` 193 HostArn *string `pulumi:"hostArn"` 194 // The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. 195 Name *string `pulumi:"name"` 196 // The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `providerType` will create a new resource. Conflicts with `hostArn` 197 ProviderType *string `pulumi:"providerType"` 198 // Map of key-value resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 199 Tags map[string]string `pulumi:"tags"` 200 } 201 202 // The set of arguments for constructing a Connection resource. 203 type ConnectionArgs struct { 204 // The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `providerType` 205 HostArn pulumi.StringPtrInput 206 // The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. 207 Name pulumi.StringPtrInput 208 // The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `providerType` will create a new resource. Conflicts with `hostArn` 209 ProviderType pulumi.StringPtrInput 210 // Map of key-value resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 211 Tags pulumi.StringMapInput 212 } 213 214 func (ConnectionArgs) ElementType() reflect.Type { 215 return reflect.TypeOf((*connectionArgs)(nil)).Elem() 216 } 217 218 type ConnectionInput interface { 219 pulumi.Input 220 221 ToConnectionOutput() ConnectionOutput 222 ToConnectionOutputWithContext(ctx context.Context) ConnectionOutput 223 } 224 225 func (*Connection) ElementType() reflect.Type { 226 return reflect.TypeOf((**Connection)(nil)).Elem() 227 } 228 229 func (i *Connection) ToConnectionOutput() ConnectionOutput { 230 return i.ToConnectionOutputWithContext(context.Background()) 231 } 232 233 func (i *Connection) ToConnectionOutputWithContext(ctx context.Context) ConnectionOutput { 234 return pulumi.ToOutputWithContext(ctx, i).(ConnectionOutput) 235 } 236 237 // ConnectionArrayInput is an input type that accepts ConnectionArray and ConnectionArrayOutput values. 238 // You can construct a concrete instance of `ConnectionArrayInput` via: 239 // 240 // ConnectionArray{ ConnectionArgs{...} } 241 type ConnectionArrayInput interface { 242 pulumi.Input 243 244 ToConnectionArrayOutput() ConnectionArrayOutput 245 ToConnectionArrayOutputWithContext(context.Context) ConnectionArrayOutput 246 } 247 248 type ConnectionArray []ConnectionInput 249 250 func (ConnectionArray) ElementType() reflect.Type { 251 return reflect.TypeOf((*[]*Connection)(nil)).Elem() 252 } 253 254 func (i ConnectionArray) ToConnectionArrayOutput() ConnectionArrayOutput { 255 return i.ToConnectionArrayOutputWithContext(context.Background()) 256 } 257 258 func (i ConnectionArray) ToConnectionArrayOutputWithContext(ctx context.Context) ConnectionArrayOutput { 259 return pulumi.ToOutputWithContext(ctx, i).(ConnectionArrayOutput) 260 } 261 262 // ConnectionMapInput is an input type that accepts ConnectionMap and ConnectionMapOutput values. 263 // You can construct a concrete instance of `ConnectionMapInput` via: 264 // 265 // ConnectionMap{ "key": ConnectionArgs{...} } 266 type ConnectionMapInput interface { 267 pulumi.Input 268 269 ToConnectionMapOutput() ConnectionMapOutput 270 ToConnectionMapOutputWithContext(context.Context) ConnectionMapOutput 271 } 272 273 type ConnectionMap map[string]ConnectionInput 274 275 func (ConnectionMap) ElementType() reflect.Type { 276 return reflect.TypeOf((*map[string]*Connection)(nil)).Elem() 277 } 278 279 func (i ConnectionMap) ToConnectionMapOutput() ConnectionMapOutput { 280 return i.ToConnectionMapOutputWithContext(context.Background()) 281 } 282 283 func (i ConnectionMap) ToConnectionMapOutputWithContext(ctx context.Context) ConnectionMapOutput { 284 return pulumi.ToOutputWithContext(ctx, i).(ConnectionMapOutput) 285 } 286 287 type ConnectionOutput struct{ *pulumi.OutputState } 288 289 func (ConnectionOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((**Connection)(nil)).Elem() 291 } 292 293 func (o ConnectionOutput) ToConnectionOutput() ConnectionOutput { 294 return o 295 } 296 297 func (o ConnectionOutput) ToConnectionOutputWithContext(ctx context.Context) ConnectionOutput { 298 return o 299 } 300 301 // The codestar connection ARN. 302 func (o ConnectionOutput) Arn() pulumi.StringOutput { 303 return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 304 } 305 306 // The codestar connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`. 307 func (o ConnectionOutput) ConnectionStatus() pulumi.StringOutput { 308 return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.ConnectionStatus }).(pulumi.StringOutput) 309 } 310 311 // The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `providerType` 312 func (o ConnectionOutput) HostArn() pulumi.StringPtrOutput { 313 return o.ApplyT(func(v *Connection) pulumi.StringPtrOutput { return v.HostArn }).(pulumi.StringPtrOutput) 314 } 315 316 // The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. 317 func (o ConnectionOutput) Name() pulumi.StringOutput { 318 return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 319 } 320 321 // The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `providerType` will create a new resource. Conflicts with `hostArn` 322 func (o ConnectionOutput) ProviderType() pulumi.StringOutput { 323 return o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.ProviderType }).(pulumi.StringOutput) 324 } 325 326 // Map of key-value resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 327 func (o ConnectionOutput) Tags() pulumi.StringMapOutput { 328 return o.ApplyT(func(v *Connection) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 329 } 330 331 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 332 // 333 // Deprecated: Please use `tags` instead. 334 func (o ConnectionOutput) TagsAll() pulumi.StringMapOutput { 335 return o.ApplyT(func(v *Connection) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 336 } 337 338 type ConnectionArrayOutput struct{ *pulumi.OutputState } 339 340 func (ConnectionArrayOutput) ElementType() reflect.Type { 341 return reflect.TypeOf((*[]*Connection)(nil)).Elem() 342 } 343 344 func (o ConnectionArrayOutput) ToConnectionArrayOutput() ConnectionArrayOutput { 345 return o 346 } 347 348 func (o ConnectionArrayOutput) ToConnectionArrayOutputWithContext(ctx context.Context) ConnectionArrayOutput { 349 return o 350 } 351 352 func (o ConnectionArrayOutput) Index(i pulumi.IntInput) ConnectionOutput { 353 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Connection { 354 return vs[0].([]*Connection)[vs[1].(int)] 355 }).(ConnectionOutput) 356 } 357 358 type ConnectionMapOutput struct{ *pulumi.OutputState } 359 360 func (ConnectionMapOutput) ElementType() reflect.Type { 361 return reflect.TypeOf((*map[string]*Connection)(nil)).Elem() 362 } 363 364 func (o ConnectionMapOutput) ToConnectionMapOutput() ConnectionMapOutput { 365 return o 366 } 367 368 func (o ConnectionMapOutput) ToConnectionMapOutputWithContext(ctx context.Context) ConnectionMapOutput { 369 return o 370 } 371 372 func (o ConnectionMapOutput) MapIndex(k pulumi.StringInput) ConnectionOutput { 373 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Connection { 374 return vs[0].(map[string]*Connection)[vs[1].(string)] 375 }).(ConnectionOutput) 376 } 377 378 func init() { 379 pulumi.RegisterInputType(reflect.TypeOf((*ConnectionInput)(nil)).Elem(), &Connection{}) 380 pulumi.RegisterInputType(reflect.TypeOf((*ConnectionArrayInput)(nil)).Elem(), ConnectionArray{}) 381 pulumi.RegisterInputType(reflect.TypeOf((*ConnectionMapInput)(nil)).Elem(), ConnectionMap{}) 382 pulumi.RegisterOutputType(ConnectionOutput{}) 383 pulumi.RegisterOutputType(ConnectionArrayOutput{}) 384 pulumi.RegisterOutputType(ConnectionMapOutput{}) 385 }