forked from oracle-devrel/oracle-autonomous-database-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-network.sh
More file actions
executable file
·65 lines (57 loc) · 1.81 KB
/
create-network.sh
File metadata and controls
executable file
·65 lines (57 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Copyright (c) 2025 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
echo ""
echo "##"
echo "# deploy network"
echo "##"
echo ""
# ensure you update the config file to match your deployment prior to running the deployment
source ./config
# This client network will enable rdp access for VMs
az network nsg create \
--resource-group $RESOURCE_GROUP \
--name $NSG_NAME
# Enable RDP access
az network nsg rule create \
--resource-group $RESOURCE_GROUP \
--nsg-name $NSG_NAME \
--name AllowRDP \
--priority 1000 \
--protocol Tcp \
--direction Inbound \
--source-address-prefix '*' \
--source-port-range '*' \
--destination-address-prefix '*' \
--destination-port-range 3389 \
--access Allow
# Allow external access to the internet for resources on the network
az network nsg rule create \
--resource-group $RESOURCE_GROUP \
--nsg-name $NSG_NAME \
--name allow-internet \
--protocol "*" \
--direction outbound \
--priority 100 \
--destination-port-range "*" \
--access allow
# Create virtual network with subnet for database
az network vnet create \
--resource-group $RESOURCE_GROUP \
--name $VNET_NAME \
--address-prefixes $VNET_PREFIX \
--subnet-name $SUBNET_NAME \
--subnet-prefixes $SUBNET_PREFIX
# Make this a delegated subnet
az network vnet subnet update \
--resource-group $RESOURCE_GROUP \
--vnet-name $VNET_NAME \
--name $SUBNET_NAME \
--delegations "Oracle.Database/networkAttachments"
# Add a second subnet for client
az network vnet subnet create \
--resource-group $RESOURCE_GROUP \
--vnet-name $VNET_NAME \
--name $SUBNET2_NAME \
--address-prefixes $SUBNET2_PREFIX \
--network-security-group $NSG_NAME