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 Resource: azurerm_marketplace_agreement #4305

Merged
merged 6 commits into from
Sep 13, 2019

Conversation

tombuildsstuff
Copy link
Contributor

@tombuildsstuff tombuildsstuff commented Sep 12, 2019

This PR introduces a new resource which allows accepting the license agreement for the specified Marketplace Image.

It also contains some refactoring of the Base Client/Compute Client to be allow us to refactor resources away as needed; and updates the Resource ID Parser to support parsing ID's without a Resource Group

Fixes #1283

// SupportedResources returns the supported Resources supported by this Service
func (r Registration) SupportedResources() map[string]*schema.Resource {
return map[string]*schema.Resource{}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

whilst I'm aware this file does nothing as-is - I'm intentionally leaving this in to leave the package available

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

LGTM 👍

This avoids a circular reference where the resources in the Compute package
required access to the common client, which required the client in the Compute package
```
$ ARM_PROVIDER_STRICT=true acctests azurerm TestAccAzureRMMarketplaceAgreement
2019/09/12 12:27:16 [DEBUG] Registering Data Sources for "Compute"..
2019/09/12 12:27:16 [DEBUG] Registering Resources for "Compute"..
=== RUN   TestAccAzureRMMarketplaceAgreement
=== RUN   TestAccAzureRMMarketplaceAgreement/basic
=== RUN   TestAccAzureRMMarketplaceAgreement/basic/basic
=== RUN   TestAccAzureRMMarketplaceAgreement/basic/requiresImport
--- PASS: TestAccAzureRMMarketplaceAgreement (145.03s)
    --- PASS: TestAccAzureRMMarketplaceAgreement/basic (145.03s)
        --- PASS: TestAccAzureRMMarketplaceAgreement/basic/basic (67.86s)
        --- PASS: TestAccAzureRMMarketplaceAgreement/basic/requiresImport (77.17s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	145.092s
```
@tombuildsstuff
Copy link
Contributor Author

Tests pass:

Screenshot 2019-09-13 at 07 16 26

@tombuildsstuff tombuildsstuff merged commit 6502dcf into master Sep 13, 2019
@tombuildsstuff tombuildsstuff deleted the f/marketplace-agreement branch September 13, 2019 05:21
tombuildsstuff added a commit that referenced this pull request Sep 13, 2019
@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 ...

@milan21984
Copy link

I was having similar issue with accepting license agreement while deploying Cisco CSR 1000v with BYOL option. I tried using azurerm_marketplace_agreement but I kept getting following error:

Error: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ResourcePurchaseValidationFailed" Message="User failed validation to purchase resources. Error
message: 'Legal terms have not been accepted for this item on this subscription: 'xxxx-xxxx-xxxx-xxx'. To accept legal terms using PowerShell, please use Get-AzureRmMarketplaceTerms and Set-Azure
RmMarketplaceTerms API(https://go.microsoft.com/fwlink/?linkid=862451), to accept the terms using Azure CLI, please use az vm image accpet-terms (https://go.microsoft.com/fwlink/?linkid=2110637) or deploy via the Azure portal to accept the terms'"

I was finally able to get around this by going to AWS portal and accepting the license across my entire subscription for programmatic deployment. Once I accepted terms there, terraform executed everything without any issues. Click on get started link displayed on the market place resource page. Want to deploy programmatically? Get started

@ghost
Copy link

ghost commented Feb 29, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Feb 29, 2020
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.

When provisioning VMs which require legal terms to be accepted, provide an option to accept that.
3 participants