Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse
exoscale.getAntiAffinityGroup
Explore with Pulumi AI
Fetch Exoscale Anti-Affinity Groups data.
Corresponding resource: exoscale_anti_affinity_group.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as exoscale from "@pulumi/exoscale";
const myAntiAffinityGroup = exoscale.getAntiAffinityGroup({
name: "my-anti-affinity-group",
});
export const myAntiAffinityGroupId = myAntiAffinityGroup.then(myAntiAffinityGroup => myAntiAffinityGroup.id);
import pulumi
import pulumi_exoscale as exoscale
my_anti_affinity_group = exoscale.get_anti_affinity_group(name="my-anti-affinity-group")
pulumi.export("myAntiAffinityGroupId", my_anti_affinity_group.id)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-exoscale/sdk/go/exoscale"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myAntiAffinityGroup, err := exoscale.LookupAntiAffinityGroup(ctx, &exoscale.LookupAntiAffinityGroupArgs{
Name: pulumi.StringRef("my-anti-affinity-group"),
}, nil)
if err != nil {
return err
}
ctx.Export("myAntiAffinityGroupId", myAntiAffinityGroup.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Exoscale = Pulumi.Exoscale;
return await Deployment.RunAsync(() =>
{
var myAntiAffinityGroup = Exoscale.GetAntiAffinityGroup.Invoke(new()
{
Name = "my-anti-affinity-group",
});
return new Dictionary<string, object?>
{
["myAntiAffinityGroupId"] = myAntiAffinityGroup.Apply(getAntiAffinityGroupResult => getAntiAffinityGroupResult.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.exoscale.ExoscaleFunctions;
import com.pulumi.exoscale.inputs.GetAntiAffinityGroupArgs;
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 myAntiAffinityGroup = ExoscaleFunctions.getAntiAffinityGroup(GetAntiAffinityGroupArgs.builder()
.name("my-anti-affinity-group")
.build());
ctx.export("myAntiAffinityGroupId", myAntiAffinityGroup.applyValue(getAntiAffinityGroupResult -> getAntiAffinityGroupResult.id()));
}
}
variables:
myAntiAffinityGroup:
fn::invoke:
Function: exoscale:getAntiAffinityGroup
Arguments:
name: my-anti-affinity-group
outputs:
myAntiAffinityGroupId: ${myAntiAffinityGroup.id}
Please refer to the examples directory for complete configuration examples.
Using getAntiAffinityGroup
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 getAntiAffinityGroup(args: GetAntiAffinityGroupArgs, opts?: InvokeOptions): Promise<GetAntiAffinityGroupResult>
function getAntiAffinityGroupOutput(args: GetAntiAffinityGroupOutputArgs, opts?: InvokeOptions): Output<GetAntiAffinityGroupResult>
def get_anti_affinity_group(id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAntiAffinityGroupResult
def get_anti_affinity_group_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAntiAffinityGroupResult]
func LookupAntiAffinityGroup(ctx *Context, args *LookupAntiAffinityGroupArgs, opts ...InvokeOption) (*LookupAntiAffinityGroupResult, error)
func LookupAntiAffinityGroupOutput(ctx *Context, args *LookupAntiAffinityGroupOutputArgs, opts ...InvokeOption) LookupAntiAffinityGroupResultOutput
> Note: This function is named LookupAntiAffinityGroup
in the Go SDK.
public static class GetAntiAffinityGroup
{
public static Task<GetAntiAffinityGroupResult> InvokeAsync(GetAntiAffinityGroupArgs args, InvokeOptions? opts = null)
public static Output<GetAntiAffinityGroupResult> Invoke(GetAntiAffinityGroupInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAntiAffinityGroupResult> getAntiAffinityGroup(GetAntiAffinityGroupArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: exoscale:index/getAntiAffinityGroup:getAntiAffinityGroup
arguments:
# arguments dictionary
The following arguments are supported:
getAntiAffinityGroup Result
The following output properties are available:
Package Details
- Repository
- exoscale pulumiverse/pulumi-exoscale
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
exoscale
Terraform Provider.