You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very useful to have a data source that outputted the outgoing IPs for the public runners. This would be useful when whitelisting access to resources based on IP (Yes, I know this is not best practice). The list of IP's can be found here, in chapter Valid IP addresses for Bitbucket Pipelines build environments. This is currently possible to filter out using the bitbucket_ip_ranges data source, but it looks very messy (see example bellow).
Terraform Version
1.7.1
Affected Resource(s)
Please list the resources as a list, for example:
bitbucket_ip_ranges
Terraform Configuration Files
# How I solved it: data"bitbucket_ip_ranges""public_runners" {}
resource"azurerm_mysql_flexible_server_firewall_rule""bitbucket_runners" {
for_each={
foridx, rangeindata.bitbucket_ip_ranges.public_runners.ranges:"${range.network}-${range.mask_len}"=>rangeifcontains(range.directions, "egress") &&length(range.products) ==1&&contains(range.products, "bitbucket") &&!strcontains(range.network, ":") // Exclude IPv6 addresses
}
name="bitbucket-${replace(each.value.network, ".", "-")}"resource_group_name=data.azurerm_resource_group.deployment.nameserver_name=azurerm_mysql_flexible_server.test.namestart_ip_address=each.value.networkend_ip_address=each.value.network
}
#How I would like it to be: data"bitbucket_ip_ranges""public_runners" {}
resource"azurerm_mysql_flexible_server_firewall_rule""bitbucket_runners" {
for_each=data.bitbucket_ip_ranges.public_runners.ranges.runnersname="bitbucket-${each.key}"resource_group_name=data.azurerm_resource_group.deployment.nameserver_name=azurerm_mysql_flexible_server.test.namestart_ip_address=each.valueend_ip_address=each.value
}
The text was updated successfully, but these errors were encountered:
Hi SanderBlom, you are using it as intended, the bitbucket_ip_ranges datasource just lightly parses the public ip lists BB publish. ill try to maybe add something to to try making the parse outout more manageable but this is also how we use it in my company
Hi!
It would be very useful to have a data source that outputted the outgoing IPs for the public runners. This would be useful when whitelisting access to resources based on IP (Yes, I know this is not best practice). The list of IP's can be found here, in chapter
Valid IP addresses for Bitbucket Pipelines build environments
. This is currently possible to filter out using thebitbucket_ip_ranges
data source, but it looks very messy (see example bellow).Terraform Version
1.7.1
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
The text was updated successfully, but these errors were encountered: