Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi
oci.Core.getVnic
Explore with Pulumi AI
This data source provides details about a specific Vnic resource in Oracle Cloud Infrastructure Core service.
Gets the information for the specified virtual network interface card (VNIC). You can get the VNIC OCID from the ListVnicAttachments operation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testVnic = oci.Core.getVnic({
vnicId: testVnicOciCoreVnic.id,
});
import pulumi
import pulumi_oci as oci
test_vnic = oci.Core.get_vnic(vnic_id=test_vnic_oci_core_vnic["id"])
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Core.GetVnic(ctx, &core.GetVnicArgs{
VnicId: testVnicOciCoreVnic.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testVnic = Oci.Core.GetVnic.Invoke(new()
{
VnicId = testVnicOciCoreVnic.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetVnicArgs;
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 testVnic = CoreFunctions.getVnic(GetVnicArgs.builder()
.vnicId(testVnicOciCoreVnic.id())
.build());
}
}
variables:
testVnic:
fn::invoke:
Function: oci:Core:getVnic
Arguments:
vnicId: ${testVnicOciCoreVnic.id}
Using getVnic
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 getVnic(args: GetVnicArgs, opts?: InvokeOptions): Promise<GetVnicResult>
function getVnicOutput(args: GetVnicOutputArgs, opts?: InvokeOptions): Output<GetVnicResult>
def get_vnic(vnic_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVnicResult
def get_vnic_output(vnic_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVnicResult]
func GetVnic(ctx *Context, args *GetVnicArgs, opts ...InvokeOption) (*GetVnicResult, error)
func GetVnicOutput(ctx *Context, args *GetVnicOutputArgs, opts ...InvokeOption) GetVnicResultOutput
> Note: This function is named GetVnic
in the Go SDK.
public static class GetVnic
{
public static Task<GetVnicResult> InvokeAsync(GetVnicArgs args, InvokeOptions? opts = null)
public static Output<GetVnicResult> Invoke(GetVnicInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVnicResult> getVnic(GetVnicArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:Core/getVnic:getVnic
arguments:
# arguments dictionary
The following arguments are supported:
getVnic Result
The following output properties are available:
- Availability
Domain string - The VNIC's availability domain. Example:
Uocm:PHX-AD-1
- Compartment
Id string - The OCID of the compartment containing the VNIC.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dictionary<string, string>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Hostname
Label string - The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example,
bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123. - Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6addresses List<string>
- List of IPv6 addresses assigned to the VNIC. Example:
2001:DB8::
- Is
Primary bool - Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch).
- Mac
Address string - The MAC address of the VNIC.
- Nsg
Ids List<string> - A list of the OCIDs of the network security groups that the VNIC belongs to.
- Private
Ip stringAddress - The private IP address of the primary
privateIp
object on the VNIC. The address is within the CIDR of the VNIC's subnet. Example:10.0.3.3
- Public
Ip stringAddress - The public IP address of the VNIC, if one is assigned.
- Skip
Source boolDest Check - Whether the source/destination check is disabled on the VNIC. Defaults to
false
, which means the check is performed. For information about why you would skip the source/destination check, see Using a Private IP as a Route Target. - State string
- The current state of the VNIC.
- Subnet
Id string - The OCID of the subnet the VNIC is in.
- Time
Created string - The date and time the VNIC was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vlan
Id string - If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the
vlanId
is the OCID of the VLAN the VNIC is in. See Vlan. If the VNIC is instead in a subnet,subnetId
has a value. - Vnic
Id string
- Availability
Domain string - The VNIC's availability domain. Example:
Uocm:PHX-AD-1
- Compartment
Id string - The OCID of the compartment containing the VNIC.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- map[string]string
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Hostname
Label string - The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example,
bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123. - Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6addresses []string
- List of IPv6 addresses assigned to the VNIC. Example:
2001:DB8::
- Is
Primary bool - Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch).
- Mac
Address string - The MAC address of the VNIC.
- Nsg
Ids []string - A list of the OCIDs of the network security groups that the VNIC belongs to.
- Private
Ip stringAddress - The private IP address of the primary
privateIp
object on the VNIC. The address is within the CIDR of the VNIC's subnet. Example:10.0.3.3
- Public
Ip stringAddress - The public IP address of the VNIC, if one is assigned.
- Skip
Source boolDest Check - Whether the source/destination check is disabled on the VNIC. Defaults to
false
, which means the check is performed. For information about why you would skip the source/destination check, see Using a Private IP as a Route Target. - State string
- The current state of the VNIC.
- Subnet
Id string - The OCID of the subnet the VNIC is in.
- Time
Created string - The date and time the VNIC was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vlan
Id string - If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the
vlanId
is the OCID of the VLAN the VNIC is in. See Vlan. If the VNIC is instead in a subnet,subnetId
has a value. - Vnic
Id string
- availability
Domain String - The VNIC's availability domain. Example:
Uocm:PHX-AD-1
- compartment
Id String - The OCID of the compartment containing the VNIC.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String,String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- hostname
Label String - The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example,
bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123. - id String
- The provider-assigned unique ID for this managed resource.
- ipv6addresses List<String>
- List of IPv6 addresses assigned to the VNIC. Example:
2001:DB8::
- is
Primary Boolean - Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch).
- mac
Address String - The MAC address of the VNIC.
- nsg
Ids List<String> - A list of the OCIDs of the network security groups that the VNIC belongs to.
- private
Ip StringAddress - The private IP address of the primary
privateIp
object on the VNIC. The address is within the CIDR of the VNIC's subnet. Example:10.0.3.3
- public
Ip StringAddress - The public IP address of the VNIC, if one is assigned.
- skip
Source BooleanDest Check - Whether the source/destination check is disabled on the VNIC. Defaults to
false
, which means the check is performed. For information about why you would skip the source/destination check, see Using a Private IP as a Route Target. - state String
- The current state of the VNIC.
- subnet
Id String - The OCID of the subnet the VNIC is in.
- time
Created String - The date and time the VNIC was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vlan
Id String - If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the
vlanId
is the OCID of the VLAN the VNIC is in. See Vlan. If the VNIC is instead in a subnet,subnetId
has a value. - vnic
Id String
- availability
Domain string - The VNIC's availability domain. Example:
Uocm:PHX-AD-1
- compartment
Id string - The OCID of the compartment containing the VNIC.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- {[key: string]: string}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- hostname
Label string - The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example,
bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123. - id string
- The provider-assigned unique ID for this managed resource.
- ipv6addresses string[]
- List of IPv6 addresses assigned to the VNIC. Example:
2001:DB8::
- is
Primary boolean - Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch).
- mac
Address string - The MAC address of the VNIC.
- nsg
Ids string[] - A list of the OCIDs of the network security groups that the VNIC belongs to.
- private
Ip stringAddress - The private IP address of the primary
privateIp
object on the VNIC. The address is within the CIDR of the VNIC's subnet. Example:10.0.3.3
- public
Ip stringAddress - The public IP address of the VNIC, if one is assigned.
- skip
Source booleanDest Check - Whether the source/destination check is disabled on the VNIC. Defaults to
false
, which means the check is performed. For information about why you would skip the source/destination check, see Using a Private IP as a Route Target. - state string
- The current state of the VNIC.
- subnet
Id string - The OCID of the subnet the VNIC is in.
- time
Created string - The date and time the VNIC was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vlan
Id string - If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the
vlanId
is the OCID of the VLAN the VNIC is in. See Vlan. If the VNIC is instead in a subnet,subnetId
has a value. - vnic
Id string
- availability_
domain str - The VNIC's availability domain. Example:
Uocm:PHX-AD-1
- compartment_
id str - The OCID of the compartment containing the VNIC.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display_
name str - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Mapping[str, str]
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- hostname_
label str - The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example,
bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123. - id str
- The provider-assigned unique ID for this managed resource.
- ipv6addresses Sequence[str]
- List of IPv6 addresses assigned to the VNIC. Example:
2001:DB8::
- is_
primary bool - Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch).
- mac_
address str - The MAC address of the VNIC.
- nsg_
ids Sequence[str] - A list of the OCIDs of the network security groups that the VNIC belongs to.
- private_
ip_ straddress - The private IP address of the primary
privateIp
object on the VNIC. The address is within the CIDR of the VNIC's subnet. Example:10.0.3.3
- public_
ip_ straddress - The public IP address of the VNIC, if one is assigned.
- skip_
source_ booldest_ check - Whether the source/destination check is disabled on the VNIC. Defaults to
false
, which means the check is performed. For information about why you would skip the source/destination check, see Using a Private IP as a Route Target. - state str
- The current state of the VNIC.
- subnet_
id str - The OCID of the subnet the VNIC is in.
- time_
created str - The date and time the VNIC was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vlan_
id str - If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the
vlanId
is the OCID of the VLAN the VNIC is in. See Vlan. If the VNIC is instead in a subnet,subnetId
has a value. - vnic_
id str
- availability
Domain String - The VNIC's availability domain. Example:
Uocm:PHX-AD-1
- compartment
Id String - The OCID of the compartment containing the VNIC.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- hostname
Label String - The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example,
bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123. - id String
- The provider-assigned unique ID for this managed resource.
- ipv6addresses List<String>
- List of IPv6 addresses assigned to the VNIC. Example:
2001:DB8::
- is
Primary Boolean - Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch).
- mac
Address String - The MAC address of the VNIC.
- nsg
Ids List<String> - A list of the OCIDs of the network security groups that the VNIC belongs to.
- private
Ip StringAddress - The private IP address of the primary
privateIp
object on the VNIC. The address is within the CIDR of the VNIC's subnet. Example:10.0.3.3
- public
Ip StringAddress - The public IP address of the VNIC, if one is assigned.
- skip
Source BooleanDest Check - Whether the source/destination check is disabled on the VNIC. Defaults to
false
, which means the check is performed. For information about why you would skip the source/destination check, see Using a Private IP as a Route Target. - state String
- The current state of the VNIC.
- subnet
Id String - The OCID of the subnet the VNIC is in.
- time
Created String - The date and time the VNIC was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vlan
Id String - If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the
vlanId
is the OCID of the VLAN the VNIC is in. See Vlan. If the VNIC is instead in a subnet,subnetId
has a value. - vnic
Id String
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.