Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_redis_cache > Basic fails #18877

Closed
1 task done
dhabierre opened this issue Oct 19, 2022 · 6 comments
Closed
1 task done

azurerm_redis_cache > Basic fails #18877

dhabierre opened this issue Oct 19, 2022 · 6 comments

Comments

@dhabierre
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

0.14.5

AzureRM Provider Version

2.57.0

Affected Resource(s)/Data Source(s)

azurerm_redis_cache

Terraform Configuration Files

resource "azurerm_redis_cache" "redis_cache" {
  name                          = "..."
  location                      = "..."
  resource_group_name           = "..."
  capacity                      = 0
  family                        = "C"
  sku_name                      = "Basic"
  public_network_access_enabled = false
  private_static_ip_address     = "10.25..."
  enable_non_ssl_port           = false
  minimum_tls_version           = "1.2"
}

Debug Output/Panic Output

15:00:42  azurerm_redis_cache.redis_cache[0]: Creating...
15:00:43  
15:00:43  Error: creating Redis Cache "[...]" (Resource Group "[...]-rec01"): redis.Client#Create: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidRequestBody" Message="The value of the parameter 'properties.subnetId' is invalid.\r\nRequestID=[...]"

Expected Behaviour

The resource should be created.

Actual Behaviour

The value of the parameter 'properties.subnetId' is invalid.

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@dhabierre dhabierre added the bug label Oct 19, 2022
@github-actions github-actions bot removed the bug label Oct 19, 2022
@dhabierre
Copy link
Author

@tombuildsstuff, I don't understand your answer at 11430. Is there any solution? Thanks!

@xuzhang3
Copy link
Contributor

@dhabierre to disable the public_network_access_enabled or set private_static_ip_address you need specific a azurerm_virtual_network and subnet for the redis cache

resource "azurerm_resource_group" "example" {
	name     = "test"
	location = "eastus"
  }
  
  resource "azurerm_virtual_network" "example" {
	name                = "test"
	address_space       = ["10.0.0.0/16"]
	location            = azurerm_resource_group.example.location
	resource_group_name = azurerm_resource_group.example.name
  }
  
  resource "azurerm_subnet" "example" {
	name                 = "test"
	resource_group_name  = azurerm_resource_group.example.name
	virtual_network_name = azurerm_virtual_network.example.name
	address_prefixes     = ["10.0.2.0/24"]
  }
  
  
  resource "azurerm_redis_cache" "redis_cache" {
	name                          = "test"
	location                      = azurerm_resource_group.example.location
	resource_group_name           = azurerm_resource_group.example.name
	capacity                      = 1
	family                        = "P"
	sku_name                      = "Premium"
	public_network_access_enabled = false
	private_static_ip_address     = "10.0.2.19"
	enable_non_ssl_port           = false
	minimum_tls_version           = "1.2"
  
	subnet_id = azurerm_subnet.example.id
  }
  

@dhabierre
Copy link
Author

Hi @xuzhang3 and thanks for your reply.

Ok, subnet_id value is required when using private_static_ip_address, right!

azurerm_redis_cache documentation says:

subnet_id - (Optional) Only available when using the Premium SKU The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources.

Strange thing by the way: This Subnet must only contain Azure Cache for Redis instances without any other type of resources.

In my subnet there are VMs.
So according to this, I could'nt use Basic sku with static private IP?
Right?

Thanks.

@xuzhang3
Copy link
Contributor

@dhabierre yes, according to this doc you need upgrade the SKU to Premium if you need private_static_ip_address andsubnet_id. Also subnet can only contains Redis caches. I tried with create a VM with the same subnet, the resource can be created but I think there's some issues with the network/connection not tried that.

@dhabierre
Copy link
Author

Hi @xuzhang3,

Thanks for these details 👍

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants