cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc
cyral.getSidecarId
Explore with Pulumi AI
Given a sidecar name, retrieves the respective sidecar ID.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cyral from "@pulumi/cyral";
const sidecar1 = new cyral.Sidecar("sidecar1", {deploymentMethod: "cloudFormation"});
const _this = cyral.getSidecarIdOutput({
    sidecarName: sidecar1.name,
});
export const sidecarId = _this.apply(_this => _this.id);
import pulumi
import pulumi_cyral as cyral
sidecar1 = cyral.Sidecar("sidecar1", deployment_method="cloudFormation")
this = cyral.get_sidecar_id_output(sidecar_name=sidecar1.name)
pulumi.export("sidecarId", this.id)
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/cyral/v4/cyral"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		sidecar1, err := cyral.NewSidecar(ctx, "sidecar1", &cyral.SidecarArgs{
			DeploymentMethod: pulumi.String("cloudFormation"),
		})
		if err != nil {
			return err
		}
		this := cyral.GetSidecarIdOutput(ctx, cyral.GetSidecarIdOutputArgs{
			SidecarName: sidecar1.Name,
		}, nil)
		ctx.Export("sidecarId", this.ApplyT(func(this cyral.GetSidecarIdResult) (*string, error) {
			return &this.Id, nil
		}).(pulumi.StringPtrOutput))
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cyral = Pulumi.Cyral;
return await Deployment.RunAsync(() => 
{
    var sidecar1 = new Cyral.Sidecar("sidecar1", new()
    {
        DeploymentMethod = "cloudFormation",
    });
    var @this = Cyral.GetSidecarId.Invoke(new()
    {
        SidecarName = sidecar1.Name,
    });
    return new Dictionary<string, object?>
    {
        ["sidecarId"] = @this.Apply(@this => @this.Apply(getSidecarIdResult => getSidecarIdResult.Id)),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cyral.Sidecar;
import com.pulumi.cyral.SidecarArgs;
import com.pulumi.cyral.CyralFunctions;
import com.pulumi.cyral.inputs.GetSidecarIdArgs;
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 sidecar1 = new Sidecar("sidecar1", SidecarArgs.builder()
            .deploymentMethod("cloudFormation")
            .build());
        final var this = CyralFunctions.getSidecarId(GetSidecarIdArgs.builder()
            .sidecarName(sidecar1.name())
            .build());
        ctx.export("sidecarId", this_.applyValue(this_ -> this_.id()));
    }
}
resources:
  sidecar1:
    type: cyral:Sidecar
    properties:
      deploymentMethod: cloudFormation
variables:
  this:
    fn::invoke:
      function: cyral:getSidecarId
      arguments:
        sidecarName: ${sidecar1.name}
outputs:
  sidecarId: ${this.id}
Using getSidecarId
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSidecarId(args: GetSidecarIdArgs, opts?: InvokeOptions): Promise<GetSidecarIdResult>
function getSidecarIdOutput(args: GetSidecarIdOutputArgs, opts?: InvokeOptions): Output<GetSidecarIdResult>def get_sidecar_id(sidecar_name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetSidecarIdResult
def get_sidecar_id_output(sidecar_name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetSidecarIdResult]func GetSidecarId(ctx *Context, args *GetSidecarIdArgs, opts ...InvokeOption) (*GetSidecarIdResult, error)
func GetSidecarIdOutput(ctx *Context, args *GetSidecarIdOutputArgs, opts ...InvokeOption) GetSidecarIdResultOutput> Note: This function is named GetSidecarId in the Go SDK.
public static class GetSidecarId 
{
    public static Task<GetSidecarIdResult> InvokeAsync(GetSidecarIdArgs args, InvokeOptions? opts = null)
    public static Output<GetSidecarIdResult> Invoke(GetSidecarIdInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSidecarIdResult> getSidecarId(GetSidecarIdArgs args, InvokeOptions options)
public static Output<GetSidecarIdResult> getSidecarId(GetSidecarIdArgs args, InvokeOptions options)
fn::invoke:
  function: cyral:index/getSidecarId:getSidecarId
  arguments:
    # arguments dictionaryThe following arguments are supported:
- SidecarName string
- The name of the sidecar.
- SidecarName string
- The name of the sidecar.
- sidecarName String
- The name of the sidecar.
- sidecarName string
- The name of the sidecar.
- sidecar_name str
- The name of the sidecar.
- sidecarName String
- The name of the sidecar.
getSidecarId Result
The following output properties are available:
- Id string
- The ID of the sidecar.
- SidecarName string
- The name of the sidecar.
- Id string
- The ID of the sidecar.
- SidecarName string
- The name of the sidecar.
- id String
- The ID of the sidecar.
- sidecarName String
- The name of the sidecar.
- id string
- The ID of the sidecar.
- sidecarName string
- The name of the sidecar.
- id str
- The ID of the sidecar.
- sidecar_name str
- The name of the sidecar.
- id String
- The ID of the sidecar.
- sidecarName String
- The name of the sidecar.
Package Details
- Repository
- cyral cyralinc/terraform-provider-cyral
- License
- Notes
- This Pulumi package is based on the cyralTerraform Provider.