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>",
});
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>")
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.String(fmt.Sprintf("%v/spec.yaml", path.Module)),
SourceHash: pulumi.String("<sha256 hash for the source_file content>"),
})
if err != nil {
return err
}
return nil
})
}
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>",
});
});
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());
}
}
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>
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)
type: impart:Spec
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 SpecArgs
- 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 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 string
- The unique name of the resource.
- args SpecArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SpecArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := impart.NewSpec(ctx, "specResource", &impart.SpecArgs{
Name: pulumi.String("string"),
SourceFile: pulumi.String("string"),
SourceHash: pulumi.String("string"),
})
var specResource = new Spec("specResource", SpecArgs.builder()
.name("string")
.sourceFile("string")
.sourceHash("string")
.build());
spec_resource = impart.Spec("specResource",
name="string",
source_file="string",
source_hash="string")
const specResource = new impart.Spec("specResource", {
name: "string",
sourceFile: "string",
sourceHash: "string",
});
type: impart:Spec
properties:
name: string
sourceFile: string
sourceHash: string
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
The Spec resource accepts the following input properties:
- Name string
- The name for this specification.
- Source
File string - The specification file.
- Source
Hash string - The specification source hash.
- Name string
- The name for this specification.
- Source
File string - The specification file.
- Source
Hash string - The specification source hash.
- name String
- The name for this specification.
- source
File String - The specification file.
- source
Hash String - The specification source hash.
- name string
- The name for this specification.
- source
File string - The specification file.
- source
Hash 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.
- source
File String - The specification file.
- source
Hash 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)
Resource lookup is not supported in YAML
- 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.
- Name string
- The name for this specification.
- Source
File string - The specification file.
- Source
Hash string - The specification source hash.
- Name string
- The name for this specification.
- Source
File string - The specification file.
- Source
Hash string - The specification source hash.
- name String
- The name for this specification.
- source
File String - The specification file.
- source
Hash String - The specification source hash.
- name string
- The name for this specification.
- source
File string - The specification file.
- source
Hash 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.
- source
File String - The specification file.
- source
Hash String - The specification source hash.
Import
#!/bin/bash
$ pulumi import impart:index/spec:Spec example "<id>"
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.