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

New data source: azurerm_storage_account_blob_container_sas #4195

Merged

Conversation

r0bnet
Copy link
Contributor

@r0bnet r0bnet commented Aug 30, 2019

Implements what's requested here: #3068

Fixes #3068

# Conflicts:
#	azurerm/provider.go
#	go.mod
# Conflicts:
#	go.mod
#	vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-01-10/siterecovery/client.go
#	vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-01-10/siterecovery/version.go
# Conflicts:
#	go.sum
#	vendor/github.com/Azure/go-autorest/autorest/adal/token.go
#	vendor/github.com/Azure/go-autorest/autorest/go.mod
#	vendor/github.com/Azure/go-autorest/autorest/go.sum
#	vendor/github.com/Azure/go-autorest/autorest/sender.go
#	vendor/github.com/Azure/go-autorest/autorest/version.go
#	vendor/github.com/hashicorp/go-azure-helpers/authentication/auth_method.go
#	vendor/github.com/hashicorp/go-azure-helpers/authentication/auth_method_azure_cli_token.go
#	vendor/github.com/hashicorp/go-azure-helpers/authentication/auth_method_client_cert.go
#	vendor/github.com/hashicorp/go-azure-helpers/authentication/auth_method_client_secret.go
#	vendor/github.com/hashicorp/go-azure-helpers/authentication/auth_method_client_secret_multi_tenant.go
#	vendor/github.com/hashicorp/go-azure-helpers/authentication/auth_method_msi.go
#	vendor/github.com/hashicorp/go-azure-helpers/authentication/config.go
#	vendor/modules.txt
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @r0bnet

Thanks for this PR - taking a look through besides removing the ForceNew's (since this is a Data Source, they're not needed) and adding some validation this otherwise LGTM 👍

Thanks!

"container_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove ForceNew/add:

Suggested change
ForceNew: true,
ValidateFunc: validate.NoEmptyStrings,

Type: schema.TypeString,
Required: true,
ForceNew: true,
Sensitive: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add:

Suggested change
Sensitive: true,
Sensitive: true,
ValidateFunc: validate.NoEmptyStrings,

"connection_string": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a Data Source we don't need the ForceNew here (since this'll be recomputed every time)

Suggested change
ForceNew: true,

Type: schema.TypeBool,
Optional: true,
Default: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a Data Source we don't need the ForceNew here (since this'll be recomputed every time)

Suggested change
ForceNew: true,

"ip": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a Data Source we don't need the ForceNew here (since this'll be recomputed every time)

Suggested change
ForceNew: true,

"read": {
Type: schema.TypeBool,
Required: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a Data Source we don't need the ForceNew here (since this'll be recomputed every time)

Suggested change
ForceNew: true,

"content_disposition": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a Data Source we don't need the ForceNew here (since this'll be recomputed every time)

Suggested change
ForceNew: true,

"content_encoding": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a Data Source we don't need the ForceNew here (since this'll be recomputed every time)

Suggested change
ForceNew: true,

"content_language": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a Data Source we don't need the ForceNew here (since this'll be recomputed every time)

Suggested change
ForceNew: true,

azurerm/data_source_storage_account_blob_container_sas.go Outdated Show resolved Hide resolved
@tombuildsstuff tombuildsstuff added this to the v1.34.0 milestone Sep 3, 2019
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @r0bnet

Thanks for pushing those changes - besides the one rename this otherwise LGTM 👍

Default: true,
},

"ip": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 on reflection could we make this ip_address to match the other resources?

@tombuildsstuff
Copy link
Contributor

Tests pass:

Screenshot 2019-09-04 at 10 20 33

@tombuildsstuff tombuildsstuff merged commit c0e99ec into hashicorp:master Sep 4, 2019
tombuildsstuff added a commit that referenced this pull request Sep 4, 2019
@ibayer
Copy link

ibayer commented Sep 5, 2019

Thanks for this great MR, fine grand SAS is really important for me.

@tombuildsstuff
I couldn't find any fixed release cycle for this provider. When can we expect this MR to be included?
Even an tentative estimate would help me to decide if I need to use a workaround or if I can wait for the next release.

@r0bnet r0bnet deleted the data-storage-account-blob-container-sas branch September 5, 2019 08:31
@r0bnet
Copy link
Contributor Author

r0bnet commented Sep 5, 2019

Hey @ibayer
happy to hear that this helps you. I heard rumors that they're aiming for releasing 1.34.0 somewhere next week. But no guarantee on this.

Here you can see the status / progress for next releases: https://github.com/terraform-providers/terraform-provider-azurerm/milestones

@ghost
Copy link

ghost commented Sep 18, 2019

This has been released in version 1.34.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.34.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Oct 4, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add support for Azure Container SAS tokens
3 participants