1. Packages
  2. Commercetools Provider
  3. API Docs
  4. ShippingZone
commercetools 1.19.3 published on Friday, Apr 4, 2025 by labd

commercetools.ShippingZone

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as commercetools from "@pulumi/commercetools";

const de_us = new commercetools.ShippingZone("de-us", {
    description: "Germany and US",
    key: "some-key",
    locations: [
        {
            country: "DE",
        },
        {
            country: "US",
            state: "Nevada",
        },
    ],
});
Copy
import pulumi
import pulumi_commercetools as commercetools

de_us = commercetools.ShippingZone("de-us",
    description="Germany and US",
    key="some-key",
    locations=[
        {
            "country": "DE",
        },
        {
            "country": "US",
            "state": "Nevada",
        },
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/commercetools/commercetools"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := commercetools.NewShippingZone(ctx, "de-us", &commercetools.ShippingZoneArgs{
			Description: pulumi.String("Germany and US"),
			Key:         pulumi.String("some-key"),
			Locations: commercetools.ShippingZoneLocationArray{
				&commercetools.ShippingZoneLocationArgs{
					Country: pulumi.String("DE"),
				},
				&commercetools.ShippingZoneLocationArgs{
					Country: pulumi.String("US"),
					State:   pulumi.String("Nevada"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Commercetools = Pulumi.Commercetools;

return await Deployment.RunAsync(() => 
{
    var de_us = new Commercetools.ShippingZone("de-us", new()
    {
        Description = "Germany and US",
        Key = "some-key",
        Locations = new[]
        {
            new Commercetools.Inputs.ShippingZoneLocationArgs
            {
                Country = "DE",
            },
            new Commercetools.Inputs.ShippingZoneLocationArgs
            {
                Country = "US",
                State = "Nevada",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.commercetools.ShippingZone;
import com.pulumi.commercetools.ShippingZoneArgs;
import com.pulumi.commercetools.inputs.ShippingZoneLocationArgs;
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 de_us = new ShippingZone("de-us", ShippingZoneArgs.builder()
            .description("Germany and US")
            .key("some-key")
            .locations(            
                ShippingZoneLocationArgs.builder()
                    .country("DE")
                    .build(),
                ShippingZoneLocationArgs.builder()
                    .country("US")
                    .state("Nevada")
                    .build())
            .build());

    }
}
Copy
resources:
  de-us:
    type: commercetools:ShippingZone
    properties:
      description: Germany and US
      key: some-key
      locations:
        - country: DE
        - country: US
          state: Nevada
Copy

Create ShippingZone Resource

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

Constructor syntax

new ShippingZone(name: string, args?: ShippingZoneArgs, opts?: CustomResourceOptions);
@overload
def ShippingZone(resource_name: str,
                 args: Optional[ShippingZoneArgs] = None,
                 opts: Optional[ResourceOptions] = None)

@overload
def ShippingZone(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 description: Optional[str] = None,
                 key: Optional[str] = None,
                 locations: Optional[Sequence[ShippingZoneLocationArgs]] = None,
                 name: Optional[str] = None,
                 shipping_zone_id: Optional[str] = None)
func NewShippingZone(ctx *Context, name string, args *ShippingZoneArgs, opts ...ResourceOption) (*ShippingZone, error)
public ShippingZone(string name, ShippingZoneArgs? args = null, CustomResourceOptions? opts = null)
public ShippingZone(String name, ShippingZoneArgs args)
public ShippingZone(String name, ShippingZoneArgs args, CustomResourceOptions options)
type: commercetools:ShippingZone
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args ShippingZoneArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args ShippingZoneArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args ShippingZoneArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args ShippingZoneArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ShippingZoneArgs
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 shippingZoneResource = new Commercetools.ShippingZone("shippingZoneResource", new()
{
    Description = "string",
    Key = "string",
    Locations = new[]
    {
        new Commercetools.Inputs.ShippingZoneLocationArgs
        {
            Country = "string",
            State = "string",
        },
    },
    Name = "string",
    ShippingZoneId = "string",
});
Copy
example, err := commercetools.NewShippingZone(ctx, "shippingZoneResource", &commercetools.ShippingZoneArgs{
Description: pulumi.String("string"),
Key: pulumi.String("string"),
Locations: .ShippingZoneLocationArray{
&.ShippingZoneLocationArgs{
Country: pulumi.String("string"),
State: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
ShippingZoneId: pulumi.String("string"),
})
Copy
var shippingZoneResource = new ShippingZone("shippingZoneResource", ShippingZoneArgs.builder()
    .description("string")
    .key("string")
    .locations(ShippingZoneLocationArgs.builder()
        .country("string")
        .state("string")
        .build())
    .name("string")
    .shippingZoneId("string")
    .build());
Copy
shipping_zone_resource = commercetools.ShippingZone("shippingZoneResource",
    description="string",
    key="string",
    locations=[{
        "country": "string",
        "state": "string",
    }],
    name="string",
    shipping_zone_id="string")
Copy
const shippingZoneResource = new commercetools.ShippingZone("shippingZoneResource", {
    description: "string",
    key: "string",
    locations: [{
        country: "string",
        state: "string",
    }],
    name: "string",
    shippingZoneId: "string",
});
Copy
type: commercetools:ShippingZone
properties:
    description: string
    key: string
    locations:
        - country: string
          state: string
    name: string
    shippingZoneId: string
Copy

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

Description string
Key string
User-specific unique identifier for a zone. Must be unique across a project
Locations List<ShippingZoneLocation>
Location
Name string
ShippingZoneId string
The ID of this resource.
Description string
Key string
User-specific unique identifier for a zone. Must be unique across a project
Locations []ShippingZoneLocationArgs
Location
Name string
ShippingZoneId string
The ID of this resource.
description String
key String
User-specific unique identifier for a zone. Must be unique across a project
locations List<ShippingZoneLocation>
Location
name String
shippingZoneId String
The ID of this resource.
description string
key string
User-specific unique identifier for a zone. Must be unique across a project
locations ShippingZoneLocation[]
Location
name string
shippingZoneId string
The ID of this resource.
description str
key str
User-specific unique identifier for a zone. Must be unique across a project
locations Sequence[ShippingZoneLocationArgs]
Location
name str
shipping_zone_id str
The ID of this resource.
description String
key String
User-specific unique identifier for a zone. Must be unique across a project
locations List<Property Map>
Location
name String
shippingZoneId String
The ID of this resource.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Version double
Id string
The provider-assigned unique ID for this managed resource.
Version float64
id String
The provider-assigned unique ID for this managed resource.
version Double
id string
The provider-assigned unique ID for this managed resource.
version number
id str
The provider-assigned unique ID for this managed resource.
version float
id String
The provider-assigned unique ID for this managed resource.
version Number

Look up Existing ShippingZone Resource

Get an existing ShippingZone 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?: ShippingZoneState, opts?: CustomResourceOptions): ShippingZone
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        key: Optional[str] = None,
        locations: Optional[Sequence[ShippingZoneLocationArgs]] = None,
        name: Optional[str] = None,
        shipping_zone_id: Optional[str] = None,
        version: Optional[float] = None) -> ShippingZone
func GetShippingZone(ctx *Context, name string, id IDInput, state *ShippingZoneState, opts ...ResourceOption) (*ShippingZone, error)
public static ShippingZone Get(string name, Input<string> id, ShippingZoneState? state, CustomResourceOptions? opts = null)
public static ShippingZone get(String name, Output<String> id, ShippingZoneState state, CustomResourceOptions options)
resources:  _:    type: commercetools:ShippingZone    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Description string
Key string
User-specific unique identifier for a zone. Must be unique across a project
Locations List<ShippingZoneLocation>
Location
Name string
ShippingZoneId string
The ID of this resource.
Version double
Description string
Key string
User-specific unique identifier for a zone. Must be unique across a project
Locations []ShippingZoneLocationArgs
Location
Name string
ShippingZoneId string
The ID of this resource.
Version float64
description String
key String
User-specific unique identifier for a zone. Must be unique across a project
locations List<ShippingZoneLocation>
Location
name String
shippingZoneId String
The ID of this resource.
version Double
description string
key string
User-specific unique identifier for a zone. Must be unique across a project
locations ShippingZoneLocation[]
Location
name string
shippingZoneId string
The ID of this resource.
version number
description str
key str
User-specific unique identifier for a zone. Must be unique across a project
locations Sequence[ShippingZoneLocationArgs]
Location
name str
shipping_zone_id str
The ID of this resource.
version float
description String
key String
User-specific unique identifier for a zone. Must be unique across a project
locations List<Property Map>
Location
name String
shippingZoneId String
The ID of this resource.
version Number

Supporting Types

ShippingZoneLocation
, ShippingZoneLocationArgs

Country This property is required. string
A two-digit country code as per ISO 3166-1 alpha-2
State string
Country This property is required. string
A two-digit country code as per ISO 3166-1 alpha-2
State string
country This property is required. String
A two-digit country code as per ISO 3166-1 alpha-2
state String
country This property is required. string
A two-digit country code as per ISO 3166-1 alpha-2
state string
country This property is required. str
A two-digit country code as per ISO 3166-1 alpha-2
state str
country This property is required. String
A two-digit country code as per ISO 3166-1 alpha-2
state String

Package Details

Repository
commercetools labd/terraform-provider-commercetools
License
Notes
This Pulumi package is based on the commercetools Terraform Provider.