1. Packages
  2. Impart Security
  3. API Docs
  4. Spec
Impart Security v0.9.0 published on Friday, Mar 21, 2025 by Impart Security

impart.Spec

Explore with Pulumi AI

Manage a specification.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as impart from "@impart-security/pulumi-impart";

// Create a new specification
const example = new impart.Spec("example", {
    name: "spec_example",
    sourceFile: `${path.module}/spec.yaml`,
    sourceHash: "<sha256 hash for the source_file content>",
});
Copy
import pulumi
import pulumi_impart as impart

# Create a new specification
example = impart.Spec("example",
    name="spec_example",
    source_file=f"{path['module']}/spec.yaml",
    source_hash="<sha256 hash for the source_file content>")
Copy
package main

import (
	"fmt"

	"github.com/impart-security/pulumi-impart/sdk/go/impart"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a new specification
		_, err := impart.NewSpec(ctx, "example", &impart.SpecArgs{
			Name:       pulumi.String("spec_example"),
			SourceFile: pulumi.Sprintf("%v/spec.yaml", path.Module),
			SourceHash: pulumi.String("<sha256 hash for the source_file content>"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Impart = Pulumi.Impart;

return await Deployment.RunAsync(() => 
{
    // Create a new specification
    var example = new Impart.Spec("example", new()
    {
        Name = "spec_example",
        SourceFile = $"{path.Module}/spec.yaml",
        SourceHash = "<sha256 hash for the source_file content>",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.impart.Spec;
import com.pulumi.impart.SpecArgs;
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) {
        // Create a new specification
        var example = new Spec("example", SpecArgs.builder()
            .name("spec_example")
            .sourceFile(String.format("%s/spec.yaml", path.module()))
            .sourceHash("<sha256 hash for the source_file content>")
            .build());

    }
}
Copy
resources:
  # Create a new specification
  example:
    type: impart:Spec
    properties:
      name: spec_example
      sourceFile: ${path.module}/spec.yaml
      sourceHash: <sha256 hash for the source_file content>
Copy

Create Spec Resource

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

Constructor syntax

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

@overload
def Spec(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         name: Optional[str] = None,
         source_file: Optional[str] = None,
         source_hash: Optional[str] = None)
func NewSpec(ctx *Context, name string, args SpecArgs, opts ...ResourceOption) (*Spec, error)
public Spec(string name, SpecArgs args, CustomResourceOptions? opts = null)
public Spec(String name, SpecArgs args)
public Spec(String name, SpecArgs args, CustomResourceOptions options)
type: impart:Spec
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 This property is required. SpecArgs
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 This property is required. SpecArgs
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 This property is required. SpecArgs
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 This property is required. SpecArgs
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. SpecArgs
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 specResource = new Impart.Spec("specResource", new()
{
    Name = "string",
    SourceFile = "string",
    SourceHash = "string",
});
Copy
example, err := impart.NewSpec(ctx, "specResource", &impart.SpecArgs{
	Name:       pulumi.String("string"),
	SourceFile: pulumi.String("string"),
	SourceHash: pulumi.String("string"),
})
Copy
var specResource = new Spec("specResource", SpecArgs.builder()
    .name("string")
    .sourceFile("string")
    .sourceHash("string")
    .build());
Copy
spec_resource = impart.Spec("specResource",
    name="string",
    source_file="string",
    source_hash="string")
Copy
const specResource = new impart.Spec("specResource", {
    name: "string",
    sourceFile: "string",
    sourceHash: "string",
});
Copy
type: impart:Spec
properties:
    name: string
    sourceFile: string
    sourceHash: string
Copy

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

Name This property is required. string
The name for this specification.
SourceFile This property is required. string
The specification file.
SourceHash string
The specification source hash.
Name This property is required. string
The name for this specification.
SourceFile This property is required. string
The specification file.
SourceHash string
The specification source hash.
name This property is required. String
The name for this specification.
sourceFile This property is required. String
The specification file.
sourceHash String
The specification source hash.
name This property is required. string
The name for this specification.
sourceFile This property is required. string
The specification file.
sourceHash string
The specification source hash.
name This property is required. str
The name for this specification.
source_file This property is required. str
The specification file.
source_hash str
The specification source hash.
name This property is required. String
The name for this specification.
sourceFile This property is required. String
The specification file.
sourceHash String
The specification source hash.

Outputs

All input properties are implicitly available as output properties. Additionally, the Spec 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 Spec Resource

Get an existing Spec 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?: SpecState, opts?: CustomResourceOptions): Spec
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        source_file: Optional[str] = None,
        source_hash: Optional[str] = None) -> Spec
func GetSpec(ctx *Context, name string, id IDInput, state *SpecState, opts ...ResourceOption) (*Spec, error)
public static Spec Get(string name, Input<string> id, SpecState? state, CustomResourceOptions? opts = null)
public static Spec get(String name, Output<String> id, SpecState state, CustomResourceOptions options)
resources:  _:    type: impart:Spec    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:
Name string
The name for this specification.
SourceFile string
The specification file.
SourceHash string
The specification source hash.
Name string
The name for this specification.
SourceFile string
The specification file.
SourceHash string
The specification source hash.
name String
The name for this specification.
sourceFile String
The specification file.
sourceHash String
The specification source hash.
name string
The name for this specification.
sourceFile string
The specification file.
sourceHash string
The specification source hash.
name str
The name for this specification.
source_file str
The specification file.
source_hash str
The specification source hash.
name String
The name for this specification.
sourceFile String
The specification file.
sourceHash String
The specification source hash.

Import

#!/bin/bash

$ pulumi import impart:index/spec:Spec example "<id>"
Copy

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

Package Details

Repository
impart impart-security/pulumi-impart
License
Apache-2.0
Notes
This Pulumi package is based on the impart Terraform Provider.