Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.ots.getInstanceAttachments
Explore with Pulumi AI
This data source provides the ots instance attachments of the current Alibaba Cloud user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const attachmentsDs = alicloud.ots.getInstanceAttachments({
instanceName: "sample-instance",
nameRegex: "testvpc",
outputFile: "attachments.txt",
});
export const firstOtsAttachmentId = attachmentsDs.then(attachmentsDs => attachmentsDs.attachments?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
attachments_ds = alicloud.ots.get_instance_attachments(instance_name="sample-instance",
name_regex="testvpc",
output_file="attachments.txt")
pulumi.export("firstOtsAttachmentId", attachments_ds.attachments[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
attachmentsDs, err := ots.GetInstanceAttachments(ctx, &ots.GetInstanceAttachmentsArgs{
InstanceName: "sample-instance",
NameRegex: pulumi.StringRef("testvpc"),
OutputFile: pulumi.StringRef("attachments.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstOtsAttachmentId", attachmentsDs.Attachments[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var attachmentsDs = AliCloud.Ots.GetInstanceAttachments.Invoke(new()
{
InstanceName = "sample-instance",
NameRegex = "testvpc",
OutputFile = "attachments.txt",
});
return new Dictionary<string, object?>
{
["firstOtsAttachmentId"] = attachmentsDs.Apply(getInstanceAttachmentsResult => getInstanceAttachmentsResult.Attachments[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ots.OtsFunctions;
import com.pulumi.alicloud.ots.inputs.GetInstanceAttachmentsArgs;
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 attachmentsDs = OtsFunctions.getInstanceAttachments(GetInstanceAttachmentsArgs.builder()
.instanceName("sample-instance")
.nameRegex("testvpc")
.outputFile("attachments.txt")
.build());
ctx.export("firstOtsAttachmentId", attachmentsDs.applyValue(getInstanceAttachmentsResult -> getInstanceAttachmentsResult.attachments()[0].id()));
}
}
variables:
attachmentsDs:
fn::invoke:
Function: alicloud:ots:getInstanceAttachments
Arguments:
instanceName: sample-instance
nameRegex: testvpc
outputFile: attachments.txt
outputs:
firstOtsAttachmentId: ${attachmentsDs.attachments[0].id}
Using getInstanceAttachments
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 getInstanceAttachments(args: GetInstanceAttachmentsArgs, opts?: InvokeOptions): Promise<GetInstanceAttachmentsResult>
function getInstanceAttachmentsOutput(args: GetInstanceAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetInstanceAttachmentsResult>
def get_instance_attachments(instance_name: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetInstanceAttachmentsResult
def get_instance_attachments_output(instance_name: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInstanceAttachmentsResult]
func GetInstanceAttachments(ctx *Context, args *GetInstanceAttachmentsArgs, opts ...InvokeOption) (*GetInstanceAttachmentsResult, error)
func GetInstanceAttachmentsOutput(ctx *Context, args *GetInstanceAttachmentsOutputArgs, opts ...InvokeOption) GetInstanceAttachmentsResultOutput
> Note: This function is named GetInstanceAttachments
in the Go SDK.
public static class GetInstanceAttachments
{
public static Task<GetInstanceAttachmentsResult> InvokeAsync(GetInstanceAttachmentsArgs args, InvokeOptions? opts = null)
public static Output<GetInstanceAttachmentsResult> Invoke(GetInstanceAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceAttachmentsResult> getInstanceAttachments(GetInstanceAttachmentsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:ots/getInstanceAttachments:getInstanceAttachments
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Name string - The name of OTS instance.
- Name
Regex string - A regex string to filter results by vpc name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Instance
Name string - The name of OTS instance.
- Name
Regex string - A regex string to filter results by vpc name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- instance
Name String - The name of OTS instance.
- name
Regex String - A regex string to filter results by vpc name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- instance
Name string - The name of OTS instance.
- name
Regex string - A regex string to filter results by vpc name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- instance_
name str - The name of OTS instance.
- name_
regex str - A regex string to filter results by vpc name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- instance
Name String - The name of OTS instance.
- name
Regex String - A regex string to filter results by vpc name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getInstanceAttachments Result
The following output properties are available:
- Attachments
List<Pulumi.
Ali Cloud. Ots. Outputs. Get Instance Attachments Attachment> - A list of instance attachments. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Name string - The instance name.
- Names List<string>
- A list of vpc names.
- Vpc
Ids List<string> - A list of vpc ids.
- Name
Regex string - Output
File string
- Attachments
[]Get
Instance Attachments Attachment - A list of instance attachments. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Name string - The instance name.
- Names []string
- A list of vpc names.
- Vpc
Ids []string - A list of vpc ids.
- Name
Regex string - Output
File string
- attachments
List<Get
Instance Attachments Attachment> - A list of instance attachments. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Name String - The instance name.
- names List<String>
- A list of vpc names.
- vpc
Ids List<String> - A list of vpc ids.
- name
Regex String - output
File String
- attachments
Get
Instance Attachments Attachment[] - A list of instance attachments. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- instance
Name string - The instance name.
- names string[]
- A list of vpc names.
- vpc
Ids string[] - A list of vpc ids.
- name
Regex string - output
File string
- attachments
Sequence[Get
Instance Attachments Attachment] - A list of instance attachments. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- instance_
name str - The instance name.
- names Sequence[str]
- A list of vpc names.
- vpc_
ids Sequence[str] - A list of vpc ids.
- name_
regex str - output_
file str
- attachments List<Property Map>
- A list of instance attachments. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Name String - The instance name.
- names List<String>
- A list of vpc names.
- vpc
Ids List<String> - A list of vpc ids.
- name
Regex String - output
File String
Supporting Types
GetInstanceAttachmentsAttachment
- Domain string
- The domain of the instance attachment.
- Endpoint string
- The access endpoint of the instance attachment.
- Id string
- The resource ID, the value is same as "instance_name".
- Instance
Name string - The name of OTS instance.
- Region string
- The region of the instance attachment.
- Vpc
Id string - The ID of attaching VPC to instance.
- Vpc
Name string - The name of attaching VPC to instance.
- Domain string
- The domain of the instance attachment.
- Endpoint string
- The access endpoint of the instance attachment.
- Id string
- The resource ID, the value is same as "instance_name".
- Instance
Name string - The name of OTS instance.
- Region string
- The region of the instance attachment.
- Vpc
Id string - The ID of attaching VPC to instance.
- Vpc
Name string - The name of attaching VPC to instance.
- domain String
- The domain of the instance attachment.
- endpoint String
- The access endpoint of the instance attachment.
- id String
- The resource ID, the value is same as "instance_name".
- instance
Name String - The name of OTS instance.
- region String
- The region of the instance attachment.
- vpc
Id String - The ID of attaching VPC to instance.
- vpc
Name String - The name of attaching VPC to instance.
- domain string
- The domain of the instance attachment.
- endpoint string
- The access endpoint of the instance attachment.
- id string
- The resource ID, the value is same as "instance_name".
- instance
Name string - The name of OTS instance.
- region string
- The region of the instance attachment.
- vpc
Id string - The ID of attaching VPC to instance.
- vpc
Name string - The name of attaching VPC to instance.
- domain str
- The domain of the instance attachment.
- endpoint str
- The access endpoint of the instance attachment.
- id str
- The resource ID, the value is same as "instance_name".
- instance_
name str - The name of OTS instance.
- region str
- The region of the instance attachment.
- vpc_
id str - The ID of attaching VPC to instance.
- vpc_
name str - The name of attaching VPC to instance.
- domain String
- The domain of the instance attachment.
- endpoint String
- The access endpoint of the instance attachment.
- id String
- The resource ID, the value is same as "instance_name".
- instance
Name String - The name of OTS instance.
- region String
- The region of the instance attachment.
- vpc
Id String - The ID of attaching VPC to instance.
- vpc
Name String - The name of attaching VPC to instance.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.