oci_core_service_gateway
This resource provides the Service Gateway resource in Oracle Cloud Infrastructure Core service. Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/iaas/latest/ServiceGateway
Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/
Creates a new service gateway in the specified compartment.
For the purposes of access control, you must provide the OCID of the compartment where you want the service gateway to reside. For more information about compartments and access control, see Overview of the IAM Service. For information about OCIDs, see Resource Identifiers.
You may optionally specify a display name for the service gateway, otherwise a default is provided. It does not have to be unique, and you can change it. Avoid entering confidential information.
Use the ListServices operation to find service CIDR labels available in the region.
Example Usage
resource "oci_core_service_gateway" "test_service_gateway" {
#Required
compartment_id = var.compartment_id
services {
#Required
service_id = data.oci_core_services.test_services.services.0.id
}
vcn_id = oci_core_vcn.test_vcn.id
#Optional
defined_tags = {"Operations.CostCenter"= "42"}
display_name = var.service_gateway_display_name
freeform_tags = {"Department"= "Finance"}
route_table_id = oci_core_route_table.test_route_table.id
}
Argument Reference
The following arguments are supported:
compartment_id- (Required) (Updatable) The OCID of the compartment to contain the service gateway.defined_tags- (Optional) (Updatable) 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- (Optional) (Updatable) A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.freeform_tags- (Optional) (Updatable) 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"}route_table_id- (Optional) (Updatable) The OCID of the route table the service gateway will use.If you don’t specify a route table here, the service gateway is created without an associated route table. The Networking service does NOT automatically associate the attached VCN’s default route table with the service gateway.
For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.
services- (Required) (Updatable) List of the OCIDs of the Service objects to enable for the service gateway. This list can be empty if you don’t want to enable anyServiceobjects when you create the gateway. You can enable aServiceobject later by using either AttachServiceId or UpdateServiceGateway.For each enabled
Service, make sure there’s a route rule with theServiceobject’scidrBlockas the rule’s destination and the service gateway as the rule’s target. See Route Table.vcn_id- (Required) The OCID of the VCN.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
Attributes Reference
The following attributes are exported:
block_traffic- Whether the service gateway blocks all traffic through it. The default isfalse. When this istrue, traffic is not routed to any services, regardless of route rules. Example:truecompartment_id- The OCID of the compartment that contains the service gateway.defined_tags- 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- A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.freeform_tags- 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"}id- The OCID of the service gateway.route_table_id- The OCID of the route table the service gateway is using. For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.services- List of the Service objects enabled for this service gateway. The list can be empty. You can enable a particularServiceby using AttachServiceId or UpdateServiceGateway.service_id- The OCID of the service.service_name- The name of the service.
state- The service gateway’s current state.time_created- The date and time the service gateway was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Zvcn_id- The OCID of the VCN the service gateway belongs to.
Timeouts
The timeouts block allows you to specify timeouts for certain operations:
* create - (Defaults to 20 minutes), when creating the Service Gateway
* update - (Defaults to 20 minutes), when updating the Service Gateway
* delete - (Defaults to 20 minutes), when destroying the Service Gateway
Import
ServiceGateways can be imported using the id, e.g.
$ terraform import oci_core_service_gateway.test_service_gateway "id"