1. Packages
  2. Packages
  3. Defang Providers
  4. API Docs
  5. Build
Viewing docs for Defang GCP v2.4.1
published on Saturday, Jul 11, 2026 by Defang
defang-gcp logo
Viewing docs for Defang GCP v2.4.1
published on Saturday, Jul 11, 2026 by Defang

    Create Build Resource

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

    Constructor syntax

    new Build(name: string, args: BuildArgs, opts?: CustomResourceOptions);
    @overload
    def Build(resource_name: str,
              args: BuildArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Build(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              location: Optional[str] = None,
              project_id: Optional[str] = None,
              source: Optional[str] = None,
              steps: Optional[str] = None,
              disk_size_gb: Optional[int] = None,
              images: Optional[Sequence[str]] = None,
              machine_type: Optional[str] = None,
              max_wait_time: Optional[int] = None,
              service_account: Optional[str] = None,
              source_digest: Optional[str] = None,
              substitutions: Optional[Mapping[str, str]] = None,
              tags: Optional[Sequence[str]] = None)
    func NewBuild(ctx *Context, name string, args BuildArgs, opts ...ResourceOption) (*Build, error)
    public Build(string name, BuildArgs args, CustomResourceOptions? opts = null)
    public Build(String name, BuildArgs args)
    public Build(String name, BuildArgs args, CustomResourceOptions options)
    
    type: defang-gcp:Build
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "defang-gcp_build" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args BuildArgs
    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 BuildArgs
    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 BuildArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BuildArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BuildArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var buildResource = new DefangGcp.Build("buildResource", new()
    {
        Location = "string",
        ProjectId = "string",
        Source = "string",
        Steps = "string",
        DiskSizeGb = 0,
        Images = new[]
        {
            "string",
        },
        MachineType = "string",
        MaxWaitTime = 0,
        ServiceAccount = "string",
        SourceDigest = "string",
        Substitutions = 
        {
            { "string", "string" },
        },
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := defanggcp.NewBuild(ctx, "buildResource", &defanggcp.BuildArgs{
    	Location:   pulumi.String("string"),
    	ProjectId:  pulumi.String("string"),
    	Source:     pulumi.String("string"),
    	Steps:      pulumi.String("string"),
    	DiskSizeGb: pulumi.Int(0),
    	Images: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	MachineType:    pulumi.String("string"),
    	MaxWaitTime:    pulumi.Int(0),
    	ServiceAccount: pulumi.String("string"),
    	SourceDigest:   pulumi.String("string"),
    	Substitutions: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "defang-gcp_build" "buildResource" {
      replace_on_changes = ["images[*]", "location", "projectId", "serviceAccount", "source", "sourceDigest", "steps"]
      location           = "string"
      project_id         = "string"
      source             = "string"
      steps              = "string"
      disk_size_gb       = 0
      images             = ["string"]
      machine_type       = "string"
      max_wait_time      = 0
      service_account    = "string"
      source_digest      = "string"
      substitutions = {
        "string" = "string"
      }
      tags = ["string"]
    }
    
    var buildResource = new Build("buildResource", BuildArgs.builder()
        .location("string")
        .projectId("string")
        .source("string")
        .steps("string")
        .diskSizeGb(0)
        .images("string")
        .machineType("string")
        .maxWaitTime(0)
        .serviceAccount("string")
        .sourceDigest("string")
        .substitutions(Map.of("string", "string"))
        .tags("string")
        .build());
    
    build_resource = defang_gcp.Build("buildResource",
        location="string",
        project_id="string",
        source="string",
        steps="string",
        disk_size_gb=0,
        images=["string"],
        machine_type="string",
        max_wait_time=0,
        service_account="string",
        source_digest="string",
        substitutions={
            "string": "string",
        },
        tags=["string"])
    
    const buildResource = new defang_gcp.Build("buildResource", {
        location: "string",
        projectId: "string",
        source: "string",
        steps: "string",
        diskSizeGb: 0,
        images: ["string"],
        machineType: "string",
        maxWaitTime: 0,
        serviceAccount: "string",
        sourceDigest: "string",
        substitutions: {
            string: "string",
        },
        tags: ["string"],
    });
    
    type: defang-gcp:Build
    properties:
        diskSizeGb: 0
        images:
            - string
        location: string
        machineType: string
        maxWaitTime: 0
        projectId: string
        serviceAccount: string
        source: string
        sourceDigest: string
        steps: string
        substitutions:
            string: string
        tags:
            - string
    

    Build 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 Build resource accepts the following input properties:

    Location string
    ProjectId string
    Source string
    Steps string
    DiskSizeGb int
    Images List<string>
    MachineType string
    MaxWaitTime int
    ServiceAccount string
    SourceDigest string
    Substitutions Dictionary<string, string>
    Tags List<string>
    Location string
    ProjectId string
    Source string
    Steps string
    DiskSizeGb int
    Images []string
    MachineType string
    MaxWaitTime int
    ServiceAccount string
    SourceDigest string
    Substitutions map[string]string
    Tags []string
    location string
    project_id string
    source string
    steps string
    disk_size_gb number
    images list(string)
    machine_type string
    max_wait_time number
    service_account string
    source_digest string
    substitutions map(string)
    tags list(string)
    location String
    projectId String
    source String
    steps String
    diskSizeGb Integer
    images List<String>
    machineType String
    maxWaitTime Integer
    serviceAccount String
    sourceDigest String
    substitutions Map<String,String>
    tags List<String>
    location string
    projectId string
    source string
    steps string
    diskSizeGb number
    images string[]
    machineType string
    maxWaitTime number
    serviceAccount string
    sourceDigest string
    substitutions {[key: string]: string}
    tags string[]
    location str
    project_id str
    source str
    steps str
    disk_size_gb int
    images Sequence[str]
    machine_type str
    max_wait_time int
    service_account str
    source_digest str
    substitutions Mapping[str, str]
    tags Sequence[str]
    location String
    projectId String
    source String
    steps String
    diskSizeGb Number
    images List<String>
    machineType String
    maxWaitTime Number
    serviceAccount String
    sourceDigest String
    substitutions Map<String>
    tags List<String>

    Outputs

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

    BuildId string
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageDigest string
    BuildId string
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageDigest string
    build_id string
    id string
    The provider-assigned unique ID for this managed resource.
    image_digest string
    buildId String
    id String
    The provider-assigned unique ID for this managed resource.
    imageDigest String
    buildId string
    id string
    The provider-assigned unique ID for this managed resource.
    imageDigest string
    build_id str
    id str
    The provider-assigned unique ID for this managed resource.
    image_digest str
    buildId String
    id String
    The provider-assigned unique ID for this managed resource.
    imageDigest String

    Package Details

    Repository
    defang-gcp DefangLabs/pulumi-defang
    License
    Apache-2.0
    defang-gcp logo
    Viewing docs for Defang GCP v2.4.1
    published on Saturday, Jul 11, 2026 by Defang

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial