Domain management allows you to manage your domains on Fastly and the services that they interact with.
Example Usage
Basic usage:
import * as pulumi from "@pulumi/pulumi";
import * as fastly from "@pulumi/fastly";
const example = new fastly.Domain("example", {
fqdn: "example.com",
serviceId: "12345abcde",
description: "This is a test domain.",
});
import pulumi
import pulumi_fastly as fastly
example = fastly.Domain("example",
fqdn="example.com",
service_id="12345abcde",
description="This is a test domain.")
package main
import (
"github.com/pulumi/pulumi-fastly/sdk/v11/go/fastly"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := fastly.NewDomain(ctx, "example", &fastly.DomainArgs{
Fqdn: pulumi.String("example.com"),
ServiceId: pulumi.String("12345abcde"),
Description: pulumi.String("This is a test domain."),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fastly = Pulumi.Fastly;
return await Deployment.RunAsync(() =>
{
var example = new Fastly.Domain("example", new()
{
Fqdn = "example.com",
ServiceId = "12345abcde",
Description = "This is a test domain.",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.fastly.Domain;
import com.pulumi.fastly.DomainArgs;
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 example = new Domain("example", DomainArgs.builder()
.fqdn("example.com")
.serviceId("12345abcde")
.description("This is a test domain.")
.build());
}
}
resources:
example:
type: fastly:Domain
properties:
fqdn: example.com
serviceId: 12345abcde
description: This is a test domain.
Create Domain Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Domain(name: string, args: DomainArgs, opts?: CustomResourceOptions);@overload
def Domain(resource_name: str,
args: DomainArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Domain(resource_name: str,
opts: Optional[ResourceOptions] = None,
fqdn: Optional[str] = None,
description: Optional[str] = None,
service_id: Optional[str] = None)func NewDomain(ctx *Context, name string, args DomainArgs, opts ...ResourceOption) (*Domain, error)public Domain(string name, DomainArgs args, CustomResourceOptions? opts = null)
public Domain(String name, DomainArgs args)
public Domain(String name, DomainArgs args, CustomResourceOptions options)
type: fastly:Domain
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 DomainArgs
- 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 DomainArgs
- 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 DomainArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DomainArgs
- 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 domainResource = new Fastly.Domain("domainResource", new()
{
Fqdn = "string",
Description = "string",
ServiceId = "string",
});
example, err := fastly.NewDomain(ctx, "domainResource", &fastly.DomainArgs{
Fqdn: pulumi.String("string"),
Description: pulumi.String("string"),
ServiceId: pulumi.String("string"),
})
var domainResource = new Domain("domainResource", DomainArgs.builder()
.fqdn("string")
.description("string")
.serviceId("string")
.build());
domain_resource = fastly.Domain("domainResource",
fqdn="string",
description="string",
service_id="string")
const domainResource = new fastly.Domain("domainResource", {
fqdn: "string",
description: "string",
serviceId: "string",
});
type: fastly:Domain
properties:
description: string
fqdn: string
serviceId: string
Domain 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 Domain resource accepts the following input properties:
- Fqdn string
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - Description string
- The description for your domain.
- Service
Id string - The service_id associated with your domain or null if there is no association.
- Fqdn string
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - Description string
- The description for your domain.
- Service
Id string - The service_id associated with your domain or null if there is no association.
- fqdn String
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - description String
- The description for your domain.
- service
Id String - The service_id associated with your domain or null if there is no association.
- fqdn string
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - description string
- The description for your domain.
- service
Id string - The service_id associated with your domain or null if there is no association.
- fqdn str
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - description str
- The description for your domain.
- service_
id str - The service_id associated with your domain or null if there is no association.
- fqdn String
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - description String
- The description for your domain.
- service
Id String - The service_id associated with your domain or null if there is no association.
Outputs
All input properties are implicitly available as output properties. Additionally, the Domain resource produces the following output properties:
Look up Existing Domain Resource
Get an existing Domain 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?: DomainState, opts?: CustomResourceOptions): Domain@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
domain_id: Optional[str] = None,
fqdn: Optional[str] = None,
service_id: Optional[str] = None) -> Domainfunc GetDomain(ctx *Context, name string, id IDInput, state *DomainState, opts ...ResourceOption) (*Domain, error)public static Domain Get(string name, Input<string> id, DomainState? state, CustomResourceOptions? opts = null)public static Domain get(String name, Output<String> id, DomainState state, CustomResourceOptions options)resources: _: type: fastly:Domain 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.
- Description string
- The description for your domain.
- Domain
Id string - The Domain Identifier (UUID).
- Fqdn string
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - Service
Id string - The service_id associated with your domain or null if there is no association.
- Description string
- The description for your domain.
- Domain
Id string - The Domain Identifier (UUID).
- Fqdn string
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - Service
Id string - The service_id associated with your domain or null if there is no association.
- description String
- The description for your domain.
- domain
Id String - The Domain Identifier (UUID).
- fqdn String
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - service
Id String - The service_id associated with your domain or null if there is no association.
- description string
- The description for your domain.
- domain
Id string - The Domain Identifier (UUID).
- fqdn string
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - service
Id string - The service_id associated with your domain or null if there is no association.
- description str
- The description for your domain.
- domain_
id str - The Domain Identifier (UUID).
- fqdn str
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - service_
id str - The service_id associated with your domain or null if there is no association.
- description String
- The description for your domain.
- domain
Id String - The Domain Identifier (UUID).
- fqdn String
- The fully-qualified domain name for your domain (e.g.
www.example.com, no trailing dot). Can be created, but not updated. - service
Id String - The service_id associated with your domain or null if there is no association.
Import
Domains can be imported using the domain ID, e.g.
$ pulumi import fastly:index/domain:Domain example <domain_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Fastly pulumi/pulumi-fastly
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
fastlyTerraform Provider.
