netlify.SiteBuildSettings
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netlify from "@pulumi/netlify";
const blog = new netlify.SiteBuildSettings("blog", {
siteId: data.netlify_site.blog.id,
buildCommand: "npm run build",
publishDirectory: "dist",
productionBranch: "main",
branchDeployBranches: [
"preview",
"staging",
],
});
import pulumi
import pulumi_netlify as netlify
blog = netlify.SiteBuildSettings("blog",
site_id=data["netlify_site"]["blog"]["id"],
build_command="npm run build",
publish_directory="dist",
production_branch="main",
branch_deploy_branches=[
"preview",
"staging",
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netlify/netlify"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := netlify.NewSiteBuildSettings(ctx, "blog", &netlify.SiteBuildSettingsArgs{
SiteId: pulumi.Any(data.Netlify_site.Blog.Id),
BuildCommand: pulumi.String("npm run build"),
PublishDirectory: pulumi.String("dist"),
ProductionBranch: pulumi.String("main"),
BranchDeployBranches: pulumi.StringArray{
pulumi.String("preview"),
pulumi.String("staging"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netlify = Pulumi.Netlify;
return await Deployment.RunAsync(() =>
{
var blog = new Netlify.SiteBuildSettings("blog", new()
{
SiteId = data.Netlify_site.Blog.Id,
BuildCommand = "npm run build",
PublishDirectory = "dist",
ProductionBranch = "main",
BranchDeployBranches = new[]
{
"preview",
"staging",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netlify.SiteBuildSettings;
import com.pulumi.netlify.SiteBuildSettingsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var blog = new SiteBuildSettings("blog", SiteBuildSettingsArgs.builder()
.siteId(data.netlify_site().blog().id())
.buildCommand("npm run build")
.publishDirectory("dist")
.productionBranch("main")
.branchDeployBranches(
"preview",
"staging")
.build());
}
}
resources:
blog:
type: netlify:SiteBuildSettings
properties:
siteId: ${data.netlify_site.blog.id}
buildCommand: npm run build
publishDirectory: dist
productionBranch: main
branchDeployBranches:
- preview
- staging
Create SiteBuildSettings Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SiteBuildSettings(name: string, args: SiteBuildSettingsArgs, opts?: CustomResourceOptions);
@overload
def SiteBuildSettings(resource_name: str,
args: SiteBuildSettingsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SiteBuildSettings(resource_name: str,
opts: Optional[ResourceOptions] = None,
production_branch: Optional[str] = None,
site_id: Optional[str] = None,
publish_directory: Optional[str] = None,
build_command: Optional[str] = None,
functions_directory: Optional[str] = None,
deploy_previews: Optional[bool] = None,
base_directory: Optional[str] = None,
functions_region: Optional[str] = None,
package_directory: Optional[str] = None,
pretty_urls: Optional[bool] = None,
build_image: Optional[str] = None,
branch_deploy_branches: Optional[Sequence[str]] = None,
branch_deploy_all_branches: Optional[bool] = None,
stop_builds: Optional[bool] = None,
waf_policy_id: Optional[str] = None)
func NewSiteBuildSettings(ctx *Context, name string, args SiteBuildSettingsArgs, opts ...ResourceOption) (*SiteBuildSettings, error)
public SiteBuildSettings(string name, SiteBuildSettingsArgs args, CustomResourceOptions? opts = null)
public SiteBuildSettings(String name, SiteBuildSettingsArgs args)
public SiteBuildSettings(String name, SiteBuildSettingsArgs args, CustomResourceOptions options)
type: netlify:SiteBuildSettings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SiteBuildSettingsArgs
- 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 SiteBuildSettingsArgs
- 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 SiteBuildSettingsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SiteBuildSettingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SiteBuildSettingsArgs
- 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 siteBuildSettingsResource = new Netlify.SiteBuildSettings("siteBuildSettingsResource", new()
{
ProductionBranch = "string",
SiteId = "string",
PublishDirectory = "string",
BuildCommand = "string",
FunctionsDirectory = "string",
DeployPreviews = false,
BaseDirectory = "string",
FunctionsRegion = "string",
PackageDirectory = "string",
PrettyUrls = false,
BuildImage = "string",
BranchDeployBranches = new[]
{
"string",
},
BranchDeployAllBranches = false,
StopBuilds = false,
WafPolicyId = "string",
});
example, err := netlify.NewSiteBuildSettings(ctx, "siteBuildSettingsResource", &netlify.SiteBuildSettingsArgs{
ProductionBranch: pulumi.String("string"),
SiteId: pulumi.String("string"),
PublishDirectory: pulumi.String("string"),
BuildCommand: pulumi.String("string"),
FunctionsDirectory: pulumi.String("string"),
DeployPreviews: pulumi.Bool(false),
BaseDirectory: pulumi.String("string"),
FunctionsRegion: pulumi.String("string"),
PackageDirectory: pulumi.String("string"),
PrettyUrls: pulumi.Bool(false),
BuildImage: pulumi.String("string"),
BranchDeployBranches: pulumi.StringArray{
pulumi.String("string"),
},
BranchDeployAllBranches: pulumi.Bool(false),
StopBuilds: pulumi.Bool(false),
WafPolicyId: pulumi.String("string"),
})
var siteBuildSettingsResource = new SiteBuildSettings("siteBuildSettingsResource", SiteBuildSettingsArgs.builder()
.productionBranch("string")
.siteId("string")
.publishDirectory("string")
.buildCommand("string")
.functionsDirectory("string")
.deployPreviews(false)
.baseDirectory("string")
.functionsRegion("string")
.packageDirectory("string")
.prettyUrls(false)
.buildImage("string")
.branchDeployBranches("string")
.branchDeployAllBranches(false)
.stopBuilds(false)
.wafPolicyId("string")
.build());
site_build_settings_resource = netlify.SiteBuildSettings("siteBuildSettingsResource",
production_branch="string",
site_id="string",
publish_directory="string",
build_command="string",
functions_directory="string",
deploy_previews=False,
base_directory="string",
functions_region="string",
package_directory="string",
pretty_urls=False,
build_image="string",
branch_deploy_branches=["string"],
branch_deploy_all_branches=False,
stop_builds=False,
waf_policy_id="string")
const siteBuildSettingsResource = new netlify.SiteBuildSettings("siteBuildSettingsResource", {
productionBranch: "string",
siteId: "string",
publishDirectory: "string",
buildCommand: "string",
functionsDirectory: "string",
deployPreviews: false,
baseDirectory: "string",
functionsRegion: "string",
packageDirectory: "string",
prettyUrls: false,
buildImage: "string",
branchDeployBranches: ["string"],
branchDeployAllBranches: false,
stopBuilds: false,
wafPolicyId: "string",
});
type: netlify:SiteBuildSettings
properties:
baseDirectory: string
branchDeployAllBranches: false
branchDeployBranches:
- string
buildCommand: string
buildImage: string
deployPreviews: false
functionsDirectory: string
functionsRegion: string
packageDirectory: string
prettyUrls: false
productionBranch: string
publishDirectory: string
siteId: string
stopBuilds: false
wafPolicyId: string
SiteBuildSettings 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 SiteBuildSettings resource accepts the following input properties:
- Build
Command string - Production
Branch string - Publish
Directory string - Site
Id string - Base
Directory string - Branch
Deploy boolAll Branches - Branch
Deploy List<string>Branches - Build
Image string - Deploy
Previews bool - Functions
Directory string - Functions
Region string - Package
Directory string - Pretty
Urls bool - Stop
Builds bool - Waf
Policy stringId - See more details in the netlifywafpolicy resource.
- Build
Command string - Production
Branch string - Publish
Directory string - Site
Id string - Base
Directory string - Branch
Deploy boolAll Branches - Branch
Deploy []stringBranches - Build
Image string - Deploy
Previews bool - Functions
Directory string - Functions
Region string - Package
Directory string - Pretty
Urls bool - Stop
Builds bool - Waf
Policy stringId - See more details in the netlifywafpolicy resource.
- build
Command String - production
Branch String - publish
Directory String - site
Id String - base
Directory String - branch
Deploy BooleanAll Branches - branch
Deploy List<String>Branches - build
Image String - deploy
Previews Boolean - functions
Directory String - functions
Region String - package
Directory String - pretty
Urls Boolean - stop
Builds Boolean - waf
Policy StringId - See more details in the netlifywafpolicy resource.
- build
Command string - production
Branch string - publish
Directory string - site
Id string - base
Directory string - branch
Deploy booleanAll Branches - branch
Deploy string[]Branches - build
Image string - deploy
Previews boolean - functions
Directory string - functions
Region string - package
Directory string - pretty
Urls boolean - stop
Builds boolean - waf
Policy stringId - See more details in the netlifywafpolicy resource.
- build_
command str - production_
branch str - publish_
directory str - site_
id str - base_
directory str - branch_
deploy_ boolall_ branches - branch_
deploy_ Sequence[str]branches - build_
image str - deploy_
previews bool - functions_
directory str - functions_
region str - package_
directory str - pretty_
urls bool - stop_
builds bool - waf_
policy_ strid - See more details in the netlifywafpolicy resource.
- build
Command String - production
Branch String - publish
Directory String - site
Id String - base
Directory String - branch
Deploy BooleanAll Branches - branch
Deploy List<String>Branches - build
Image String - deploy
Previews Boolean - functions
Directory String - functions
Region String - package
Directory String - pretty
Urls Boolean - stop
Builds Boolean - waf
Policy StringId - See more details in the netlifywafpolicy resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the SiteBuildSettings resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated string
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated str
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String
Look up Existing SiteBuildSettings Resource
Get an existing SiteBuildSettings resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: SiteBuildSettingsState, opts?: CustomResourceOptions): SiteBuildSettings
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
base_directory: Optional[str] = None,
branch_deploy_all_branches: Optional[bool] = None,
branch_deploy_branches: Optional[Sequence[str]] = None,
build_command: Optional[str] = None,
build_image: Optional[str] = None,
deploy_previews: Optional[bool] = None,
functions_directory: Optional[str] = None,
functions_region: Optional[str] = None,
last_updated: Optional[str] = None,
package_directory: Optional[str] = None,
pretty_urls: Optional[bool] = None,
production_branch: Optional[str] = None,
publish_directory: Optional[str] = None,
site_id: Optional[str] = None,
stop_builds: Optional[bool] = None,
waf_policy_id: Optional[str] = None) -> SiteBuildSettings
func GetSiteBuildSettings(ctx *Context, name string, id IDInput, state *SiteBuildSettingsState, opts ...ResourceOption) (*SiteBuildSettings, error)
public static SiteBuildSettings Get(string name, Input<string> id, SiteBuildSettingsState? state, CustomResourceOptions? opts = null)
public static SiteBuildSettings get(String name, Output<String> id, SiteBuildSettingsState state, CustomResourceOptions options)
resources: _: type: netlify:SiteBuildSettings get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Base
Directory string - Branch
Deploy boolAll Branches - Branch
Deploy List<string>Branches - Build
Command string - Build
Image string - Deploy
Previews bool - Functions
Directory string - Functions
Region string - Last
Updated string - Package
Directory string - Pretty
Urls bool - Production
Branch string - Publish
Directory string - Site
Id string - Stop
Builds bool - Waf
Policy stringId - See more details in the netlifywafpolicy resource.
- Base
Directory string - Branch
Deploy boolAll Branches - Branch
Deploy []stringBranches - Build
Command string - Build
Image string - Deploy
Previews bool - Functions
Directory string - Functions
Region string - Last
Updated string - Package
Directory string - Pretty
Urls bool - Production
Branch string - Publish
Directory string - Site
Id string - Stop
Builds bool - Waf
Policy stringId - See more details in the netlifywafpolicy resource.
- base
Directory String - branch
Deploy BooleanAll Branches - branch
Deploy List<String>Branches - build
Command String - build
Image String - deploy
Previews Boolean - functions
Directory String - functions
Region String - last
Updated String - package
Directory String - pretty
Urls Boolean - production
Branch String - publish
Directory String - site
Id String - stop
Builds Boolean - waf
Policy StringId - See more details in the netlifywafpolicy resource.
- base
Directory string - branch
Deploy booleanAll Branches - branch
Deploy string[]Branches - build
Command string - build
Image string - deploy
Previews boolean - functions
Directory string - functions
Region string - last
Updated string - package
Directory string - pretty
Urls boolean - production
Branch string - publish
Directory string - site
Id string - stop
Builds boolean - waf
Policy stringId - See more details in the netlifywafpolicy resource.
- base_
directory str - branch_
deploy_ boolall_ branches - branch_
deploy_ Sequence[str]branches - build_
command str - build_
image str - deploy_
previews bool - functions_
directory str - functions_
region str - last_
updated str - package_
directory str - pretty_
urls bool - production_
branch str - publish_
directory str - site_
id str - stop_
builds bool - waf_
policy_ strid - See more details in the netlifywafpolicy resource.
- base
Directory String - branch
Deploy BooleanAll Branches - branch
Deploy List<String>Branches - build
Command String - build
Image String - deploy
Previews Boolean - functions
Directory String - functions
Region String - last
Updated String - package
Directory String - pretty
Urls Boolean - production
Branch String - publish
Directory String - site
Id String - stop
Builds Boolean - waf
Policy StringId - See more details in the netlifywafpolicy resource.
Import
Import a site’s domain settings by the site ID
$ pulumi import netlify:index/siteBuildSettings:SiteBuildSettings blog 12345667-0000-0000-0000-abcdef012345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- netlify netlify/terraform-provider-netlify
- License
- Notes
- This Pulumi package is based on the
netlify
Terraform Provider.