Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into xsc
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
EyalDelarea committed Aug 24, 2023
2 parents 66009e0 + 9845a7c commit e4ca999
Show file tree
Hide file tree
Showing 33 changed files with 1,299 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build/npm/v2-jf/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2-jf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2-jf",
"version": "2.45.0",
"version": "2.46.0",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2",
"version": "2.45.0",
"version": "2.46.0",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
12 changes: 5 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ require (
github.com/buger/jsonparser v1.1.1
github.com/go-git/go-git/v5 v5.8.1
github.com/gocarina/gocsv v0.0.0-20230616125104-99d496ca653d
github.com/jfrog/build-info-go v1.9.7
github.com/jfrog/build-info-go v1.9.8
github.com/jfrog/gofrog v1.3.0
github.com/jfrog/jfrog-cli-core/v2 v2.40.1
github.com/jfrog/jfrog-client-go v1.31.4
github.com/jfrog/jfrog-cli-core/v2 v2.41.0
github.com/jfrog/jfrog-client-go v1.31.5
github.com/jszwec/csvutil v1.8.0
github.com/mholt/archiver/v3 v3.5.1
github.com/stretchr/testify v1.8.4
Expand Down Expand Up @@ -122,11 +122,9 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230820165857-52ff32c4d8eb
// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230820165857-52ff32c4d8eb

replace github.com/jfrog/jfrog-cli-core/v2 => github.com/eyaldelarea/jfrog-cli-core/v2 v2.0.0-20230823071708-6e5b7f7fd440

replace github.com/jfrog/jfrog-client-go => github.com/eyaldelarea/jfrog-client-go v1.28.4-0.20230821145050-a30da83d09c4
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230823084658-46b57ad6ca5a

// replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.2.6-0.20230418122323-2bf299dd6d27

Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/eyaldelarea/jfrog-cli-core/v2 v2.0.0-20230823071708-6e5b7f7fd440 h1:H94EYhTnO1Qgrx2fZLWkN4h0aVZi/qHGkyBjSUTWXbU=
github.com/eyaldelarea/jfrog-cli-core/v2 v2.0.0-20230823071708-6e5b7f7fd440/go.mod h1:R1dRbf5thSPtjtg/s59kO20Ux7CGbbyXUXpTJpEEr1Y=
github.com/eyaldelarea/jfrog-client-go v1.28.4-0.20230821145050-a30da83d09c4 h1:wylQBde6B6Bk4hjAww0kXkuBLjXPBfkDzTERFGoExvo=
github.com/eyaldelarea/jfrog-client-go v1.28.4-0.20230821145050-a30da83d09c4/go.mod h1:cstHMVqu11rn4TadtCBHrcuL+KcJ94kjSmMQSWMB61I=
github.com/forPelevin/gomoji v1.1.8 h1:JElzDdt0TyiUlecy6PfITDL6eGvIaxqYH1V52zrd0qQ=
github.com/forPelevin/gomoji v1.1.8/go.mod h1:8+Z3KNGkdslmeGZBC3tCrwMrcPy5GRzAD+gL9NAwMXg=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
Expand Down Expand Up @@ -241,10 +237,14 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jedib0t/go-pretty/v6 v6.4.6 h1:v6aG9h6Uby3IusSSEjHaZNXpHFhzqMmjXcPq1Rjl9Jw=
github.com/jedib0t/go-pretty/v6 v6.4.6/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs=
github.com/jfrog/build-info-go v1.8.9-0.20230820165857-52ff32c4d8eb h1:Y6ZxvUkUukRqI2otvOlDIfWTVttmapizKAAllEETB44=
github.com/jfrog/build-info-go v1.8.9-0.20230820165857-52ff32c4d8eb/go.mod h1:t31QRpH5xUJKw8XkQlAA+Aq7aanyS1rrzpcK8xSNVts=
github.com/jfrog/build-info-go v1.9.8 h1:D8/ga+YgQpqp/CJj2zteS4/twmSy8zvm1v9lCd2Kv1M=
github.com/jfrog/build-info-go v1.9.8/go.mod h1:t31QRpH5xUJKw8XkQlAA+Aq7aanyS1rrzpcK8xSNVts=
github.com/jfrog/gofrog v1.3.0 h1:o4zgsBZE4QyDbz2M7D4K6fXPTBJht+8lE87mS9bw7Gk=
github.com/jfrog/gofrog v1.3.0/go.mod h1:IFMc+V/yf7rA5WZ74CSbXe+Lgf0iApEQLxRZVzKRUR0=
github.com/jfrog/jfrog-cli-core/v2 v2.41.0 h1:M2z/BuZKZc4DHtmO3Jx49bf5qCLyfLG8jJ9/iKpkALs=
github.com/jfrog/jfrog-cli-core/v2 v2.41.0/go.mod h1:YqB9rEJF1P7uGLIPUvF5qdDDf1zM5f4DneIQNkqyAfs=
github.com/jfrog/jfrog-client-go v1.31.5 h1:dYVgIJzMwX+EU9GEELKPSHFLyfW6UrrjZWMEZtAyx6A=
github.com/jfrog/jfrog-client-go v1.31.5/go.mod h1:icb00ZJN/mMMNkQduHDkzpqsXH9Flwi3f3COYexq3Nc=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jszwec/csvutil v1.8.0 h1:G7vS2LGdpZZDH1HmHeNbxOaJ/ZnJlpwGFvOkTkJzzNk=
Expand Down
116 changes: 116 additions & 0 deletions testdata/xray/jas/iac/azure/vpc/module.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@

#Azure Generic vNet Module
resource "azurerm_resource_group" "network" {
count = var.module_enabled ? 1 : 0
name = var.short_region != " " ? var.short_region : "${var.deploy_name}-${var.region}"
location = var.region

tags = {
environment = var.environment
}
}

resource "azurerm_virtual_network" "vnet" {
count = var.module_enabled ? 1 : 0
name = "${var.deploy_name}-${var.region}"
location = var.region
address_space = [var.vpc_cidr]
resource_group_name = azurerm_resource_group.network[0].name

tags = {
environment = var.environment
costcenter = "${var.deploy_name}-${var.region}"
}
}

resource "azurerm_subnet" "subnet" {
count = var.module_enabled ? length(var.subnet_names) : 0
name = var.subnet_names[count.index]
virtual_network_name = azurerm_virtual_network.vnet[0].name
resource_group_name = azurerm_resource_group.network[0].name
address_prefixes = [var.subnet_prefixes[count.index]]
# service_endpoints = [
# "Microsoft.KeyVault"
# ]

dynamic "delegation"{
for_each =var.subnet_names[count.index] == "flexible-dbs" ? ["exec"] : []
content {
name = "dlg-Microsoft.DBforPostgreSQL-flexibleServers"
service_delegation {
name = "Microsoft.DBforPostgreSQL/flexibleServers"
actions = [
"Microsoft.Network/virtualNetworks/subnets/join/action"
]
}
}
}

enforce_private_link_endpoint_network_policies = var.subnet_names[count.index] == "data"
enforce_private_link_service_network_policies = var.subnet_names[count.index] == "private" && var.enforce_pl_svc_net_private
lifecycle {
ignore_changes = [
service_endpoints,
delegation[0].name
]
}
}


resource "azurerm_private_dns_zone" "postgres_private_dns" {
count = var.module_enabled ? 1 : 0
name = "privatelink.postgres.database.azure.com"
resource_group_name = azurerm_resource_group.network[0].name
}

resource "random_string" "postgres_private_dns_net_link_name" {
count = var.module_enabled ? 1 : 0
length = 8
special = false
number = false
upper = false
}

resource "azurerm_private_dns_zone_virtual_network_link" "postgres_private_dns_net_link" {
count = var.module_enabled ? 1 : 0
name = random_string.postgres_private_dns_net_link_name[0].result
resource_group_name = azurerm_resource_group.network[0].name
private_dns_zone_name = azurerm_private_dns_zone.postgres_private_dns[0].name
virtual_network_id = azurerm_virtual_network.vnet[0].id
}

//resource "azurerm_network_security_group" "nsg" {
// count = "${var.module_enabled ? length(var.subnet_names) : 0}"
// name = "${var.subnet_names[count.index]}-sg"
// location = "${var.region}"
// resource_group_name = "${var.deploy_name}-${var.region}"
//}
//
//resource "azurerm_subnet_network_security_group_association" "nsg" {
// count = "${var.module_enabled ? length(var.subnet_names) : 0}"
// subnet_id = "${element(azurerm_subnet.subnet.*.id, count.index)}"
// network_security_group_id = "${element(azurerm_network_security_group.nsg.*.id, count.index)}"
//}
//resource "azurerm_subnet_route_table_association" "nat" {
// count = "${var.module_enabled ? length(var.nat_subnets) : 0}"
// subnet_id = "${element(azurerm_subnet.subnet.*.id, count.index + 1)}"
// route_table_id = "${azurerm_route_table.nattable.id}"
//}
# UDR
//resource "azurerm_route_table" "nattable" {
// count = "${var.module_enabled}"
// name = "${var.deploy_name}-${var.region}"
// location = "${var.region}"
// resource_group_name = "${azurerm_resource_group.network.name}"
//
// route {
// name = "all-traffic-via-nat"
// address_prefix = "0.0.0.0/0"
// next_hop_type = "VirtualAppliance"
// next_hop_in_ip_address = "${var.natgw_private_ip}"
// }
//
// tags = {
// environment = "${var.environment}"
// }
//}
79 changes: 79 additions & 0 deletions testdata/xray/jas/iac/azure/vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
##################################################################################
# OUTPUT
##################################################################################

output "resource_group_id" {
value = azurerm_resource_group.network[0].id
}

output "resource_group_name" {
value = azurerm_resource_group.network[0].name
}

output "vnet_id" {
value = element(concat(azurerm_virtual_network.vnet.*.id, [""]), 0)
}

output "vnet_location" {
value = element(concat(azurerm_virtual_network.vnet.*.location, [""]), 0)
}

output "vnet_name" {
value = element(concat(azurerm_virtual_network.vnet.*.name, [""]), 0)
}

output "private_dns_id" {
value = element(
concat(azurerm_private_dns_zone.postgres_private_dns.*.id, [""]),
0,
)
}

output "private_dns_name" {
value = element(
concat(azurerm_private_dns_zone.postgres_private_dns.*.name, [""]),
0,
)
}

//output "vnet_subnets" {
// value = "${azurerm_subnet.subnet.*.id}"
//}

### subnets ids ###
output "public_subnet" {
value = element(concat(azurerm_subnet.subnet.*.id, [""]), 0)
}

output "private_subnet" {
value = element(concat(azurerm_subnet.subnet.*.id, [""]), 1)
}
output "flexible_subnet" {
value = element(concat(azurerm_subnet.subnet.*.id, [""]), 4)
}
output "data_subnet" {
value = element(concat(azurerm_subnet.subnet.*.id, [""]), 2)
}

output "mgmt_subnet" {
value = element(concat(azurerm_subnet.subnet.*.id, [""]), 3)
}

### subnets names ###
output "public_subnet_name" {
value = element(concat(azurerm_subnet.subnet.*.name, [""]), 0)
}

output "private_subnet_name" {
value = element(concat(azurerm_subnet.subnet.*.name, [""]), 1)
}

output "data_subnet_name" {
value = element(concat(azurerm_subnet.subnet.*.name, [""]), 2)
}

output "mgmt_subnet_name" {
value = element(concat(azurerm_subnet.subnet.*.name, [""]), 3)
}


39 changes: 39 additions & 0 deletions testdata/xray/jas/iac/azure/vpc/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
variable "module_enabled" {
default = true
}

variable "region" {
}

variable "deploy_name" {
}

variable "vpc_cidr" {
}

variable "short_region" {
default = " "
}

variable "subnet_prefixes" {
type = list(string)
}

variable "ssh_source_ranges" {
type = list(string)
}

variable "environment" {
}

variable "subnet_names" {
type = list(string)
}

variable "enforce_pl_svc_net_private" {
default = false
}
//variable "natgw_private_ip" {}
//variable "nat_subnets" {
// type = "list"
//}
4 changes: 4 additions & 0 deletions testdata/xray/jas/iac/azure/vpc/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
34 changes: 34 additions & 0 deletions testdata/xray/jas/iac/azure/vpc_pp/module.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

#Azure Generic vNet Module
resource "azurerm_resource_group" "network" {
count = var.module_enabled ? 1 : 0
name = var.short_region != " " ? var.short_region : "${var.deploy_name}-${var.region}"
location = var.region

tags = {
environment = var.environment
}
}

resource "azurerm_virtual_network" "vnet" {
count = var.module_enabled ? 1 : 0
name = "${var.deploy_name}-${var.region}"
location = var.region
address_space = [var.vpc_cidr]
resource_group_name = azurerm_resource_group.network[0].name

tags = {
environment = var.environment
costcenter = "${var.deploy_name}-${var.region}"
}
}

resource "azurerm_subnet" "subnet" {
count = var.module_enabled ? length(var.subnet_names) : 0
name = var.subnet_names[count.index]
virtual_network_name = azurerm_virtual_network.vnet[0].name
resource_group_name = azurerm_resource_group.network[0].name
address_prefixes = [var.subnet_prefixes[count.index]]
enforce_private_link_endpoint_network_policies = var.subnet_names[count.index] == "private" && var.enforce_private_subnet

}
Loading

0 comments on commit e4ca999

Please sign in to comment.