1. Packages
  2. Packages
  3. Rootly
  4. API Docs
  5. ApiKey
Viewing docs for Rootly v3.3.0
published on Thursday, May 7, 2026 by rootlyhq
rootly logo
Viewing docs for Rootly v3.3.0
published on Thursday, May 7, 2026 by rootlyhq

    Example Usage

    resource "rootly_api_key" "ci_pipeline" {
      name       = "CI Pipeline"
      expires_at = "2027-01-01T00:00:00Z"
    }
    

    Create ApiKey Resource

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

    Constructor syntax

    new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def ApiKey(resource_name: str,
               args: ApiKeyArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApiKey(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               expires_at: Optional[str] = None,
               description: Optional[str] = None,
               grace_period_ends_at: Optional[str] = None,
               kind: Optional[str] = None,
               last_used_at: Optional[str] = None,
               name: Optional[str] = None,
               on_call_role_id: Optional[str] = None,
               role_id: Optional[str] = None)
    func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)
    public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
    public ApiKey(String name, ApiKeyArgs args)
    public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
    
    type: rootly:ApiKey
    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 ApiKeyArgs
    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 ApiKeyArgs
    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 ApiKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApiKeyArgs
    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 apiKeyResource = new Rootly.ApiKey("apiKeyResource", new()
    {
        ExpiresAt = "string",
        Description = "string",
        GracePeriodEndsAt = "string",
        Kind = "string",
        LastUsedAt = "string",
        Name = "string",
        OnCallRoleId = "string",
        RoleId = "string",
    });
    
    example, err := rootly.NewApiKey(ctx, "apiKeyResource", &rootly.ApiKeyArgs{
    	ExpiresAt:         pulumi.String("string"),
    	Description:       pulumi.String("string"),
    	GracePeriodEndsAt: pulumi.String("string"),
    	Kind:              pulumi.String("string"),
    	LastUsedAt:        pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	OnCallRoleId:      pulumi.String("string"),
    	RoleId:            pulumi.String("string"),
    })
    
    var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
        .expiresAt("string")
        .description("string")
        .gracePeriodEndsAt("string")
        .kind("string")
        .lastUsedAt("string")
        .name("string")
        .onCallRoleId("string")
        .roleId("string")
        .build());
    
    api_key_resource = rootly.ApiKey("apiKeyResource",
        expires_at="string",
        description="string",
        grace_period_ends_at="string",
        kind="string",
        last_used_at="string",
        name="string",
        on_call_role_id="string",
        role_id="string")
    
    const apiKeyResource = new rootly.ApiKey("apiKeyResource", {
        expiresAt: "string",
        description: "string",
        gracePeriodEndsAt: "string",
        kind: "string",
        lastUsedAt: "string",
        name: "string",
        onCallRoleId: "string",
        roleId: "string",
    });
    
    type: rootly:ApiKey
    properties:
        description: string
        expiresAt: string
        gracePeriodEndsAt: string
        kind: string
        lastUsedAt: string
        name: string
        onCallRoleId: string
        roleId: string
    

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

    ExpiresAt string
    Expiration date
    Description string
    A description of the API key
    GracePeriodEndsAt string
    Grace period end date
    Kind string
    The kind of the API key. Value must be one of personal, team, organization.
    LastUsedAt string
    Date of last use
    Name string
    The name of the API key
    OnCallRoleId string
    The on-call role ID
    RoleId string
    The role ID
    ExpiresAt string
    Expiration date
    Description string
    A description of the API key
    GracePeriodEndsAt string
    Grace period end date
    Kind string
    The kind of the API key. Value must be one of personal, team, organization.
    LastUsedAt string
    Date of last use
    Name string
    The name of the API key
    OnCallRoleId string
    The on-call role ID
    RoleId string
    The role ID
    expiresAt String
    Expiration date
    description String
    A description of the API key
    gracePeriodEndsAt String
    Grace period end date
    kind String
    The kind of the API key. Value must be one of personal, team, organization.
    lastUsedAt String
    Date of last use
    name String
    The name of the API key
    onCallRoleId String
    The on-call role ID
    roleId String
    The role ID
    expiresAt string
    Expiration date
    description string
    A description of the API key
    gracePeriodEndsAt string
    Grace period end date
    kind string
    The kind of the API key. Value must be one of personal, team, organization.
    lastUsedAt string
    Date of last use
    name string
    The name of the API key
    onCallRoleId string
    The on-call role ID
    roleId string
    The role ID
    expires_at str
    Expiration date
    description str
    A description of the API key
    grace_period_ends_at str
    Grace period end date
    kind str
    The kind of the API key. Value must be one of personal, team, organization.
    last_used_at str
    Date of last use
    name str
    The name of the API key
    on_call_role_id str
    The on-call role ID
    role_id str
    The role ID
    expiresAt String
    Expiration date
    description String
    A description of the API key
    gracePeriodEndsAt String
    Grace period end date
    kind String
    The kind of the API key. Value must be one of personal, team, organization.
    lastUsedAt String
    Date of last use
    name String
    The name of the API key
    onCallRoleId String
    The on-call role ID
    roleId String
    The role ID

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ApiKey Resource

    Get an existing ApiKey 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?: ApiKeyState, opts?: CustomResourceOptions): ApiKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            expires_at: Optional[str] = None,
            grace_period_ends_at: Optional[str] = None,
            kind: Optional[str] = None,
            last_used_at: Optional[str] = None,
            name: Optional[str] = None,
            on_call_role_id: Optional[str] = None,
            role_id: Optional[str] = None) -> ApiKey
    func GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)
    public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)
    public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)
    resources:  _:    type: rootly:ApiKey    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.
    The following state arguments are supported:
    Description string
    A description of the API key
    ExpiresAt string
    Expiration date
    GracePeriodEndsAt string
    Grace period end date
    Kind string
    The kind of the API key. Value must be one of personal, team, organization.
    LastUsedAt string
    Date of last use
    Name string
    The name of the API key
    OnCallRoleId string
    The on-call role ID
    RoleId string
    The role ID
    Description string
    A description of the API key
    ExpiresAt string
    Expiration date
    GracePeriodEndsAt string
    Grace period end date
    Kind string
    The kind of the API key. Value must be one of personal, team, organization.
    LastUsedAt string
    Date of last use
    Name string
    The name of the API key
    OnCallRoleId string
    The on-call role ID
    RoleId string
    The role ID
    description String
    A description of the API key
    expiresAt String
    Expiration date
    gracePeriodEndsAt String
    Grace period end date
    kind String
    The kind of the API key. Value must be one of personal, team, organization.
    lastUsedAt String
    Date of last use
    name String
    The name of the API key
    onCallRoleId String
    The on-call role ID
    roleId String
    The role ID
    description string
    A description of the API key
    expiresAt string
    Expiration date
    gracePeriodEndsAt string
    Grace period end date
    kind string
    The kind of the API key. Value must be one of personal, team, organization.
    lastUsedAt string
    Date of last use
    name string
    The name of the API key
    onCallRoleId string
    The on-call role ID
    roleId string
    The role ID
    description str
    A description of the API key
    expires_at str
    Expiration date
    grace_period_ends_at str
    Grace period end date
    kind str
    The kind of the API key. Value must be one of personal, team, organization.
    last_used_at str
    Date of last use
    name str
    The name of the API key
    on_call_role_id str
    The on-call role ID
    role_id str
    The role ID
    description String
    A description of the API key
    expiresAt String
    Expiration date
    gracePeriodEndsAt String
    Grace period end date
    kind String
    The kind of the API key. Value must be one of personal, team, organization.
    lastUsedAt String
    Date of last use
    name String
    The name of the API key
    onCallRoleId String
    The on-call role ID
    roleId String
    The role ID

    Import

    rootly.ApiKey can be imported using the import command.

    $ pulumi import rootly:index/apiKey:ApiKey primary a816421c-6ceb-481a-87c4-585e47451f24
    

    Or using an import block.

    Locate the resource id in the web app, or retrieve it by listing resources through the API if it’s not visible in the web app.

    HCL can be generated from the import block using the -generate-config-out flag.

    pulumi preview -generate-config-out=generated.tf
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    rootly rootlyhq/pulumi-rootly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rootly Terraform Provider.
    rootly logo
    Viewing docs for Rootly v3.3.0
    published on Thursday, May 7, 2026 by rootlyhq
      Try Pulumi Cloud free. Your team will thank you.