1. Registry
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. codebuild
  6. SourceCredential

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.79.0
published on Monday, Sep 14, 2026 by Pulumi
aws-native logo aws-native logo

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.79.0
published on Monday, Sep 14, 2026 by Pulumi

    Resource Type definition for AWS::CodeBuild::SourceCredential

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var codeBuildSourceCredential = new AwsNative.CodeBuild.SourceCredential("codeBuildSourceCredential", new()
        {
            Token = "{{resolve:secretsmanager:github_enterprise:SecretString:token}}",
            ServerType = "GITHUB_ENTERPRISE",
            AuthType = "PERSONAL_ACCESS_TOKEN",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/codebuild"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := codebuild.NewSourceCredential(ctx, "codeBuildSourceCredential", &codebuild.SourceCredentialArgs{
    			Token:      pulumi.String("{{resolve:secretsmanager:github_enterprise:SecretString:token}}"),
    			ServerType: pulumi.String("GITHUB_ENTERPRISE"),
    			AuthType:   pulumi.String("PERSONAL_ACCESS_TOKEN"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const codeBuildSourceCredential = new aws_native.codebuild.SourceCredential("codeBuildSourceCredential", {
        token: "{{resolve:secretsmanager:github_enterprise:SecretString:token}}",
        serverType: "GITHUB_ENTERPRISE",
        authType: "PERSONAL_ACCESS_TOKEN",
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    code_build_source_credential = aws_native.codebuild.SourceCredential("codeBuildSourceCredential",
        token="{{resolve:secretsmanager:github_enterprise:SecretString:token}}",
        server_type="GITHUB_ENTERPRISE",
        auth_type="PERSONAL_ACCESS_TOKEN")
    

    Example coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var codeBuildSourceCredential = new AwsNative.CodeBuild.SourceCredential("codeBuildSourceCredential", new()
        {
            Token = "{{resolve:secretsmanager:github_enterprise:SecretString:token}}",
            ServerType = "GITHUB_ENTERPRISE",
            AuthType = "PERSONAL_ACCESS_TOKEN",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/codebuild"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := codebuild.NewSourceCredential(ctx, "codeBuildSourceCredential", &codebuild.SourceCredentialArgs{
    			Token:      pulumi.String("{{resolve:secretsmanager:github_enterprise:SecretString:token}}"),
    			ServerType: pulumi.String("GITHUB_ENTERPRISE"),
    			AuthType:   pulumi.String("PERSONAL_ACCESS_TOKEN"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const codeBuildSourceCredential = new aws_native.codebuild.SourceCredential("codeBuildSourceCredential", {
        token: "{{resolve:secretsmanager:github_enterprise:SecretString:token}}",
        serverType: "GITHUB_ENTERPRISE",
        authType: "PERSONAL_ACCESS_TOKEN",
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    code_build_source_credential = aws_native.codebuild.SourceCredential("codeBuildSourceCredential",
        token="{{resolve:secretsmanager:github_enterprise:SecretString:token}}",
        server_type="GITHUB_ENTERPRISE",
        auth_type="PERSONAL_ACCESS_TOKEN")
    

    Example coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var codeBuildSourceCredential = new AwsNative.CodeBuild.SourceCredential("codeBuildSourceCredential", new()
        {
            Token = "{{resolve:secretsmanager:github:SecretString:token}}",
            ServerType = "GITHUB",
            AuthType = "PERSONAL_ACCESS_TOKEN",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/codebuild"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := codebuild.NewSourceCredential(ctx, "codeBuildSourceCredential", &codebuild.SourceCredentialArgs{
    			Token:      pulumi.String("{{resolve:secretsmanager:github:SecretString:token}}"),
    			ServerType: pulumi.String("GITHUB"),
    			AuthType:   pulumi.String("PERSONAL_ACCESS_TOKEN"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const codeBuildSourceCredential = new aws_native.codebuild.SourceCredential("codeBuildSourceCredential", {
        token: "{{resolve:secretsmanager:github:SecretString:token}}",
        serverType: "GITHUB",
        authType: "PERSONAL_ACCESS_TOKEN",
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    code_build_source_credential = aws_native.codebuild.SourceCredential("codeBuildSourceCredential",
        token="{{resolve:secretsmanager:github:SecretString:token}}",
        server_type="GITHUB",
        auth_type="PERSONAL_ACCESS_TOKEN")
    

    Example coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var codeBuildSourceCredential = new AwsNative.CodeBuild.SourceCredential("codeBuildSourceCredential", new()
        {
            Token = "{{resolve:secretsmanager:github:SecretString:token}}",
            ServerType = "GITHUB",
            AuthType = "PERSONAL_ACCESS_TOKEN",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/codebuild"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := codebuild.NewSourceCredential(ctx, "codeBuildSourceCredential", &codebuild.SourceCredentialArgs{
    			Token:      pulumi.String("{{resolve:secretsmanager:github:SecretString:token}}"),
    			ServerType: pulumi.String("GITHUB"),
    			AuthType:   pulumi.String("PERSONAL_ACCESS_TOKEN"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const codeBuildSourceCredential = new aws_native.codebuild.SourceCredential("codeBuildSourceCredential", {
        token: "{{resolve:secretsmanager:github:SecretString:token}}",
        serverType: "GITHUB",
        authType: "PERSONAL_ACCESS_TOKEN",
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    code_build_source_credential = aws_native.codebuild.SourceCredential("codeBuildSourceCredential",
        token="{{resolve:secretsmanager:github:SecretString:token}}",
        server_type="GITHUB",
        auth_type="PERSONAL_ACCESS_TOKEN")
    

    Example coming soon!

    Create SourceCredential Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SourceCredential(name: string, args: SourceCredentialArgs, opts?: CustomResourceOptions);
    @overload
    def SourceCredential(resource_name: str,
                         args: SourceCredentialArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def SourceCredential(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         auth_type: Optional[str] = None,
                         server_type: Optional[str] = None,
                         token: Optional[str] = None,
                         username: Optional[str] = None)
    func NewSourceCredential(ctx *Context, name string, args SourceCredentialArgs, opts ...ResourceOption) (*SourceCredential, error)
    public SourceCredential(string name, SourceCredentialArgs args, CustomResourceOptions? opts = null)
    public SourceCredential(String name, SourceCredentialArgs args)
    public SourceCredential(String name, SourceCredentialArgs args, CustomResourceOptions options)
    
    type: aws-native:codebuild:SourceCredential
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "aws-native_codebuild_source_credential" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args SourceCredentialArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SourceCredentialArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SourceCredentialArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SourceCredentialArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SourceCredentialArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    SourceCredential Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The SourceCredential resource accepts the following input properties:

    AuthType string
    The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, PERSONAL_ACCESS_TOKEN, CODECONNECTIONS, or SECRETS_MANAGER.
    ServerType string
    The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET.
    Token string
    For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is either the access token or the app password. For the authType CODECONNECTIONS, this is the connectionArn. For the authType SECRETS_MANAGER, this is the secretArn.
    Username string
    The Bitbucket username when the authType is BASIC_AUTH. This parameter is not valid for other types of source providers or connections.
    AuthType string
    The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, PERSONAL_ACCESS_TOKEN, CODECONNECTIONS, or SECRETS_MANAGER.
    ServerType string
    The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET.
    Token string
    For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is either the access token or the app password. For the authType CODECONNECTIONS, this is the connectionArn. For the authType SECRETS_MANAGER, this is the secretArn.
    Username string
    The Bitbucket username when the authType is BASIC_AUTH. This parameter is not valid for other types of source providers or connections.
    auth_type string
    The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, PERSONAL_ACCESS_TOKEN, CODECONNECTIONS, or SECRETS_MANAGER.
    server_type string
    The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET.
    token string
    For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is either the access token or the app password. For the authType CODECONNECTIONS, this is the connectionArn. For the authType SECRETS_MANAGER, this is the secretArn.
    username string
    The Bitbucket username when the authType is BASIC_AUTH. This parameter is not valid for other types of source providers or connections.
    authType String
    The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, PERSONAL_ACCESS_TOKEN, CODECONNECTIONS, or SECRETS_MANAGER.
    serverType String
    The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET.
    token String
    For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is either the access token or the app password. For the authType CODECONNECTIONS, this is the connectionArn. For the authType SECRETS_MANAGER, this is the secretArn.
    username String
    The Bitbucket username when the authType is BASIC_AUTH. This parameter is not valid for other types of source providers or connections.
    authType string
    The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, PERSONAL_ACCESS_TOKEN, CODECONNECTIONS, or SECRETS_MANAGER.
    serverType string
    The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET.
    token string
    For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is either the access token or the app password. For the authType CODECONNECTIONS, this is the connectionArn. For the authType SECRETS_MANAGER, this is the secretArn.
    username string
    The Bitbucket username when the authType is BASIC_AUTH. This parameter is not valid for other types of source providers or connections.
    auth_type str
    The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, PERSONAL_ACCESS_TOKEN, CODECONNECTIONS, or SECRETS_MANAGER.
    server_type str
    The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET.
    token str
    For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is either the access token or the app password. For the authType CODECONNECTIONS, this is the connectionArn. For the authType SECRETS_MANAGER, this is the secretArn.
    username str
    The Bitbucket username when the authType is BASIC_AUTH. This parameter is not valid for other types of source providers or connections.
    authType String
    The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, PERSONAL_ACCESS_TOKEN, CODECONNECTIONS, or SECRETS_MANAGER.
    serverType String
    The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET.
    token String
    For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is either the access token or the app password. For the authType CODECONNECTIONS, this is the connectionArn. For the authType SECRETS_MANAGER, this is the secretArn.
    username String
    The Bitbucket username when the authType is BASIC_AUTH. This parameter is not valid for other types of source providers or connections.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SourceCredential resource produces the following output properties:

    Arn string
    The ARN of the SourceCredential resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    The ARN of the SourceCredential resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    arn string
    The ARN of the SourceCredential resource.
    id string
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the SourceCredential resource.
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    The ARN of the SourceCredential resource.
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    The ARN of the SourceCredential resource.
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the SourceCredential resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo aws-native logo

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.79.0
    published on Monday, Sep 14, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial