1. Packages
  2. GitHub
  3. API Docs
  4. ActionsEnvironmentSecret
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

github.ActionsEnvironmentSecret

Explore with Pulumi AI

github logo
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const exampleSecretActionsEnvironmentSecret = new github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", {
        environment: "example_environment",
        secretName: "example_secret_name",
        plaintextValue: _var.some_secret_string,
    });
    const exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", {
        environment: "example_environment",
        secretName: "example_secret_name",
        encryptedValue: _var.some_encrypted_secret_string,
    });
    
    import pulumi
    import pulumi_github as github
    
    example_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret",
        environment="example_environment",
        secret_name="example_secret_name",
        plaintext_value=var["some_secret_string"])
    example_secret_index_actions_environment_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret",
        environment="example_environment",
        secret_name="example_secret_name",
        encrypted_value=var["some_encrypted_secret_string"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.NewActionsEnvironmentSecret(ctx, "exampleSecretActionsEnvironmentSecret", &github.ActionsEnvironmentSecretArgs{
    			Environment:    pulumi.String("example_environment"),
    			SecretName:     pulumi.String("example_secret_name"),
    			PlaintextValue: pulumi.Any(_var.Some_secret_string),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = github.NewActionsEnvironmentSecret(ctx, "exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", &github.ActionsEnvironmentSecretArgs{
    			Environment:    pulumi.String("example_environment"),
    			SecretName:     pulumi.String("example_secret_name"),
    			EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleSecretActionsEnvironmentSecret = new Github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", new()
        {
            Environment = "example_environment",
            SecretName = "example_secret_name",
            PlaintextValue = @var.Some_secret_string,
        });
    
        var exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new Github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", new()
        {
            Environment = "example_environment",
            SecretName = "example_secret_name",
            EncryptedValue = @var.Some_encrypted_secret_string,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.ActionsEnvironmentSecret;
    import com.pulumi.github.ActionsEnvironmentSecretArgs;
    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 exampleSecretActionsEnvironmentSecret = new ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", ActionsEnvironmentSecretArgs.builder()        
                .environment("example_environment")
                .secretName("example_secret_name")
                .plaintextValue(var_.some_secret_string())
                .build());
    
            var exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", ActionsEnvironmentSecretArgs.builder()        
                .environment("example_environment")
                .secretName("example_secret_name")
                .encryptedValue(var_.some_encrypted_secret_string())
                .build());
    
        }
    }
    
    resources:
      exampleSecretActionsEnvironmentSecret:
        type: github:ActionsEnvironmentSecret
        properties:
          environment: example_environment
          secretName: example_secret_name
          plaintextValue: ${var.some_secret_string}
      exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret:
        type: github:ActionsEnvironmentSecret
        properties:
          environment: example_environment
          secretName: example_secret_name
          encryptedValue: ${var.some_encrypted_secret_string}
    
    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const repo = github.getRepository({
        fullName: "my-org/repo",
    });
    const repoEnvironment = new github.RepositoryEnvironment("repoEnvironment", {
        repository: repo.then(repo => repo.name),
        environment: "example_environment",
    });
    const testSecret = new github.ActionsEnvironmentSecret("testSecret", {
        repository: repo.then(repo => repo.name),
        environment: repoEnvironment.environment,
        secretName: "test_secret_name",
        plaintextValue: "%s",
    });
    
    import pulumi
    import pulumi_github as github
    
    repo = github.get_repository(full_name="my-org/repo")
    repo_environment = github.RepositoryEnvironment("repoEnvironment",
        repository=repo.name,
        environment="example_environment")
    test_secret = github.ActionsEnvironmentSecret("testSecret",
        repository=repo.name,
        environment=repo_environment.environment,
        secret_name="test_secret_name",
        plaintext_value="%s")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{
    			FullName: pulumi.StringRef("my-org/repo"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		repoEnvironment, err := github.NewRepositoryEnvironment(ctx, "repoEnvironment", &github.RepositoryEnvironmentArgs{
    			Repository:  *pulumi.String(repo.Name),
    			Environment: pulumi.String("example_environment"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = github.NewActionsEnvironmentSecret(ctx, "testSecret", &github.ActionsEnvironmentSecretArgs{
    			Repository:     *pulumi.String(repo.Name),
    			Environment:    repoEnvironment.Environment,
    			SecretName:     pulumi.String("test_secret_name"),
    			PlaintextValue: pulumi.String("%s"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var repo = Github.GetRepository.Invoke(new()
        {
            FullName = "my-org/repo",
        });
    
        var repoEnvironment = new Github.RepositoryEnvironment("repoEnvironment", new()
        {
            Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name),
            Environment = "example_environment",
        });
    
        var testSecret = new Github.ActionsEnvironmentSecret("testSecret", new()
        {
            Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name),
            Environment = repoEnvironment.Environment,
            SecretName = "test_secret_name",
            PlaintextValue = "%s",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.GithubFunctions;
    import com.pulumi.github.inputs.GetRepositoryArgs;
    import com.pulumi.github.RepositoryEnvironment;
    import com.pulumi.github.RepositoryEnvironmentArgs;
    import com.pulumi.github.ActionsEnvironmentSecret;
    import com.pulumi.github.ActionsEnvironmentSecretArgs;
    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) {
            final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder()
                .fullName("my-org/repo")
                .build());
    
            var repoEnvironment = new RepositoryEnvironment("repoEnvironment", RepositoryEnvironmentArgs.builder()        
                .repository(repo.applyValue(getRepositoryResult -> getRepositoryResult.name()))
                .environment("example_environment")
                .build());
    
            var testSecret = new ActionsEnvironmentSecret("testSecret", ActionsEnvironmentSecretArgs.builder()        
                .repository(repo.applyValue(getRepositoryResult -> getRepositoryResult.name()))
                .environment(repoEnvironment.environment())
                .secretName("test_secret_name")
                .plaintextValue("%s")
                .build());
    
        }
    }
    
    resources:
      repoEnvironment:
        type: github:RepositoryEnvironment
        properties:
          repository: ${repo.name}
          environment: example_environment
      testSecret:
        type: github:ActionsEnvironmentSecret
        properties:
          repository: ${repo.name}
          environment: ${repoEnvironment.environment}
          secretName: test_secret_name
          plaintextValue: '%s'
    variables:
      repo:
        fn::invoke:
          Function: github:getRepository
          Arguments:
            fullName: my-org/repo
    

    Create ActionsEnvironmentSecret Resource

    new ActionsEnvironmentSecret(name: string, args: ActionsEnvironmentSecretArgs, opts?: CustomResourceOptions);
    @overload
    def ActionsEnvironmentSecret(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 encrypted_value: Optional[str] = None,
                                 environment: Optional[str] = None,
                                 plaintext_value: Optional[str] = None,
                                 repository: Optional[str] = None,
                                 secret_name: Optional[str] = None)
    @overload
    def ActionsEnvironmentSecret(resource_name: str,
                                 args: ActionsEnvironmentSecretArgs,
                                 opts: Optional[ResourceOptions] = None)
    func NewActionsEnvironmentSecret(ctx *Context, name string, args ActionsEnvironmentSecretArgs, opts ...ResourceOption) (*ActionsEnvironmentSecret, error)
    public ActionsEnvironmentSecret(string name, ActionsEnvironmentSecretArgs args, CustomResourceOptions? opts = null)
    public ActionsEnvironmentSecret(String name, ActionsEnvironmentSecretArgs args)
    public ActionsEnvironmentSecret(String name, ActionsEnvironmentSecretArgs args, CustomResourceOptions options)
    
    type: github:ActionsEnvironmentSecret
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ActionsEnvironmentSecretArgs
    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 ActionsEnvironmentSecretArgs
    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 ActionsEnvironmentSecretArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ActionsEnvironmentSecretArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ActionsEnvironmentSecretArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Environment string
    Name of the environment.
    Repository string
    Name of the repository.
    SecretName string
    Name of the secret.
    EncryptedValue string
    Encrypted value of the secret using the GitHub public key in Base64 format.
    PlaintextValue string
    Plaintext value of the secret to be encrypted.
    Environment string
    Name of the environment.
    Repository string
    Name of the repository.
    SecretName string
    Name of the secret.
    EncryptedValue string
    Encrypted value of the secret using the GitHub public key in Base64 format.
    PlaintextValue string
    Plaintext value of the secret to be encrypted.
    environment String
    Name of the environment.
    repository String
    Name of the repository.
    secretName String
    Name of the secret.
    encryptedValue String
    Encrypted value of the secret using the GitHub public key in Base64 format.
    plaintextValue String
    Plaintext value of the secret to be encrypted.
    environment string
    Name of the environment.
    repository string
    Name of the repository.
    secretName string
    Name of the secret.
    encryptedValue string
    Encrypted value of the secret using the GitHub public key in Base64 format.
    plaintextValue string
    Plaintext value of the secret to be encrypted.
    environment str
    Name of the environment.
    repository str
    Name of the repository.
    secret_name str
    Name of the secret.
    encrypted_value str
    Encrypted value of the secret using the GitHub public key in Base64 format.
    plaintext_value str
    Plaintext value of the secret to be encrypted.
    environment String
    Name of the environment.
    repository String
    Name of the repository.
    secretName String
    Name of the secret.
    encryptedValue String
    Encrypted value of the secret using the GitHub public key in Base64 format.
    plaintextValue String
    Plaintext value of the secret to be encrypted.

    Outputs

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

    CreatedAt string
    Date of actions_environment_secret creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    Date of actions_environment_secret update.
    CreatedAt string
    Date of actions_environment_secret creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    Date of actions_environment_secret update.
    createdAt String
    Date of actions_environment_secret creation.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    Date of actions_environment_secret update.
    createdAt string
    Date of actions_environment_secret creation.
    id string
    The provider-assigned unique ID for this managed resource.
    updatedAt string
    Date of actions_environment_secret update.
    created_at str
    Date of actions_environment_secret creation.
    id str
    The provider-assigned unique ID for this managed resource.
    updated_at str
    Date of actions_environment_secret update.
    createdAt String
    Date of actions_environment_secret creation.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    Date of actions_environment_secret update.

    Look up Existing ActionsEnvironmentSecret Resource

    Get an existing ActionsEnvironmentSecret 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?: ActionsEnvironmentSecretState, opts?: CustomResourceOptions): ActionsEnvironmentSecret
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            encrypted_value: Optional[str] = None,
            environment: Optional[str] = None,
            plaintext_value: Optional[str] = None,
            repository: Optional[str] = None,
            secret_name: Optional[str] = None,
            updated_at: Optional[str] = None) -> ActionsEnvironmentSecret
    func GetActionsEnvironmentSecret(ctx *Context, name string, id IDInput, state *ActionsEnvironmentSecretState, opts ...ResourceOption) (*ActionsEnvironmentSecret, error)
    public static ActionsEnvironmentSecret Get(string name, Input<string> id, ActionsEnvironmentSecretState? state, CustomResourceOptions? opts = null)
    public static ActionsEnvironmentSecret get(String name, Output<String> id, ActionsEnvironmentSecretState 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.
    The following state arguments are supported:
    CreatedAt string
    Date of actions_environment_secret creation.
    EncryptedValue string
    Encrypted value of the secret using the GitHub public key in Base64 format.
    Environment string
    Name of the environment.
    PlaintextValue string
    Plaintext value of the secret to be encrypted.
    Repository string
    Name of the repository.
    SecretName string
    Name of the secret.
    UpdatedAt string
    Date of actions_environment_secret update.
    CreatedAt string
    Date of actions_environment_secret creation.
    EncryptedValue string
    Encrypted value of the secret using the GitHub public key in Base64 format.
    Environment string
    Name of the environment.
    PlaintextValue string
    Plaintext value of the secret to be encrypted.
    Repository string
    Name of the repository.
    SecretName string
    Name of the secret.
    UpdatedAt string
    Date of actions_environment_secret update.
    createdAt String
    Date of actions_environment_secret creation.
    encryptedValue String
    Encrypted value of the secret using the GitHub public key in Base64 format.
    environment String
    Name of the environment.
    plaintextValue String
    Plaintext value of the secret to be encrypted.
    repository String
    Name of the repository.
    secretName String
    Name of the secret.
    updatedAt String
    Date of actions_environment_secret update.
    createdAt string
    Date of actions_environment_secret creation.
    encryptedValue string
    Encrypted value of the secret using the GitHub public key in Base64 format.
    environment string
    Name of the environment.
    plaintextValue string
    Plaintext value of the secret to be encrypted.
    repository string
    Name of the repository.
    secretName string
    Name of the secret.
    updatedAt string
    Date of actions_environment_secret update.
    created_at str
    Date of actions_environment_secret creation.
    encrypted_value str
    Encrypted value of the secret using the GitHub public key in Base64 format.
    environment str
    Name of the environment.
    plaintext_value str
    Plaintext value of the secret to be encrypted.
    repository str
    Name of the repository.
    secret_name str
    Name of the secret.
    updated_at str
    Date of actions_environment_secret update.
    createdAt String
    Date of actions_environment_secret creation.
    encryptedValue String
    Encrypted value of the secret using the GitHub public key in Base64 format.
    environment String
    Name of the environment.
    plaintextValue String
    Plaintext value of the secret to be encrypted.
    repository String
    Name of the repository.
    secretName String
    Name of the secret.
    updatedAt String
    Date of actions_environment_secret update.

    Import

    This resource does not support importing. If you’d like to help contribute it, please visit our GitHub page!

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi