From 4a9abb5cf3242afe40974dc89074dc2bd188a509 Mon Sep 17 00:00:00 2001 From: magodo Date: Sun, 16 Aug 2020 13:57:57 +0800 Subject: [PATCH 001/276] azurerm: support importing within resource group Introduce an option: `-R`/`--resource-group` to allow user to restrict the import range within the specified resource group. For those subscription level (or above) resources, if user has specified this option, will not be imported. --- README.md | 1 + cmd/import.go | 31 ++++----- cmd/provider_cmd_azure.go | 3 +- providers/azure/analysis.go | 11 +++- providers/azure/app_service.go | 10 ++- providers/azure/azure_provider.go | 11 ++-- providers/azure/container.go | 26 ++++++-- providers/azure/cosmosdb.go | 10 ++- providers/azure/database.go | 44 +++++++++++-- providers/azure/disk.go | 22 +++++-- providers/azure/dns.go | 16 ++++- providers/azure/keyvault.go | 44 ++++++++++--- providers/azure/load_balancer.go | 14 ++++- providers/azure/network_interface.go | 40 +++++++----- providers/azure/network_security_group.go | 41 +++++++----- providers/azure/private_dns.go | 13 +++- providers/azure/public_ip.go | 25 ++++++-- providers/azure/resource_group.go | 16 +++++ providers/azure/scaleset.go | 44 ++++++++++--- providers/azure/security_center_contact.go | 3 + .../security_center_subscription_pricing.go | 3 + providers/azure/storage_account.go | 39 +++++++++--- providers/azure/storage_blob.go | 2 +- providers/azure/storage_container.go | 41 ++++++++---- providers/azure/virtual_machine.go | 63 ++++++++++--------- providers/azure/virtual_network.go | 42 ++++++++----- 26 files changed, 453 insertions(+), 162 deletions(-) diff --git a/README.md b/README.md index 8eab211f7a..e469a21d6e 100644 --- a/README.md +++ b/README.md @@ -715,6 +715,7 @@ export ARM_CLIENT_SECRET=[CLIENT_SECRET] export ARM_TENANT_ID=[TENANT_ID] ./terraformer import azure -r resource_group +./terraformer import azure -R my_resource_group -r virtual_network,resource_group ``` List of supported Azure resources: diff --git a/cmd/import.go b/cmd/import.go index a1410f0d3e..d27045fc12 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -34,21 +34,22 @@ import ( ) type ImportOptions struct { - Resources []string - PathPattern string - PathOutput string - State string - Bucket string - Profile string - Verbose bool - Zone string - Regions []string - Projects []string - Connect bool - Compact bool - Filter []string - Plan bool `json:"-"` - Output string + Resources []string + PathPattern string + PathOutput string + State string + Bucket string + Profile string + Verbose bool + Zone string + Regions []string + Projects []string + ResourceGroup string + Connect bool + Compact bool + Filter []string + Plan bool `json:"-"` + Output string } const DefaultPathPattern = "{output}/{provider}/{service}/" diff --git a/cmd/provider_cmd_azure.go b/cmd/provider_cmd_azure.go index aab5b39062..dad66fb444 100644 --- a/cmd/provider_cmd_azure.go +++ b/cmd/provider_cmd_azure.go @@ -27,7 +27,7 @@ func newCmdAzureImporter(options ImportOptions) *cobra.Command { Long: "Import current state to Terraform configuration from Azure", RunE: func(cmd *cobra.Command, args []string) error { provider := newAzureProvider() - err := Import(provider, options, []string{}) + err := Import(provider, options, []string{options.ResourceGroup}) if err != nil { return err } @@ -37,6 +37,7 @@ func newCmdAzureImporter(options ImportOptions) *cobra.Command { cmd.AddCommand(listCmd(newAzureProvider())) baseProviderFlags(cmd.PersistentFlags(), &options, "resource_group", "resource_group=name1:name2:name3") + cmd.PersistentFlags().StringVarP(&options.ResourceGroup, "resource-group", "R", "", "") return cmd } diff --git a/providers/azure/analysis.go b/providers/azure/analysis.go index e69606b8ce..f3b1eb951d 100644 --- a/providers/azure/analysis.go +++ b/providers/azure/analysis.go @@ -35,7 +35,16 @@ func (g *AnalysisGenerator) listServiceServers() ([]terraformutils.Resource, err AnalysisClient := analysisservices.NewServersClient(g.Args["config"].(authentication.Config).SubscriptionID) AnalysisClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - servers, err := AnalysisClient.List(ctx) + var ( + servers analysisservices.Servers + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + servers, err = AnalysisClient.ListByResourceGroup(ctx, rg) + } else { + servers, err = AnalysisClient.List(ctx) + } if err != nil { return nil, err } diff --git a/providers/azure/app_service.go b/providers/azure/app_service.go index b3f7c993e0..e63d14ddbc 100644 --- a/providers/azure/app_service.go +++ b/providers/azure/app_service.go @@ -21,7 +21,15 @@ func (g AppServiceGenerator) listApps() ([]terraformutils.Resource, error) { appServiceClient := web.NewAppsClient(g.Args["config"].(authentication.Config).SubscriptionID) appServiceClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - appsIterator, err := appServiceClient.ListComplete(ctx) + var ( + appsIterator web.AppCollectionIterator + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + appsIterator, err = appServiceClient.ListByResourceGroupComplete(ctx, rg, nil) + } else { + appsIterator, err = appServiceClient.ListComplete(ctx) + } if err != nil { return nil, err } diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index 48b7d4fd24..b9222f932f 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -29,8 +29,9 @@ import ( type AzureProvider struct { //nolint terraformutils.Provider - config authentication.Config - authorizer autorest.Authorizer + config authentication.Config + authorizer autorest.Authorizer + resourceGroup string } func (p *AzureProvider) setEnvConfig() error { @@ -105,6 +106,7 @@ func (p *AzureProvider) Init(args []string) error { return err } p.authorizer = authorizer + p.resourceGroup = args[0] return nil } @@ -180,8 +182,9 @@ func (p *AzureProvider) InitService(serviceName string, verbose bool) error { p.Service.SetVerbose(verbose) p.Service.SetProviderName(p.GetName()) p.Service.SetArgs(map[string]interface{}{ - "config": p.config, - "authorizer": p.authorizer, + "config": p.config, + "authorizer": p.authorizer, + "resource_group": p.resourceGroup, }) return nil } diff --git a/providers/azure/container.go b/providers/azure/container.go index 55879a4fee..fd90792268 100644 --- a/providers/azure/container.go +++ b/providers/azure/container.go @@ -36,7 +36,16 @@ func (g *ContainerGenerator) listAndAddForContainerGroup() ([]terraformutils.Res ContainerGroupsClient := containerinstance.NewContainerGroupsClient(subscriptionID) ContainerGroupsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - containerGroupIterator, err := ContainerGroupsClient.ListComplete(ctx) + var ( + containerGroupIterator containerinstance.ContainerGroupListResultIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + containerGroupIterator, err = ContainerGroupsClient.ListByResourceGroupComplete(ctx, rg) + } else { + containerGroupIterator, err = ContainerGroupsClient.ListComplete(ctx) + } if err != nil { return nil, err } @@ -51,7 +60,7 @@ func (g *ContainerGenerator) listAndAddForContainerGroup() ([]terraformutils.Res if err := containerGroupIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } @@ -93,7 +102,16 @@ func (g *ContainerGenerator) listAndAddForContainerRegistry() ([]terraformutils. ContainerRegistriesClient := containerregistry.NewRegistriesClient(subscriptionID) ContainerRegistriesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - containerRegistryIterator, err := ContainerRegistriesClient.ListComplete(ctx) + var ( + containerRegistryIterator containerregistry.RegistryListResultIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + containerRegistryIterator, err = ContainerRegistriesClient.ListByResourceGroupComplete(ctx, rg) + } else { + containerRegistryIterator, err = ContainerRegistriesClient.ListComplete(ctx) + } if err != nil { return nil, err } @@ -119,7 +137,7 @@ func (g *ContainerGenerator) listAndAddForContainerRegistry() ([]terraformutils. if err := containerRegistryIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } diff --git a/providers/azure/cosmosdb.go b/providers/azure/cosmosdb.go index ead2037186..3b904b52dc 100644 --- a/providers/azure/cosmosdb.go +++ b/providers/azure/cosmosdb.go @@ -115,7 +115,15 @@ func (g *CosmosDBGenerator) listAndAddForDatabaseAccounts() ([]terraformutils.Re DatabaseAccountsClient := documentdb.NewDatabaseAccountsClient(subscriptionID, subscriptionID) DatabaseAccountsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - accounts, err := DatabaseAccountsClient.List(ctx) + var ( + accounts documentdb.DatabaseAccountsListResult + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + accounts, err = DatabaseAccountsClient.ListByResourceGroup(ctx, rg) + } else { + accounts, err = DatabaseAccountsClient.List(ctx) + } if err != nil { return nil, err } diff --git a/providers/azure/database.go b/providers/azure/database.go index cd3018e943..bde48f1627 100644 --- a/providers/azure/database.go +++ b/providers/azure/database.go @@ -40,7 +40,15 @@ func (g *DatabasesGenerator) getMariaDBServers() ([]mariadb.Server, error) { Client := mariadb.NewServersClient(SubscriptionID) Client.Authorizer = Authorizer - Servers, err := Client.List(ctx) + var ( + Servers mariadb.ServerListResult + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + Servers, err = Client.ListByResourceGroup(ctx, rg) + } else { + Servers, err = Client.List(ctx) + } if err != nil { return nil, err } @@ -205,7 +213,16 @@ func (g *DatabasesGenerator) getMySQLServers() ([]mysql.Server, error) { Client := mysql.NewServersClient(SubscriptionID) Client.Authorizer = Authorizer - Servers, err := Client.List(ctx) + var ( + Servers mysql.ServerListResult + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + Servers, err = Client.ListByResourceGroup(ctx, rg) + } else { + Servers, err = Client.List(ctx) + } if err != nil { return nil, err } @@ -373,7 +390,17 @@ func (g *DatabasesGenerator) getPostgreSQLServers() ([]postgresql.Server, error) Client := postgresql.NewServersClient(SubscriptionID) Client.Authorizer = Authorizer - Servers, err := Client.List(ctx) + var ( + Servers postgresql.ServerListResult + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + Servers, err = Client.ListByResourceGroup(ctx, rg) + } else { + Servers, err = Client.List(ctx) + } + if err != nil { return nil, err } @@ -533,7 +560,16 @@ func (g *DatabasesGenerator) getSQLServers() ([]sql.Server, error) { Client := sql.NewServersClient(SubscriptionID) Client.Authorizer = Authorizer - ServerPages, err := Client.List(ctx) + var ( + ServerPages sql.ServerListResultPage + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + ServerPages, err = Client.ListByResourceGroup(ctx, rg) + } else { + ServerPages, err = Client.List(ctx) + } if err != nil { return nil, err } diff --git a/providers/azure/disk.go b/providers/azure/disk.go index 64dd4c27d0..bf727fb981 100644 --- a/providers/azure/disk.go +++ b/providers/azure/disk.go @@ -28,7 +28,7 @@ type DiskGenerator struct { AzureService } -func (g DiskGenerator) createResources(diskListIterator compute.DiskListIterator) []terraformutils.Resource { +func (g DiskGenerator) createResources(diskListIterator compute.DiskListIterator) ([]terraformutils.Resource, error) { var resources []terraformutils.Resource for diskListIterator.NotDone() { disk := diskListIterator.Value() @@ -40,10 +40,10 @@ func (g DiskGenerator) createResources(diskListIterator compute.DiskListIterator []string{})) if err := diskListIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *DiskGenerator) InitResources() error { @@ -51,10 +51,20 @@ func (g *DiskGenerator) InitResources() error { disksClient := compute.NewDisksClient(g.Args["config"].(authentication.Config).SubscriptionID) disksClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := disksClient.ListComplete(ctx) + + var ( + output compute.DiskListIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + output, err = disksClient.ListByResourceGroupComplete(ctx, rg) + } else { + output, err = disksClient.ListComplete(ctx) + } if err != nil { return err } - g.Resources = g.createResources(output) - return nil + g.Resources, err = g.createResources(output) + return err } diff --git a/providers/azure/dns.go b/providers/azure/dns.go index 7795e29c01..dbe3db101d 100644 --- a/providers/azure/dns.go +++ b/providers/azure/dns.go @@ -68,7 +68,7 @@ func (g *DNSGenerator) listRecordSets(resourceGroupName string, zoneName string, if err := recordSetIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } @@ -83,7 +83,17 @@ func (g *DNSGenerator) listAndAddForDNSZone() ([]terraformutils.Resource, error) DNSZonesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) var pageSize int32 = 50 - dnsZoneIterator, err := DNSZonesClient.ListComplete(ctx, &pageSize) + + var ( + dnsZoneIterator dns.ZoneListResultIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + dnsZoneIterator, err = DNSZonesClient.ListByResourceGroupComplete(ctx, rg, &pageSize) + } else { + dnsZoneIterator, err = DNSZonesClient.ListComplete(ctx, &pageSize) + } if err != nil { return nil, err } @@ -109,7 +119,7 @@ func (g *DNSGenerator) listAndAddForDNSZone() ([]terraformutils.Resource, error) if err := dnsZoneIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } diff --git a/providers/azure/keyvault.go b/providers/azure/keyvault.go index 8358864e3a..3fd43d9e88 100644 --- a/providers/azure/keyvault.go +++ b/providers/azure/keyvault.go @@ -28,7 +28,11 @@ type KeyVaultGenerator struct { AzureService } -func (g KeyVaultGenerator) createResources(resourceListResultIterator keyvault.ResourceListResultIterator) []terraformutils.Resource { +func (g KeyVaultGenerator) createResources(ctx context.Context, client keyvault.VaultsClient) ([]terraformutils.Resource, error) { + resourceListResultIterator, err := client.ListComplete(ctx, nil) + if err != nil { + return nil, err + } var resources []terraformutils.Resource for resourceListResultIterator.NotDone() { vault := resourceListResultIterator.Value() @@ -38,12 +42,34 @@ func (g KeyVaultGenerator) createResources(resourceListResultIterator keyvault.R "azurerm_key_vault", "azurerm", []string{})) - if err := resourceListResultIterator.Next(); err != nil { + if err := resourceListResultIterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (g KeyVaultGenerator) createResourcesByResourceGroup(ctx context.Context, rg string, client keyvault.VaultsClient) ([]terraformutils.Resource, error) { + iterator, err := client.ListByResourceGroupComplete(ctx, rg, nil) + if err != nil { + return nil, err + } + var resources []terraformutils.Resource + for iterator.NotDone() { + vault := iterator.Value() + resources = append(resources, terraformutils.NewSimpleResource( + *vault.ID, + *vault.Name, + "azurerm_key_vault", + "azurerm", + []string{})) + if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *KeyVaultGenerator) InitResources() error { @@ -51,10 +77,12 @@ func (g *KeyVaultGenerator) InitResources() error { vaultsClient := keyvault.NewVaultsClient(g.Args["config"].(authentication.Config).SubscriptionID) vaultsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := vaultsClient.ListComplete(ctx, nil) - if err != nil { + + var err error + if rg := g.Args["resource_group"].(string); rg != "" { + g.Resources, err = g.createResourcesByResourceGroup(ctx, rg, vaultsClient) return err } - g.Resources = g.createResources(output) - return nil + g.Resources, err = g.createResources(ctx, vaultsClient) + return err } diff --git a/providers/azure/load_balancer.go b/providers/azure/load_balancer.go index db35dd7028..bf1184da83 100644 --- a/providers/azure/load_balancer.go +++ b/providers/azure/load_balancer.go @@ -157,7 +157,17 @@ func (g *LoadBalancerGenerator) listAndAddForLoadBalancers() ([]terraformutils.R LoadBalancersClient := network.NewLoadBalancersClient(subscriptionID) LoadBalancersClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - loadBalancerIterator, err := LoadBalancersClient.ListAllComplete(ctx) + + var ( + loadBalancerIterator network.LoadBalancerListResultIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + loadBalancerIterator, err = LoadBalancersClient.ListComplete(ctx, rg) + } else { + loadBalancerIterator, err = LoadBalancersClient.ListAllComplete(ctx) + } if err != nil { return nil, err @@ -196,7 +206,7 @@ func (g *LoadBalancerGenerator) listAndAddForLoadBalancers() ([]terraformutils.R if err := loadBalancerIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } diff --git a/providers/azure/network_interface.go b/providers/azure/network_interface.go index aeca3b9de5..4b6b304447 100644 --- a/providers/azure/network_interface.go +++ b/providers/azure/network_interface.go @@ -28,24 +28,22 @@ type NetworkInterfaceGenerator struct { AzureService } -func (g NetworkInterfaceGenerator) createResources(interfaceListResultPage network.InterfaceListResultPage) []terraformutils.Resource { +func (g NetworkInterfaceGenerator) createResources(interfaceListResult network.InterfaceListResultIterator) ([]terraformutils.Resource, error) { var resources []terraformutils.Resource - for interfaceListResultPage.NotDone() { - networkInterfaces := interfaceListResultPage.Values() - for _, networkInterface := range networkInterfaces { - resources = append(resources, terraformutils.NewSimpleResource( - *networkInterface.ID, - *networkInterface.Name, - "azurerm_network_interface", - "azurerm", - []string{})) - } - if err := interfaceListResultPage.Next(); err != nil { + for interfaceListResult.NotDone() { + networkInterface := interfaceListResult.Value() + resources = append(resources, terraformutils.NewSimpleResource( + *networkInterface.ID, + *networkInterface.Name, + "azurerm_network_interface", + "azurerm", + []string{})) + if err := interfaceListResult.Next(); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *NetworkInterfaceGenerator) InitResources() error { @@ -53,10 +51,18 @@ func (g *NetworkInterfaceGenerator) InitResources() error { interfacesClient := network.NewInterfacesClient(g.Args["config"].(authentication.Config).SubscriptionID) interfacesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := interfacesClient.ListAll(ctx) + var ( + output network.InterfaceListResultIterator + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + output, err = interfacesClient.ListComplete(ctx, rg) + } else { + output, err = interfacesClient.ListAllComplete(ctx) + } if err != nil { return err } - g.Resources = g.createResources(output) - return nil + g.Resources, err = g.createResources(output) + return err } diff --git a/providers/azure/network_security_group.go b/providers/azure/network_security_group.go index 6c0b41e705..ecbd0e2b5f 100644 --- a/providers/azure/network_security_group.go +++ b/providers/azure/network_security_group.go @@ -28,34 +28,41 @@ type NetworkSecurityGroupGenerator struct { AzureService } -func (g NetworkSecurityGroupGenerator) createResources(securityGroupListResultPage network.SecurityGroupListResultPage) []terraformutils.Resource { +func (g NetworkSecurityGroupGenerator) createResources(securityGroupListResult network.SecurityGroupListResultIterator) ([]terraformutils.Resource, error) { var resources []terraformutils.Resource - for securityGroupListResultPage.NotDone() { - nsgs := securityGroupListResultPage.Values() - for _, nsg := range nsgs { - resources = append(resources, terraformutils.NewSimpleResource( - *nsg.ID, - *nsg.Name, - "azurerm_network_security_group", - "azurerm", - []string{})) - } - if err := securityGroupListResultPage.Next(); err != nil { + for securityGroupListResult.NotDone() { + nsg := securityGroupListResult.Value() + resources = append(resources, terraformutils.NewSimpleResource( + *nsg.ID, + *nsg.Name, + "azurerm_network_security_group", + "azurerm", + []string{})) + if err := securityGroupListResult.Next(); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *NetworkSecurityGroupGenerator) InitResources() error { ctx := context.Background() securityGroupsClient := network.NewSecurityGroupsClient(g.Args["config"].(authentication.Config).SubscriptionID) securityGroupsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := securityGroupsClient.ListAll(ctx) + + var ( + output network.SecurityGroupListResultIterator + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + output, err = securityGroupsClient.ListComplete(ctx, rg) + } else { + output, err = securityGroupsClient.ListAllComplete(ctx) + } if err != nil { return err } - g.Resources = g.createResources(output) - return nil + g.Resources, err = g.createResources(output) + return err } diff --git a/providers/azure/private_dns.go b/providers/azure/private_dns.go index 7f8e6c7b1f..c97967180b 100644 --- a/providers/azure/private_dns.go +++ b/providers/azure/private_dns.go @@ -111,7 +111,16 @@ func (g *PrivateDNSGenerator) listAndAddForPrivateDNSZone() ([]terraformutils.Re PrivateDNSZonesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) var pageSize int32 = 50 - dnsZoneIterator, err := PrivateDNSZonesClient.ListComplete(ctx, &pageSize) + + var ( + dnsZoneIterator privatedns.PrivateZoneListResultIterator + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + dnsZoneIterator, err = PrivateDNSZonesClient.ListByResourceGroupComplete(ctx, rg, &pageSize) + } else { + dnsZoneIterator, err = PrivateDNSZonesClient.ListComplete(ctx, &pageSize) + } if err != nil { return nil, err } @@ -143,7 +152,7 @@ func (g *PrivateDNSGenerator) listAndAddForPrivateDNSZone() ([]terraformutils.Re if err := dnsZoneIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } diff --git a/providers/azure/public_ip.go b/providers/azure/public_ip.go index 35437685aa..aede5b2eca 100644 --- a/providers/azure/public_ip.go +++ b/providers/azure/public_ip.go @@ -35,7 +35,15 @@ func (g *PublicIPGenerator) listAndAddForPublicIPAddress() ([]terraformutils.Res PublicIPAddressesClient := network.NewPublicIPAddressesClient(subscriptionID) PublicIPAddressesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - publicIPAddressIterator, err := PublicIPAddressesClient.ListAllComplete(ctx) + var ( + publicIPAddressIterator network.PublicIPAddressListResultIterator + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + publicIPAddressIterator, err = PublicIPAddressesClient.ListComplete(ctx, rg) + } else { + publicIPAddressIterator, err = PublicIPAddressesClient.ListAllComplete(ctx) + } if err != nil { return nil, err } @@ -50,7 +58,7 @@ func (g *PublicIPGenerator) listAndAddForPublicIPAddress() ([]terraformutils.Res if err := publicIPAddressIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } @@ -64,7 +72,16 @@ func (g *PublicIPGenerator) listAndAddForPublicIPPrefix() ([]terraformutils.Reso PublicIPPrefixesClient := network.NewPublicIPPrefixesClient(subscriptionID) PublicIPPrefixesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - publicIPPrefixIterator, err := PublicIPPrefixesClient.ListAllComplete(ctx) + var ( + publicIPPrefixIterator network.PublicIPPrefixListResultIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + publicIPPrefixIterator, err = PublicIPPrefixesClient.ListComplete(ctx, rg) + } else { + publicIPPrefixIterator, err = PublicIPPrefixesClient.ListAllComplete(ctx) + } if err != nil { return nil, err } @@ -79,7 +96,7 @@ func (g *PublicIPGenerator) listAndAddForPublicIPPrefix() ([]terraformutils.Reso if err := publicIPPrefixIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } diff --git a/providers/azure/resource_group.go b/providers/azure/resource_group.go index 0ffe1aae1b..a53c3d39c2 100644 --- a/providers/azure/resource_group.go +++ b/providers/azure/resource_group.go @@ -51,6 +51,22 @@ func (g *ResourceGroupGenerator) InitResources() error { groupsClient := resources.NewGroupsClient(g.Args["config"].(authentication.Config).SubscriptionID) groupsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) + + if rg := g.Args["resource_group"].(string); rg != "" { + group, err := groupsClient.Get(ctx, rg) + if err != nil { + return err + } + g.Resources = []terraformutils.Resource{ + terraformutils.NewSimpleResource( + *group.ID, + *group.Name, + "azurerm_resource_group", + "azurerm", + []string{}), + } + return nil + } output, err := groupsClient.ListComplete(ctx, "", nil) if err != nil { return err diff --git a/providers/azure/scaleset.go b/providers/azure/scaleset.go index 19a964adf0..035e20e96d 100644 --- a/providers/azure/scaleset.go +++ b/providers/azure/scaleset.go @@ -28,7 +28,34 @@ type ScaleSetGenerator struct { AzureService } -func (g ScaleSetGenerator) createResources(scaleSetIterator compute.VirtualMachineScaleSetListWithLinkResultIterator) []terraformutils.Resource { +func (g ScaleSetGenerator) createResourcesByResourceGroup(ctx context.Context, client compute.VirtualMachineScaleSetsClient, rg string) ([]terraformutils.Resource, error) { + scaleSetIterator, err := client.ListComplete(ctx, rg) + if err != nil { + return nil, err + } + var resources []terraformutils.Resource + for scaleSetIterator.NotDone() { + scaleSet := scaleSetIterator.Value() + newResource := terraformutils.NewSimpleResource( + *scaleSet.ID, + *scaleSet.Name, + "azurerm_virtual_machine_scale_set", + "azurerm", + []string{}) + resources = append(resources, newResource) + if err := scaleSetIterator.Next(); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (g ScaleSetGenerator) createResources(ctx context.Context, client compute.VirtualMachineScaleSetsClient) ([]terraformutils.Resource, error) { + scaleSetIterator, err := client.ListAllComplete(ctx) + if err != nil { + return nil, err + } var resources []terraformutils.Resource for scaleSetIterator.NotDone() { scaleSet := scaleSetIterator.Value() @@ -41,10 +68,10 @@ func (g ScaleSetGenerator) createResources(scaleSetIterator compute.VirtualMachi resources = append(resources, newResource) if err := scaleSetIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *ScaleSetGenerator) InitResources() error { @@ -52,10 +79,13 @@ func (g *ScaleSetGenerator) InitResources() error { ScaleSetClient := compute.NewVirtualMachineScaleSetsClient(g.Args["config"].(authentication.Config).SubscriptionID) ScaleSetClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := ScaleSetClient.ListAllComplete(ctx) - if err != nil { + + if rg := g.Args["resource_group"].(string); rg != "" { + var err error + g.Resources, err = g.createResourcesByResourceGroup(ctx, ScaleSetClient, rg) return err } - g.Resources = g.createResources(output) - return nil + var err error + g.Resources, err = g.createResources(ctx, ScaleSetClient) + return err } diff --git a/providers/azure/security_center_contact.go b/providers/azure/security_center_contact.go index 77f473bb70..5df9405677 100644 --- a/providers/azure/security_center_contact.go +++ b/providers/azure/security_center_contact.go @@ -22,6 +22,9 @@ func (g SecurityCenterContactGenerator) listContacts() ([]terraformutils.Resourc securityCenterContactClient := security.NewContactsClient(subscriptionID, "") securityCenterContactClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) + if rg := g.Args["resource_group"].(string); rg != "" { + return resources, nil + } contactsIterator, err := securityCenterContactClient.ListComplete(ctx) if err != nil { return resources, err diff --git a/providers/azure/security_center_subscription_pricing.go b/providers/azure/security_center_subscription_pricing.go index ff28f750c8..7d193d6f2d 100644 --- a/providers/azure/security_center_subscription_pricing.go +++ b/providers/azure/security_center_subscription_pricing.go @@ -22,6 +22,9 @@ func (g SecurityCenterSubscriptionPricingGenerator) listSubscriptionPricing() ([ securityCenterPricingClient := security.NewPricingsClient(subscriptionID, "") securityCenterPricingClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) + if rg := g.Args["resource_group"].(string); rg != "" { + return resources, nil + } pricingList, err := securityCenterPricingClient.List(ctx) if err != nil { return resources, err diff --git a/providers/azure/storage_account.go b/providers/azure/storage_account.go index 9ef0eab082..1c91b79145 100644 --- a/providers/azure/storage_account.go +++ b/providers/azure/storage_account.go @@ -28,7 +28,29 @@ type StorageAccountGenerator struct { AzureService } -func (g StorageAccountGenerator) createResources(accountListResultIterator storage.AccountListResultIterator) []terraformutils.Resource { +func (g StorageAccountGenerator) createResourcesByResourceGroup(ctx context.Context, client storage.AccountsClient, rg string) ([]terraformutils.Resource, error) { + accountListResult, err := client.ListByResourceGroup(ctx, rg) + if err != nil { + return nil, err + } + var resources []terraformutils.Resource + if accounts := accountListResult.Value; accounts != nil { + for _, account := range *accounts { + resources = append(resources, terraformutils.NewSimpleResource( + *account.ID, + *account.Name, + "azurerm_storage_account", + "azurerm", + []string{})) + } + } + return resources, nil +} +func (g StorageAccountGenerator) createResources(ctx context.Context, client storage.AccountsClient) ([]terraformutils.Resource, error) { + accountListResultIterator, err := client.ListComplete(ctx) + if err != nil { + return nil, err + } var resources []terraformutils.Resource for accountListResultIterator.NotDone() { account := accountListResultIterator.Value() @@ -40,21 +62,22 @@ func (g StorageAccountGenerator) createResources(accountListResultIterator stora []string{})) if err := accountListResultIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *StorageAccountGenerator) InitResources() error { ctx := context.Background() accountsClient := storage.NewAccountsClient(g.Args["config"].(authentication.Config).SubscriptionID) - accountsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := accountsClient.ListComplete(ctx) - if err != nil { + if rg := g.Args["resource_group"].(string); rg != "" { + output, err := g.createResourcesByResourceGroup(ctx, accountsClient, rg) + g.Resources = output return err } - g.Resources = g.createResources(output) - return nil + output, err := g.createResources(ctx, accountsClient) + g.Resources = output + return err } diff --git a/providers/azure/storage_blob.go b/providers/azure/storage_blob.go index 750a0bc7f0..de7298b453 100644 --- a/providers/azure/storage_blob.go +++ b/providers/azure/storage_blob.go @@ -78,7 +78,7 @@ func (g StorageBlobGenerator) listStorageBlobs() ([]terraformutils.Resource, err var storageBlobsResources []terraformutils.Resource ctx := context.Background() - blobContainerGenerator := NewStorageContainerGenerator(g.Args["config"].(authentication.Config).SubscriptionID, g.Args["authorizer"].(autorest.Authorizer)) + blobContainerGenerator := NewStorageContainerGenerator(g.Args["config"].(authentication.Config).SubscriptionID, g.Args["authorizer"].(autorest.Authorizer), g.Args["resource_group"].(string)) blobContainersResources, err := blobContainerGenerator.ListBlobContainers() if err != nil { return storageBlobsResources, err diff --git a/providers/azure/storage_container.go b/providers/azure/storage_container.go index ff21f370de..df623929d0 100644 --- a/providers/azure/storage_container.go +++ b/providers/azure/storage_container.go @@ -18,11 +18,12 @@ type StorageContainerGenerator struct { AzureService } -func NewStorageContainerGenerator(subscriptionID string, authorizer autorest.Authorizer) *StorageContainerGenerator { +func NewStorageContainerGenerator(subscriptionID string, authorizer autorest.Authorizer, rg string) *StorageContainerGenerator { storageContainerGenerator := new(StorageContainerGenerator) storageContainerGenerator.Args = map[string]interface{}{} storageContainerGenerator.Args["config"] = authentication.Config{SubscriptionID: subscriptionID} storageContainerGenerator.Args["authorizer"] = authorizer + storageContainerGenerator.Args["resource_group"] = rg return storageContainerGenerator } @@ -33,13 +34,12 @@ func (g StorageContainerGenerator) ListBlobContainers() ([]terraformutils.Resour blobContainersClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) ctx := context.Background() - accountListResultIterator, err := g.getStorageAccountsIterator() + accounts, err := g.getStorageAccounts() if err != nil { return containerResources, err } - for accountListResultIterator.NotDone() { - storageAccount := accountListResultIterator.Value() + for _, storageAccount := range accounts { parsedStorageAccountResourceID, err := ParseAzureResourceID(*storageAccount.ID) if err != nil { break @@ -68,23 +68,42 @@ func (g StorageContainerGenerator) ListBlobContainers() ([]terraformutils.Resour return containerResources, err } } - - if err := accountListResultIterator.NextWithContext(ctx); err != nil { - return containerResources, err - } } return containerResources, nil } -func (g *StorageContainerGenerator) getStorageAccountsIterator() (storage.AccountListResultIterator, error) { +func (g *StorageContainerGenerator) getStorageAccounts() ([]storage.Account, error) { ctx := context.Background() accountsClient := storage.NewAccountsClient(g.Args["config"].(authentication.Config).SubscriptionID) accountsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - accountsIterator, err := accountsClient.ListComplete(ctx) + var accounts []storage.Account + if rg := g.Args["resource_group"].(string); rg != "" { + accountsResult, err := accountsClient.ListByResourceGroup(ctx, rg) + if err != nil { + return nil, err + } + if paccounts := accountsResult.Value; paccounts != nil { + for _, account := range *paccounts { + accounts = append(accounts, account) + } + } + } else { + accountsIterator, err := accountsClient.ListComplete(ctx) + if err != nil { + return nil, err + } + for accountsIterator.NotDone() { + account := accountsIterator.Value() + accounts = append(accounts, account) + if err := accountsIterator.NextWithContext(ctx); err != nil { + return accounts, err + } + } + } - return accountsIterator, err + return accounts, nil } func (g *StorageContainerGenerator) InitResources() error { diff --git a/providers/azure/virtual_machine.go b/providers/azure/virtual_machine.go index b9ac023eed..f0cb8006c7 100644 --- a/providers/azure/virtual_machine.go +++ b/providers/azure/virtual_machine.go @@ -28,36 +28,34 @@ type VirtualMachineGenerator struct { AzureService } -func (g VirtualMachineGenerator) createResources(virtualMachineListResultPage compute.VirtualMachineListResultPage) []terraformutils.Resource { +func (g VirtualMachineGenerator) createResources(virtualMachineListResultIterator compute.VirtualMachineListResultIterator) ([]terraformutils.Resource, error) { var resources []terraformutils.Resource - for virtualMachineListResultPage.NotDone() { - vms := virtualMachineListResultPage.Values() - for _, vm := range vms { - var newResource terraformutils.Resource - if vm.VirtualMachineProperties.OsProfile.WindowsConfiguration != nil { - newResource = terraformutils.NewSimpleResource( - *vm.ID, - *vm.Name, - "azurerm_windows_virtual_machine", - "azurerm", - []string{}) - } else { - newResource = terraformutils.NewSimpleResource( - *vm.ID, - *vm.Name, - "azurerm_linux_virtual_machine", - "azurerm", - []string{}) - } - - resources = append(resources, newResource) + for virtualMachineListResultIterator.NotDone() { + vm := virtualMachineListResultIterator.Value() + var newResource terraformutils.Resource + if vm.VirtualMachineProperties.OsProfile.WindowsConfiguration != nil { + newResource = terraformutils.NewSimpleResource( + *vm.ID, + *vm.Name, + "azurerm_windows_virtual_machine", + "azurerm", + []string{}) + } else { + newResource = terraformutils.NewSimpleResource( + *vm.ID, + *vm.Name, + "azurerm_linux_virtual_machine", + "azurerm", + []string{}) } - if err := virtualMachineListResultPage.Next(); err != nil { + + resources = append(resources, newResource) + if err := virtualMachineListResultIterator.Next(); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *VirtualMachineGenerator) InitResources() error { @@ -65,10 +63,19 @@ func (g *VirtualMachineGenerator) InitResources() error { vmClient := compute.NewVirtualMachinesClient(g.Args["config"].(authentication.Config).SubscriptionID) vmClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := vmClient.ListAll(ctx) + + var ( + output compute.VirtualMachineListResultIterator + err error + ) + if rg := g.Args["resource_group"].(string); rg != "" { + output, err = vmClient.ListComplete(ctx, rg) + } else { + output, err = vmClient.ListAllComplete(ctx) + } if err != nil { return err } - g.Resources = g.createResources(output) - return nil + g.Resources, err = g.createResources(output) + return err } diff --git a/providers/azure/virtual_network.go b/providers/azure/virtual_network.go index 38d76dc662..34c09ccc39 100644 --- a/providers/azure/virtual_network.go +++ b/providers/azure/virtual_network.go @@ -28,24 +28,22 @@ type VirtualNetworkGenerator struct { AzureService } -func (g VirtualNetworkGenerator) createResources(virtualNetworkListResultPage network.VirtualNetworkListResultPage) []terraformutils.Resource { +func (g VirtualNetworkGenerator) createResources(ctx context.Context, iterator network.VirtualNetworkListResultIterator) ([]terraformutils.Resource, error) { var resources []terraformutils.Resource - for virtualNetworkListResultPage.NotDone() { - virtualNetworks := virtualNetworkListResultPage.Values() - for _, virtualNetwork := range virtualNetworks { - resources = append(resources, terraformutils.NewSimpleResource( - *virtualNetwork.ID, - *virtualNetwork.Name, - "azurerm_virtual_network", - "azurerm", - []string{})) - } - if err := virtualNetworkListResultPage.Next(); err != nil { + for iterator.NotDone() { + virtualNetwork := iterator.Value() + resources = append(resources, terraformutils.NewSimpleResource( + *virtualNetwork.ID, + *virtualNetwork.Name, + "azurerm_virtual_network", + "azurerm", + []string{})) + if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) - break + return resources, err } } - return resources + return resources, nil } func (g *VirtualNetworkGenerator) InitResources() error { @@ -53,10 +51,20 @@ func (g *VirtualNetworkGenerator) InitResources() error { virtualNetworkClient := network.NewVirtualNetworksClient(g.Args["config"].(authentication.Config).SubscriptionID) virtualNetworkClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) - output, err := virtualNetworkClient.ListAll(ctx) + + var ( + output network.VirtualNetworkListResultIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + output, err = virtualNetworkClient.ListComplete(ctx, rg) + } else { + output, err = virtualNetworkClient.ListAllComplete(ctx) + } if err != nil { return err } - g.Resources = g.createResources(output) - return nil + g.Resources, err = g.createResources(ctx, output) + return err } From d23ba8cddfcf37bcf11e603c8295e055fe9eccdc Mon Sep 17 00:00:00 2001 From: Anil Kumar Nagaraj Date: Wed, 11 Nov 2020 09:11:56 +0530 Subject: [PATCH 002/276] Add support for IBM cloud provider --- README.md | 73 +++++ cmd/provider_cmd_ibm.go | 48 ++++ cmd/root.go | 2 + providers/ibm/cis.go | 349 ++++++++++++++++++++++++ providers/ibm/container_cluster.go | 100 +++++++ providers/ibm/cos.go | 122 +++++++++ providers/ibm/database_elasticsearch.go | 85 ++++++ providers/ibm/database_etcd.go | 85 ++++++ providers/ibm/database_mongo.go | 85 ++++++ providers/ibm/database_postgresql.go | 88 ++++++ providers/ibm/database_rabbitmq.go | 85 ++++++ providers/ibm/database_redis.go | 86 ++++++ providers/ibm/iam.go | 177 ++++++++++++ providers/ibm/ibm_is_instance.go | 91 ++++++ providers/ibm/ibm_is_security_group.go | 131 +++++++++ providers/ibm/ibm_is_subnet.go | 92 +++++++ providers/ibm/ibm_is_vpc.go | 134 +++++++++ providers/ibm/ibm_provider.go | 90 ++++++ providers/ibm/ibm_service.go | 23 ++ providers/ibm/instance_groups.go | 178 ++++++++++++ providers/ibm/kp.go | 64 +++++ providers/ibm/utils.go | 111 ++++++++ providers/ibm/vpc_cluster.go | 86 ++++++ 23 files changed, 2385 insertions(+) create mode 100644 cmd/provider_cmd_ibm.go create mode 100644 providers/ibm/cis.go create mode 100644 providers/ibm/container_cluster.go create mode 100644 providers/ibm/cos.go create mode 100644 providers/ibm/database_elasticsearch.go create mode 100644 providers/ibm/database_etcd.go create mode 100644 providers/ibm/database_mongo.go create mode 100644 providers/ibm/database_postgresql.go create mode 100644 providers/ibm/database_rabbitmq.go create mode 100644 providers/ibm/database_redis.go create mode 100644 providers/ibm/iam.go create mode 100644 providers/ibm/ibm_is_instance.go create mode 100644 providers/ibm/ibm_is_security_group.go create mode 100644 providers/ibm/ibm_is_subnet.go create mode 100644 providers/ibm/ibm_is_vpc.go create mode 100644 providers/ibm/ibm_provider.go create mode 100644 providers/ibm/ibm_service.go create mode 100644 providers/ibm/instance_groups.go create mode 100644 providers/ibm/kp.go create mode 100644 providers/ibm/utils.go create mode 100644 providers/ibm/vpc_cluster.go diff --git a/README.md b/README.md index e2d8a82812..a6dc411705 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [AWS](#use-with-aws) * [Azure](#use-with-azure) * [AliCloud](#use-with-alicloud) + * [IBM Cloud](#use-with-ibm-cloud) * Cloud * [DigitalOcean](#use-with-digitalocean) * [Fastly](#use-with-fastly) @@ -859,6 +860,77 @@ List of supported AliCloud resources: * `vswitch` * `alicloud_vswitch` + ### Use with IBM Cloud + +If you want to run Terraformer with the IBM Cloud provider plugin on your system, complete the following steps: + +1. [Download the IBM Cloud provider plugin for Terraform](https://github.com/IBM-Bluemix/terraform-provider-ibm/releases). + +2. Unzip the release archive to extract the plugin binary(`terraform-provider-ibm_vX.Y.Z`). + +3. Move the binary into the Terraform [plugins directory](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins) for the platform. + - Linux/Unix/OS X: `~/.terraform.d/plugins/` e.g `~/.terraform.d/plugins/darwin_amd64` + - Windows: `%APPDATA%\terraform.d\plugins\` + +4. [Download the Terraformer](https://github.ibm.com/blueprint/terraformer/releases). + +5. chmod +x terraformer-all--${OS}--${ARCH} + +6. sudo mv terraformer-all--${OS}--${ARCH} /usr/local/bin/terraformer + +7. Export IBM Cloud API key as environment variables. + Example: + + ``` + export IC_API_KEY= + export IC_REGION= + terraformer import ibm -r ibm_cos,ibm_iam.... + ``` +8. Use flag for Resource Group to classify resources accordingly. + Example: + + ``` + export IC_API_KEY= + export IC_REGION= + terraformer import ibm --resources=ibm_is_vpc --resource_group=a0d5213d831a454ebace7ed38ca9c8ca + ``` +List of supported IBM Cloud resources: + +* `ibm_cos` + * `ibm_resource_instance` + * `ibm_cos_bucket` +* `ibm_iam` + * `ibm_iam_user_policy` + * `ibm_iam_access_group` + * `ibm_iam_access_group_members` + * `ibm_iam_access_group_policy` + * `ibm_iam_access_group_dynamic_rule` +* `ibm_container_vpc_cluster` + * `ibm_container_vpc_cluster` + * `ibm_container_vpc_worker_pool` +* `ibm_database_etcd` + * `ibm_database` +* `ibm_database_mongo` + * `ibm_database` +* `ibm_database_postgresql` + * `ibm_database` +* `ibm_database_rabbitmq` + * `ibm_database` +* `ibm_database_redis` + * `ibm_database` +* `ibm_is_instance_group` + * `ibm_is_instance_group` + * `ibm_is_instance_group_manager` + * `ibm_is_instance_group_manager_policy` +* `ibm_is_vpc` + * `ibm_is_vpc` + * `ibm_is_vpc_address_prefix` + * `ibm_is_vpc_route` +* `ibm_is_subnet` +* `ibm_is_instance` +* `ibm_is_security_group` + * `ibm_is_security_group_rule` + ### Use with DigitalOcean Example: @@ -972,6 +1044,7 @@ List of supported Heroku resources: * `team_member` * `heroku_team_member` + ### Use with Linode Example: diff --git a/cmd/provider_cmd_ibm.go b/cmd/provider_cmd_ibm.go new file mode 100644 index 0000000000..ee487143a1 --- /dev/null +++ b/cmd/provider_cmd_ibm.go @@ -0,0 +1,48 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + ibm_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/ibm" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdIbmImporter(options ImportOptions) *cobra.Command { + var resourceGroup string + cmd := &cobra.Command{ + Use: "ibm", + Short: "Import current state to Terraform configuration from ibm", + Long: "Import current state to Terraform configuration from ibm", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newIbmProvider() + err := Import(provider, options, []string{resourceGroup}) + if err != nil { + return err + } + return nil + }, + } + + cmd.AddCommand(listCmd(newIbmProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "server", "ibm_server=name1:name2:name3") + // baseProviderFlags(cmd.PersistentFlags(), &options, "resource_group", "resource_group=name1:name2:name3") + cmd.PersistentFlags().StringVarP(&resourceGroup, "resource_group", "", "", "resource_group=default") + return cmd +} + +func newIbmProvider() terraformutils.ProviderGenerator { + return &ibm_terraforming.IBMProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index 97d65adbc5..af080c38bf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -43,6 +43,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdAwsImporter, newCmdAzureImporter, newCmdAliCloudImporter, + newCmdIbmImporter, // Cloud newCmdDigitalOceanImporter, newCmdFastlyImporter, @@ -80,6 +81,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { newAWSProvider, newAzureProvider, newAliCloudProvider, + newIbmProvider, // Cloud newDigitalOceanProvider, newFastlyProvider, diff --git a/providers/ibm/cis.go b/providers/ibm/cis.go new file mode 100644 index 0000000000..3e0928e428 --- /dev/null +++ b/providers/ibm/cis.go @@ -0,0 +1,349 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" + "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/networking-go-sdk/dnsrecordsv1" + "github.com/IBM/networking-go-sdk/globalloadbalancermonitorv1" + "github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0" + "github.com/IBM/networking-go-sdk/globalloadbalancerv1" + "github.com/IBM/networking-go-sdk/zonelockdownv1" + "github.com/IBM/networking-go-sdk/zoneratelimitsv1" + "github.com/IBM/networking-go-sdk/zonesv1" +) + +// CISGenerator .. +type CISGenerator struct { + IBMService +} + +func (g CISGenerator) loadInstances(crn, name string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + crn, + name, + "ibm_cis", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadDomains(crn, domainID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s", domainID, crn), + domainID, + "ibm_cis_domain", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s:%s", dnsRecordID, domainID, crn), + dnsRecordID, + "ibm_cis_dns_record", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadFirewallLockdown(crn, domainID, fID, fType string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s:%s:%s", fType, fID, domainID, crn), + fID, + "ibm_cis_firewall", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadDomainSettings(crn, dID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s", dID, crn), + dID, + "ibm_cis_domain_settings", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s:%s", gID, dID, crn), + dID, + "ibm_cis_global_load_balancer", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadGlobalBalancerPool(crn, pID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s", pID, crn), + pID, + "ibm_cis_origin_pool", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s", gblmID, crn), + gblmID, + "ibm_cis_healthcheck", + g.ProviderName, + []string{}) + return resources +} + +func (g CISGenerator) loadRateLimit(crn, dID, rID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s:%s", rID, dID, crn), + rID, + "ibm_cis_rate_limit", + g.ProviderName, + []string{}) + return resources +} + +// InitResources .. +func (g *CISGenerator) InitResources() error { + DefaultCisURL := "https://api.cis.cloud.ibm.com" + + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + err = authenticateAPIKey(sess) + if err != nil { + return err + } + + bluemixToken := "" + if strings.HasPrefix(sess.Config.IAMAccessToken, "Bearer") { + bluemixToken = sess.Config.IAMAccessToken[7:len(sess.Config.IAMAccessToken)] + } else { + bluemixToken = sess.Config.IAMAccessToken + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("internet-svcs", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + cisInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + + for _, c := range cisInstances { + //Instance + crn := c.Crn.String() + g.Resources = append(g.Resources, g.loadInstances(crn, c.Name)) + + //Domain + zoneOpts := &zonesv1.ZonesV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + } + + zService, err := zonesv1.NewZonesV1(zoneOpts) + if err != nil { + return err + } + + domainOpts := &zonesv1.ListZonesOptions{} + zoneList, _, err := zService.ListZones(domainOpts) + if err != nil { + return err + } + + for _, z := range zoneList.Result { + g.Resources = append(g.Resources, g.loadDomains(crn, *z.ID)) + + //DNS Record + zoneID := *z.ID + dnsOpts := &dnsrecordsv1.DnsRecordsV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + dnsService, err := dnsrecordsv1.NewDnsRecordsV1(dnsOpts) + if err != nil { + return err + } + + dOpts := &dnsrecordsv1.ListAllDnsRecordsOptions{} + dnsList, _, err := dnsService.ListAllDnsRecords(dOpts) + if err != nil { + return err + } + + for _, d := range dnsList.Result { + g.Resources = append(g.Resources, g.loadDNSRecords(crn, *z.ID, *d.ID)) + } + + //Domain Setting + g.Resources = append(g.Resources, g.loadDomainSettings(crn, *z.ID)) + + //Global Load Balancer + gblSetttingOpts := &globalloadbalancerv1.GlobalLoadBalancerV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + gblService, err := globalloadbalancerv1.NewGlobalLoadBalancerV1(gblSetttingOpts) + if err != nil { + return err + } + + gblList, _, err := gblService.ListAllLoadBalancers(&globalloadbalancerv1.ListAllLoadBalancersOptions{}) + if err != nil { + return err + } + + for _, gb := range gblList.Result { + g.Resources = append(g.Resources, g.loadGlobalBalancer(crn, *z.ID, *gb.ID)) + } + + //Firewall Lockdown + firewallOpts := &zonelockdownv1.ZoneLockdownV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + fService, err := zonelockdownv1.NewZoneLockdownV1(firewallOpts) + if err != nil { + return err + } + + firewallList, _, err := fService.ListAllZoneLockownRules(&zonelockdownv1.ListAllZoneLockownRulesOptions{}) + if err != nil { + return err + } + + for _, f := range firewallList.Result { + g.Resources = append(g.Resources, g.loadFirewallLockdown(crn, *z.ID, *f.ID, "lockdowns")) + } + + //Health Monitor + gblmOpts := &globalloadbalancermonitorv1.GlobalLoadBalancerMonitorV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, + Crn: &crn, + } + + gblmService, _ := globalloadbalancermonitorv1.NewGlobalLoadBalancerMonitorV1(gblmOpts) + gblmList, _, err := gblmService.ListAllLoadBalancerMonitors(&globalloadbalancermonitorv1.ListAllLoadBalancerMonitorsOptions{}) + if err != nil { + return err + } + + for _, gblm := range gblmList.Result { + g.Resources = append(g.Resources, g.loadGlobalBalancerMonitor(crn, *gblm.ID)) + } + + //GlobaloadBalancer Pool + gblPoolOpts := &globalloadbalancerpoolsv0.GlobalLoadBalancerPoolsV0Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, + Crn: &crn, + } + + gblpService, _ := globalloadbalancerpoolsv0.NewGlobalLoadBalancerPoolsV0(gblPoolOpts) + gblpList, _, err := gblpService.ListAllLoadBalancerPools(&globalloadbalancerpoolsv0.ListAllLoadBalancerPoolsOptions{}) + if err != nil { + return err + } + + for _, gblp := range gblpList.Result { + g.Resources = append(g.Resources, g.loadGlobalBalancerPool(crn, *gblp.ID)) + } + + //Rate Limit + rateLimitPoolOpts := &zoneratelimitsv1.ZoneRateLimitsV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + rateLimitService, _ := zoneratelimitsv1.NewZoneRateLimitsV1(rateLimitPoolOpts) + rateLimitList, _, err := rateLimitService.ListAllZoneRateLimits(&zoneratelimitsv1.ListAllZoneRateLimitsOptions{}) + if err != nil { + return err + } + + for _, rl := range rateLimitList.Result { + g.Resources = append(g.Resources, g.loadRateLimit(crn, *z.ID, *rl.ID)) + } + } + + } + + return nil +} diff --git a/providers/ibm/container_cluster.go b/providers/ibm/container_cluster.go new file mode 100644 index 0000000000..4a91f98289 --- /dev/null +++ b/providers/ibm/container_cluster.go @@ -0,0 +1,100 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" + "github.com/IBM-Cloud/bluemix-go/session" +) + +type ContainerClusterGenerator struct { + IBMService +} + +func (g ContainerClusterGenerator) loadcluster(clustersID, clusterName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + clustersID, + clusterName, + "ibm_container_cluster", + "ibm", + []string{}) + return resources +} + +func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID, PoolName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", clustersID, poolID), + PoolName, + "ibm_container_worker_pool", + "ibm", + []string{}) + return resources +} + +func (g ContainerClusterGenerator) loadWorkerPoolZones(clustersID, poolID, zoneID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s/%s", clustersID, poolID, zoneID), + zoneID, + "ibm_container_worker_pool_zone_attachment", + "ibm", + []string{}) + return resources +} + +func (g *ContainerClusterGenerator) InitResources() error { + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + client, err := containerv1.New(sess) + if err != nil { + return err + } + + clusters, err := client.Clusters().List(containerv1.ClusterTargetHeader{}) + if err != nil { + return err + } + + for _, cs := range clusters { + g.Resources = append(g.Resources, g.loadcluster(cs.ID, cs.Name)) + workerPools, err := client.WorkerPools().ListWorkerPools(cs.ID, containerv1.ClusterTargetHeader{}) + if err != nil { + return err + } + for _, pool := range workerPools { + if pool.Name != "default" { + g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, pool.Name)) + + zones := pool.Zones + for _, zone := range zones { + g.Resources = append(g.Resources, g.loadWorkerPoolZones(cs.ID, pool.ID, zone.ID)) + } + } + } + } + return nil +} diff --git a/providers/ibm/cos.go b/providers/ibm/cos.go new file mode 100644 index 0000000000..ee673cb528 --- /dev/null +++ b/providers/ibm/cos.go @@ -0,0 +1,122 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + "regexp" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" + "github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam" + + ibmaws "github.com/IBM/ibm-cos-sdk-go/aws" + cossession "github.com/IBM/ibm-cos-sdk-go/aws/session" + coss3 "github.com/IBM/ibm-cos-sdk-go/service/s3" +) + +type COSGenerator struct { + IBMService +} + +func (g COSGenerator) loadCOS(cosID string, cosName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + cosID, + cosName, + "ibm_resource_instance", + "ibm", + []string{}) + return resources +} + +func (g COSGenerator) loadCOSBuckets(bucketID, bucketName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + bucketID, + bucketName, + "ibm_cos_bucket", + "ibm", + []string{}) + return resources +} + +func (g *COSGenerator) InitResources() error { + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("cloud-object-storage", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + cosInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + authEndpoint := "https://iam.cloud.ibm.com/identity/token" + for _, cs := range cosInstances { + g.Resources = append(g.Resources, g.loadCOS(cs.ID, cs.Name)) + s3Conf := ibmaws.NewConfig().WithCredentials(ibmiam.NewStaticCredentials(ibmaws.NewConfig(), authEndpoint, os.Getenv("IC_API_KEY"), cs.ID)).WithS3ForcePathStyle(true).WithEndpoint("s3.us-south.cloud-object-storage.appdomain.cloud") + s3Sess := cossession.Must(cossession.NewSession()) + s3Client := coss3.New(s3Sess, s3Conf) + d, _ := s3Client.ListBucketsExtended(&coss3.ListBucketsExtendedInput{}) + for _, b := range d.Buckets { + var apiType, location string + singleSiteLocationRegex, _ := regexp.Compile("^[a-z]{3}[0-9][0-9]-[a-z]{4,8}$") + regionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{2,5}-[a-z]{4,8}$") + crossRegionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{4,8}$") + bLocationConstraint := *b.LocationConstraint + if singleSiteLocationRegex.MatchString(bLocationConstraint) { + apiType = "ss1" + location = strings.Split(bLocationConstraint, "-")[0] + } + if regionLocationRegex.MatchString(bLocationConstraint) { + apiType = "rl" + location = fmt.Sprintf("%s-%s", strings.Split(bLocationConstraint, "-")[0], strings.Split(bLocationConstraint, "-")[1]) + } + if crossRegionLocationRegex.MatchString(bLocationConstraint) { + apiType = "crl" + location = strings.Split(bLocationConstraint, "-")[0] + } + bucketID := fmt.Sprintf("%s:%s:%s:meta:%s:%s", strings.Replace(cs.ID, "::", "", -1), "bucket", *b.Name, apiType, location) + g.Resources = append(g.Resources, g.loadCOSBuckets(bucketID, *b.Name)) + } + } + + return nil +} diff --git a/providers/ibm/database_elasticsearch.go b/providers/ibm/database_elasticsearch.go new file mode 100644 index 0000000000..8e7c0eb3c8 --- /dev/null +++ b/providers/ibm/database_elasticsearch.go @@ -0,0 +1,85 @@ +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// DatabaseElasticSearchGenerator ... +type DatabaseElasticSearchGenerator struct { + IBMService +} + +// loadElasticSearchDB ... +func (g DatabaseElasticSearchGenerator) loadElasticSearchDB(dbID string, dbName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + dbID, + dbName, + "ibm_database", + "ibm", + []string{}) + return resources +} + +//InitResources ... +func (g *DatabaseElasticSearchGenerator) InitResources() error { + + region := os.Getenv("IC_REGION") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + Region: region, + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("databases-for-elasticsearch", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + elasticSearchInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + for _, db := range elasticSearchInstances { + if db.RegionID == region { + g.Resources = append(g.Resources, g.loadElasticSearchDB(db.ID, db.Name)) + } + } + + return nil +} diff --git a/providers/ibm/database_etcd.go b/providers/ibm/database_etcd.go new file mode 100644 index 0000000000..6477e3e76f --- /dev/null +++ b/providers/ibm/database_etcd.go @@ -0,0 +1,85 @@ +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// DatabaseETCDGenerator ... +type DatabaseETCDGenerator struct { + IBMService +} + +// loadETCDDB ... +func (g DatabaseETCDGenerator) loadETCDDB(dbID string, dbName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + dbID, + dbName, + "ibm_database", + "ibm", + []string{}) + return resources +} + +//InitResources ... +func (g *DatabaseETCDGenerator) InitResources() error { + + region := os.Getenv("IC_REGION") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + Region: region, + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("databases-for-etcd", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + etcdInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + for _, db := range etcdInstances { + if db.RegionID == region { + g.Resources = append(g.Resources, g.loadETCDDB(db.ID, db.Name)) + } + } + + return nil +} diff --git a/providers/ibm/database_mongo.go b/providers/ibm/database_mongo.go new file mode 100644 index 0000000000..dc48dff2e2 --- /dev/null +++ b/providers/ibm/database_mongo.go @@ -0,0 +1,85 @@ +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// DatabaseMongoGenerator ... +type DatabaseMongoGenerator struct { + IBMService +} + +// loadMongoDB ... +func (g DatabaseMongoGenerator) loadMongoDB(dbID string, dbName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + dbID, + dbName, + "ibm_database", + "ibm", + []string{}) + return resources +} + +//InitResources ... +func (g *DatabaseMongoGenerator) InitResources() error { + + region := os.Getenv("IC_REGION") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + Region: region, + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("databases-for-mongodb", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + mongoInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + for _, db := range mongoInstances { + if db.RegionID == region { + g.Resources = append(g.Resources, g.loadMongoDB(db.ID, db.Name)) + } + } + + return nil +} diff --git a/providers/ibm/database_postgresql.go b/providers/ibm/database_postgresql.go new file mode 100644 index 0000000000..df519241ed --- /dev/null +++ b/providers/ibm/database_postgresql.go @@ -0,0 +1,88 @@ +package ibm + +import ( + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// DatabasePostgresqlGenerator ... +type DatabasePostgresqlGenerator struct { + IBMService +} + +// loadPostgresqlDB ... +func (g DatabasePostgresqlGenerator) loadPostgresqlDB(dbID string, dbName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + dbID, + dbName, + "ibm_database", + "ibm", + []string{}) + log.Printf("Resources list %+v", resources) + return resources +} + +//InitResources ... +func (g *DatabasePostgresqlGenerator) InitResources() error { + region := os.Getenv("IC_REGION") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + Region: region, + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("databases-for-postgresql", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + postgreSQLInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + + for _, db := range postgreSQLInstances { + if db.RegionID == region { + g.Resources = append(g.Resources, g.loadPostgresqlDB(db.ID, db.Name)) + } + + } + + return nil +} diff --git a/providers/ibm/database_rabbitmq.go b/providers/ibm/database_rabbitmq.go new file mode 100644 index 0000000000..d5196bdb7f --- /dev/null +++ b/providers/ibm/database_rabbitmq.go @@ -0,0 +1,85 @@ +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// DatabaseRabbitMQGenerator ... +type DatabaseRabbitMQGenerator struct { + IBMService +} + +// loadRabbitMQDB ... +func (g DatabaseRabbitMQGenerator) loadRabbitMQDB(dbID string, dbName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + dbID, + dbName, + "ibm_database", + "ibm", + []string{}) + return resources +} + +//InitResources ... +func (g *DatabaseRabbitMQGenerator) InitResources() error { + + region := os.Getenv("IC_REGION") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + Region: region, + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("databases-for-rabbitmq", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + rabbitmqInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + for _, db := range rabbitmqInstances { + if db.RegionID == region { + g.Resources = append(g.Resources, g.loadRabbitMQDB(db.ID, db.Name)) + } + } + + return nil +} diff --git a/providers/ibm/database_redis.go b/providers/ibm/database_redis.go new file mode 100644 index 0000000000..360db9d2ba --- /dev/null +++ b/providers/ibm/database_redis.go @@ -0,0 +1,86 @@ +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// DatabaseGenerator ... +type DatabaseRedisGenerator struct { + IBMService +} + +// loadRedisDB ... +func (g DatabaseRedisGenerator) loadRedisDB(dbID string, dbName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + dbID, + dbName, + "ibm_database", + "ibm", + []string{}) + return resources +} + +//InitResources ... +func (g *DatabaseRedisGenerator) InitResources() error { + + region := os.Getenv("IC_REGION") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + Region: region, + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("databases-for-redis", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + redisInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + + for _, db := range redisInstances { + if db.RegionID == region { + g.Resources = append(g.Resources, g.loadRedisDB(db.ID, db.Name)) + } + } + + return nil +} diff --git a/providers/ibm/iam.go b/providers/ibm/iam.go new file mode 100644 index 0000000000..74b357d3a3 --- /dev/null +++ b/providers/ibm/iam.go @@ -0,0 +1,177 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + "strconv" + "time" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/iampap/iampapv1" + "github.com/IBM-Cloud/bluemix-go/api/iamuum/iamuumv2" + "github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +type IAMGenerator struct { + IBMService +} + +func (g IAMGenerator) loadUserPolicies(policyID string, user string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", user, policyID), + policyID, + "ibm_iam_user_policy", + "ibm", + []string{}) + return resources +} + +func (g IAMGenerator) loadAccessGroups(grpID, grpName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", grpID, grpName), + grpName, + "ibm_iam_access_group", + "ibm", + []string{}) + return resources +} + +func (g IAMGenerator) loadAccessGroupMembers(grpID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", grpID, time.Now().UTC().String()), + time.Now().UTC().String(), + "ibm_iam_access_group_members", + "ibm", + []string{}) + return resources +} + +func (g IAMGenerator) loadAccessGroupPolicies(grpID, policyID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", grpID, policyID), + policyID, + "ibm_iam_access_group_policy", + "ibm", + []string{}) + return resources +} + +func (g IAMGenerator) loadAccessGroupDynamicPolicies(grpID, ruleID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", grpID, ruleID), + ruleID, + "ibm_iam_access_group_dynamic_rule", + "ibm", + []string{}) + return resources +} + +func (g *IAMGenerator) InitResources() error { + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + userManagementAPI, err := usermanagementv2.New(sess) + if err != nil { + return err + } + err = authenticateAPIKey(sess) + if err != nil { + return err + } + generation := envFallBack([]string{"Generation"}, "2") + gen, err := strconv.Atoi(generation) + if err != nil { + return err + } + userInfo, err := fetchUserDetails(sess, gen) + if err != nil { + return err + } + accountID := userInfo.userAccount + + users, err := userManagementAPI.UserInvite().GetUsers(userInfo.userAccount) + if err != nil { + return err + } + iampap, err := iampapv1.New(sess) + if err != nil { + return err + } + + for _, u := range users.Resources { + policies, err := iampap.V1Policy().List(iampapv1.SearchParams{ + AccountID: accountID, + IAMID: u.IamID, + Type: iampapv1.AccessPolicyType, + }) + if err != nil { + return err + } + for _, p := range policies { + g.Resources = append(g.Resources, g.loadUserPolicies(p.ID, u.Email)) + } + + } + + iamuumClient, err := iamuumv2.New(sess) + if err != nil { + return err + } + + agrps, err := iamuumClient.AccessGroup().List(accountID) + if err != nil { + return err + } + for _, group := range agrps { + g.Resources = append(g.Resources, g.loadAccessGroups(group.ID, group.Name)) + g.Resources = append(g.Resources, g.loadAccessGroupMembers(group.ID)) + + policies, err := iampap.V1Policy().List(iampapv1.SearchParams{ + AccountID: accountID, + AccessGroupID: group.ID, + Type: iampapv1.AccessPolicyType, + }) + if err != nil { + return fmt.Errorf("Error retrieving access group policy: %s", err) + } + for _, p := range policies { + g.Resources = append(g.Resources, g.loadAccessGroupPolicies(group.ID, p.ID)) + } + + dynamicPolicies, err := iamuumClient.DynamicRule().List(group.ID) + if err != nil { + return err + } + for _, d := range dynamicPolicies { + g.Resources = append(g.Resources, g.loadAccessGroupDynamicPolicies(group.ID, d.RuleID)) + } + } + + return nil +} diff --git a/providers/ibm/ibm_is_instance.go b/providers/ibm/ibm_is_instance.go new file mode 100644 index 0000000000..704ee4f29a --- /dev/null +++ b/providers/ibm/ibm_is_instance.go @@ -0,0 +1,91 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +type InstanceGenerator struct { + IBMService +} + +func (g InstanceGenerator) createInstanceResources(instanceID, instanceName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + instanceID, + instanceName, + "ibm_is_instance", + "ibm", + []string{}) + return resources +} + +func (g *InstanceGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.Instance{} + for { + options := &vpcv1.ListInstancesOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + instances, response, err := vpcclient.ListInstances(options) + if err != nil { + return fmt.Errorf("Error Fetching Instances %s\n%s", err, response) + } + start = GetNext(instances.Next) + allrecs = append(allrecs, instances.Instances...) + if start == "" { + break + } + } + + for _, instance := range allrecs { + g.Resources = append(g.Resources, g.createInstanceResources(*instance.ID, *instance.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_security_group.go b/providers/ibm/ibm_is_security_group.go new file mode 100644 index 0000000000..61726bbf4f --- /dev/null +++ b/providers/ibm/ibm_is_security_group.go @@ -0,0 +1,131 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + "reflect" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +type SecurityGroupGenerator struct { + IBMService +} + +func (g SecurityGroupGenerator) createSecurityGroupResources(sgID, sgName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + sgID, + sgName, + "ibm_is_security_group", + "ibm", + []string{}) + return resources +} + +func (g SecurityGroupGenerator) createSecurityGroupRuleResources(sgID, sgRuleID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s.%s", sgID, sgRuleID), + sgRuleID, + "ibm_is_security_group_rule", + "ibm", + []string{}) + return resources +} + +func (g *SecurityGroupGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.SecurityGroup{} + for { + options := &vpcv1.ListSecurityGroupsOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + sgs, response, err := vpcclient.ListSecurityGroups(options) + if err != nil { + return fmt.Errorf("Error Fetching security Groups %s\n%s", err, response) + } + start = GetNext(sgs.Next) + allrecs = append(allrecs, sgs.SecurityGroups...) + if start == "" { + break + } + } + + for _, group := range allrecs { + g.Resources = append(g.Resources, g.createSecurityGroupResources(*group.ID, *group.Name)) + listSecurityGroupRulesOptions := &vpcv1.ListSecurityGroupRulesOptions{ + SecurityGroupID: group.ID, + } + rules, response, err := vpcclient.ListSecurityGroupRules(listSecurityGroupRulesOptions) + if err != nil { + return fmt.Errorf("Error Fetching security group rules %s\n%s", err, response) + } + for _, sgrule := range rules.Rules { + switch reflect.TypeOf(sgrule).String() { + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp": + { + rule := sgrule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp) + g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID)) + } + + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll": + { + rule := sgrule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll) + g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID)) + } + + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp": + { + rule := sgrule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID)) + } + } + } + } + return nil +} diff --git a/providers/ibm/ibm_is_subnet.go b/providers/ibm/ibm_is_subnet.go new file mode 100644 index 0000000000..a229bee6bc --- /dev/null +++ b/providers/ibm/ibm_is_subnet.go @@ -0,0 +1,92 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +type SubnetGenerator struct { + IBMService +} + +func (g SubnetGenerator) createSubnetResources(subnetID, subnetName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + subnetID, + subnetName, + "ibm_is_subnet", + "ibm", + []string{}) + return resources +} + +func (g *SubnetGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + + start := "" + allrecs := []vpcv1.Subnet{} + for { + options := &vpcv1.ListSubnetsOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + subnets, response, err := vpcclient.ListSubnets(options) + if err != nil { + return fmt.Errorf("Error Fetching subnets %s\n%s", err, response) + } + start = GetNext(subnets.Next) + allrecs = append(allrecs, subnets.Subnets...) + if start == "" { + break + } + } + + for _, subnet := range allrecs { + g.Resources = append(g.Resources, g.createSubnetResources(*subnet.ID, *subnet.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_vpc.go b/providers/ibm/ibm_is_vpc.go new file mode 100644 index 0000000000..9fd8a4095b --- /dev/null +++ b/providers/ibm/ibm_is_vpc.go @@ -0,0 +1,134 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +type VPCGenerator struct { + IBMService +} + +func (g VPCGenerator) createVPCResources(vpcID, vpcName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + vpcID, + vpcName, + "ibm_is_vpc", + "ibm", + []string{}) + return resources +} + +func (g VPCGenerator) createVPCAddressPrefixResources(vpcID, addPrefixID, addPrefixName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", vpcID, addPrefixID), + addPrefixName, + "ibm_is_vpc_address_prefix", + "ibm", + []string{}) + return resources +} + +func (g VPCGenerator) createVPCRouteResources(vpcID, routeID, routeName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", vpcID, routeID), + routeName, + "ibm_is_vpc_route", + "ibm", + []string{}) + return resources +} + +func (g *VPCGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.VPC{} + for { + listVpcsOptions := &vpcv1.ListVpcsOptions{} + if start != "" { + listVpcsOptions.Start = &start + } + if resoureGroup != "" { + listVpcsOptions.ResourceGroupID = &resoureGroup + } + vpcs, response, err := vpcclient.ListVpcs(listVpcsOptions) + if err != nil { + return fmt.Errorf("Error Fetching vpcs %s\n%s", err, response) + } + start = GetNext(vpcs.Next) + allrecs = append(allrecs, vpcs.Vpcs...) + if start == "" { + break + } + } + + for _, vpc := range allrecs { + g.Resources = append(g.Resources, g.createVPCResources(*vpc.ID, *vpc.Name)) + listVPCAddressPrefixesOptions := &vpcv1.ListVPCAddressPrefixesOptions{ + VPCID: vpc.ID, + } + addprefixes, response, err := vpcclient.ListVPCAddressPrefixes(listVPCAddressPrefixesOptions) + if err != nil { + return fmt.Errorf("Error Fetching vpc address prefixes %s\n%s", err, response) + } + for _, addprefix := range addprefixes.AddressPrefixes { + g.Resources = append(g.Resources, g.createVPCAddressPrefixResources(*vpc.ID, *addprefix.ID, *addprefix.Name)) + } + listVPCRoutesOptions := &vpcv1.ListVPCRoutesOptions{ + VPCID: vpc.ID, + } + routes, response, err := vpcclient.ListVPCRoutes(listVPCRoutesOptions) + if err != nil { + return fmt.Errorf("Error Fetching vpc routes %s\n%s", err, response) + } + for _, route := range routes.Routes { + g.Resources = append(g.Resources, g.createVPCRouteResources(*vpc.ID, *route.ID, *route.Name)) + } + + } + return nil +} diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go new file mode 100644 index 0000000000..07bbc022d9 --- /dev/null +++ b/providers/ibm/ibm_provider.go @@ -0,0 +1,90 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "errors" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" +) + +type IBMProvider struct { + terraformutils.Provider + ResourceGroup string +} + +func (p *IBMProvider) Init(args []string) error { + if args[0] != "" { + p.ResourceGroup = args[0] + } + return nil +} + +func (p *IBMProvider) GetName() string { + return "ibm" +} + +func (p *IBMProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{ + "provider": map[string]interface{}{ + "ibm": map[string]interface{}{ + "version": providerwrapper.GetProviderVersion(p.GetName()), + }, + }, + } +} + +func (IBMProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} + +func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "keyprotect": &KPGenerator{}, + "ibm_container_vpc_cluster": &VPCClusterGenerator{}, + "ibm_container_cluster": &ContainerClusterGenerator{}, + "ibm_cos": &COSGenerator{}, + "ibm_database_elasticsearch": &DatabaseElasticSearchGenerator{}, + "ibm_database_etcd": &DatabaseETCDGenerator{}, + "ibm_database_mongo": &DatabaseMongoGenerator{}, + "ibm_database_postgresql": &DatabasePostgresqlGenerator{}, + "ibm_database_rabbitmq": &DatabaseRabbitMQGenerator{}, + "ibm_database_redis": &DatabaseRedisGenerator{}, + "ibm_iam": &IAMGenerator{}, + "ibm_is_instance_group": &InstanceGroupGenerator{}, + "ibm_is_vpc": &VPCGenerator{}, + "ibm_is_subnet": &SubnetGenerator{}, + "ibm_is_instance": &InstanceGenerator{}, + "ibm_is_security_group": &SecurityGroupGenerator{}, + "ibm_cis": &CISGenerator{}, + } +} + +func (p *IBMProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New("IBM: " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + + p.Service.SetArgs(map[string]interface{}{ + "resource_group": p.ResourceGroup, + }) + return nil +} diff --git a/providers/ibm/ibm_service.go b/providers/ibm/ibm_service.go new file mode 100644 index 0000000000..a78f2603d2 --- /dev/null +++ b/providers/ibm/ibm_service.go @@ -0,0 +1,23 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type IBMService struct { + terraformutils.Service +} diff --git a/providers/ibm/instance_groups.go b/providers/ibm/instance_groups.go new file mode 100644 index 0000000000..773eb3451e --- /dev/null +++ b/providers/ibm/instance_groups.go @@ -0,0 +1,178 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "math/rand" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +type InstanceGroupGenerator struct { + IBMService + importDone chan bool + fatalErrors chan error +} + +func (g *InstanceGroupGenerator) loadInstanceGroup(instanceGroupID, instanceGroupName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + instanceGroupID, + instanceGroupName, + "ibm_is_instance_group", + "ibm", + []string{}) + return resources +} + +func (g *InstanceGroupGenerator) loadInstanceGroupManger(instanceGroupID, instanceGroupManagerID, managerName string) terraformutils.Resource { + if managerName == "" { + managerName = fmt.Sprintf("manager-%d-%d", rand.Intn(100), rand.Intn(50)) + } + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", instanceGroupID, instanceGroupManagerID), + managerName, + "ibm_is_instance_group_manager", + "ibm", + []string{}) + return resources +} + +func (g *InstanceGroupGenerator) loadInstanceGroupMangerPolicy(instanceGroupID, instanceGroupManagerID, PolicyID, policyName string) terraformutils.Resource { + if policyName == "" { + policyName = fmt.Sprintf("manager-%d-%d", rand.Intn(100), rand.Intn(50)) + } + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s/%s", instanceGroupID, instanceGroupManagerID, PolicyID), + policyName, + "ibm_is_instance_group_manager_policy", + "ibm", + []string{}) + return resources +} + +func (g *InstanceGroupGenerator) handlePolicies(sess *vpcv1.VpcV1, instanceGroupID, instanceGroupManagerID string, policies []string) { + for _, instanceGroupManagerPolicyID := range policies { + getInstanceGroupManagerPolicyOptions := vpcv1.GetInstanceGroupManagerPolicyOptions{ + ID: &instanceGroupManagerPolicyID, + InstanceGroupID: &instanceGroupID, + InstanceGroupManagerID: &instanceGroupManagerID, + } + data, response, err := sess.GetInstanceGroupManagerPolicy(&getInstanceGroupManagerPolicyOptions) + if err != nil { + g.fatalErrors <- fmt.Errorf("Error Getting InstanceGroup Manager Policy: %s\n%s", err, response) + } + instanceGroupManagerPolicy := data.(*vpcv1.InstanceGroupManagerPolicy) + g.Resources = append(g.Resources, g.loadInstanceGroupMangerPolicy(instanceGroupID, + instanceGroupManagerID, + instanceGroupManagerPolicyID, + *instanceGroupManagerPolicy.Name)) + } +} + +func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroupID string, managers []string) { + for _, instanceGroupManagerID := range managers { + getInstanceGroupManagerOptions := vpcv1.GetInstanceGroupManagerOptions{ + ID: &instanceGroupManagerID, + InstanceGroupID: &instanceGroupID, + } + instanceGroupManager, response, err := sess.GetInstanceGroupManager(&getInstanceGroupManagerOptions) + if err != nil { + g.fatalErrors <- fmt.Errorf("Error Getting InstanceGroup Manager: %s\n%s", err, response) + } + g.Resources = append(g.Resources, g.loadInstanceGroupManger(instanceGroupID, instanceGroupManagerID, *instanceGroupManager.Name)) + + policies := make([]string, 0) + + for i := 0; i < len(instanceGroupManager.Policies); i++ { + policies = append(policies, string(*(instanceGroupManager.Policies[i].ID))) + } + + go g.handlePolicies(sess, instanceGroupID, instanceGroupManagerID, policies) + } +} + +func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1) { + // Support for pagination + start := "" + allrecs := []vpcv1.InstanceGroup{} + for { + listInstanceGroupOptions := vpcv1.ListInstanceGroupsOptions{} + if start != "" { + listInstanceGroupOptions.Start = &start + } + instanceGroupsCollection, response, err := sess.ListInstanceGroups(&listInstanceGroupOptions) + if err != nil { + g.fatalErrors <- fmt.Errorf("Error Fetching InstanceGroups %s\n%s", err, response) + } + start = GetNext(instanceGroupsCollection.Next) + allrecs = append(allrecs, instanceGroupsCollection.InstanceGroups...) + if start == "" { + break + } + } + + for _, instanceGroup := range allrecs { + instanceGoupID := *instanceGroup.ID + g.Resources = append(g.Resources, g.loadInstanceGroup(instanceGoupID, *instanceGroup.Name)) + managers := make([]string, 0) + for i := 0; i < len(instanceGroup.Managers); i++ { + managers = append(managers, string(*(instanceGroup.Managers[i].ID))) + } + go g.handleManagers(sess, instanceGoupID, managers) + } + close(g.importDone) +} + +func (g *InstanceGroupGenerator) InitResources() error { + apiKey := os.Getenv("IBMCLOUD_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + // Instantiate the service with an API key based IAM authenticator + sess, err := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{ + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + }) + if err != nil { + log.Fatal("Error creating VPC Service.") + return err + } + + g.importDone = make(chan bool) + g.fatalErrors = make(chan error) + + go g.handleInstanceGroups(sess) + + select { + case <-g.importDone: + log.Println("Done Importing") + break + case err := <-g.fatalErrors: + close(g.fatalErrors) + log.Fatal("Error: ", err) + return err + } + return nil +} diff --git a/providers/ibm/kp.go b/providers/ibm/kp.go new file mode 100644 index 0000000000..de66858a15 --- /dev/null +++ b/providers/ibm/kp.go @@ -0,0 +1,64 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "context" + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + kp "github.com/IBM/keyprotect-go-client" +) + +type KPGenerator struct { + IBMService +} + +func (g KPGenerator) createResources(keysList []kp.Key) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, key := range keysList { + resources = append(resources, terraformutils.NewSimpleResource( + key.CRN, + key.ID, + "ibm_kp_key", + "ibm", + []string{})) + } + return resources +} + +func (g *KPGenerator) InitResources() error { + region := envFallBack([]string{"IC_REGION"}, "us-south") + kpurl := fmt.Sprintf("https://%s.kms.cloud.ibm.com", region) + options := kp.ClientConfig{ + BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kpurl), + APIKey: os.Getenv("IC_API_KEY"), + Verbose: kp.VerboseFailOnly, + } + + client, err := kp.New(options, kp.DefaultTransport()) + if err != nil { + return err + } + client.Config.InstanceID = "e63cc5b3-2594-4e13-b1b1-e8263095ff4b" + + output, err := client.GetKeys(context.Background(), 100, 0) + if err != nil { + return err + } + g.Resources = g.createResources(output.Keys) + return nil +} diff --git a/providers/ibm/utils.go b/providers/ibm/utils.go new file mode 100644 index 0000000000..100fe487e6 --- /dev/null +++ b/providers/ibm/utils.go @@ -0,0 +1,111 @@ +package ibm + +import ( + gohttp "net/http" + "net/url" + "os" + "reflect" + "strings" + + "github.com/IBM-Cloud/bluemix-go/authentication" + "github.com/IBM-Cloud/bluemix-go/http" + "github.com/IBM-Cloud/bluemix-go/rest" + "github.com/IBM-Cloud/bluemix-go/session" + "github.com/dgrijalva/jwt-go" +) + +//UserConfig ... +type UserConfig struct { + userID string + userEmail string + userAccount string + cloudName string `default:"bluemix"` + cloudType string `default:"public"` + generation int `default:"2"` +} + +//EnvFallBack ... +func envFallBack(envs []string, defaultValue string) string { + for _, k := range envs { + if v := os.Getenv(k); v != "" { + return v + } + } + return defaultValue +} + +func fetchUserDetails(sess *session.Session, generation int) (*UserConfig, error) { + config := sess.Config + user := UserConfig{} + var bluemixToken string + + if strings.HasPrefix(config.IAMAccessToken, "Bearer") { + bluemixToken = config.IAMAccessToken[7:len(config.IAMAccessToken)] + } else { + bluemixToken = config.IAMAccessToken + } + + token, err := jwt.Parse(bluemixToken, func(token *jwt.Token) (interface{}, error) { + return "", nil + }) + //TODO validate with key + if err != nil && !strings.Contains(err.Error(), "key is of invalid type") { + return &user, err + } + claims := token.Claims.(jwt.MapClaims) + if email, ok := claims["email"]; ok { + user.userEmail = email.(string) + } + user.userID = claims["id"].(string) + user.userAccount = claims["account"].(map[string]interface{})["bss"].(string) + iss := claims["iss"].(string) + if strings.Contains(iss, "https://iam.cloud.ibm.com") { + user.cloudName = "bluemix" + } else { + user.cloudName = "staging" + } + user.cloudType = "public" + + user.generation = generation + return &user, nil +} + +func authenticateAPIKey(sess *session.Session) error { + config := sess.Config + tokenRefresher, err := authentication.NewIAMAuthRepository(config, &rest.Client{ + DefaultHeader: gohttp.Header{ + "User-Agent": []string{http.UserAgent()}, + }, + }) + if err != nil { + return err + } + return tokenRefresher.AuthenticateAPIKey(config.BluemixAPIKey) +} + +func authenticateCF(sess *session.Session) error { + config := sess.Config + tokenRefresher, err := authentication.NewUAARepository(config, &rest.Client{ + DefaultHeader: gohttp.Header{ + "User-Agent": []string{http.UserAgent()}, + }, + }) + if err != nil { + return err + } + return tokenRefresher.AuthenticateAPIKey(config.BluemixAPIKey) +} + +func GetNext(next interface{}) string { + if reflect.ValueOf(next).IsNil() { + return "" + } + + u, err := url.Parse(reflect.ValueOf(next).Elem().FieldByName("Href").Elem().String()) + if err != nil { + return "" + } + + q := u.Query() + return q.Get("start") +} diff --git a/providers/ibm/vpc_cluster.go b/providers/ibm/vpc_cluster.go new file mode 100644 index 0000000000..1014abe599 --- /dev/null +++ b/providers/ibm/vpc_cluster.go @@ -0,0 +1,86 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +type VPCClusterGenerator struct { + IBMService +} + +func (g VPCClusterGenerator) loadcluster(clustersID, clusterName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + clustersID, + clusterName, + "ibm_container_vpc_cluster", + "ibm", + []string{}) + return resources +} + +func (g VPCClusterGenerator) loadWorkerPools(clustersID, poolID, PoolName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", clustersID, poolID), + PoolName, + "ibm_container_vpc_worker_pool", + "ibm", + []string{}) + return resources +} + +func (g *VPCClusterGenerator) InitResources() error { + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + client, err := containerv2.New(sess) + if err != nil { + return err + } + + clusters, err := client.Clusters().List(containerv2.ClusterTargetHeader{}) + if err != nil { + return err + } + + for _, cs := range clusters { + g.Resources = append(g.Resources, g.loadcluster(cs.ID, cs.Name)) + workerPools, err := client.WorkerPools().ListWorkerPools(cs.ID, containerv2.ClusterTargetHeader{}) + if err != nil { + return err + } + + for _, pool := range workerPools { + if pool.PoolName != "default" { + g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, pool.PoolName)) + } + } + + } + return nil +} From 6d83b5266da3eef12e7a53ac6e59edc009bb88a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Dec 2020 07:21:56 +0000 Subject: [PATCH 003/276] Bump google.golang.org/api from 0.35.0 to 0.36.0 Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.35.0 to 0.36.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/master/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.35.0...v0.36.0) Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 198d120390..bd1a3ec070 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/GoogleCloudPlatform/terraformer go 1.15 require ( - cloud.google.com/go v0.71.0 + cloud.google.com/go v0.72.0 cloud.google.com/go/logging v1.1.2 cloud.google.com/go/storage v1.12.0 github.com/Azure/azure-sdk-for-go v42.0.0+incompatible @@ -47,11 +47,11 @@ require ( github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 github.com/zclconf/go-cty v1.7.0 github.com/zorkian/go-datadog-api v2.30.0+incompatible - golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 + golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 golang.org/x/text v0.3.4 gonum.org/v1/gonum v0.7.0 - google.golang.org/api v0.35.0 - google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba + google.golang.org/api v0.36.0 + google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect k8s.io/apimachinery v0.17.5 k8s.io/client-go v0.17.5 diff --git a/go.sum b/go.sum index 4ec2dfc31e..feb50ae17c 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,8 @@ cloud.google.com/go v0.66.0 h1:DZeAkuQGQqnm9Xv36SbMJEU8aFBz4wL04UpMWPWwjzg= cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go v0.71.0 h1:2ha722Z08cmRa0orJrzBaszYQcLbLFcsZHsGSj/kIF4= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= +cloud.google.com/go v0.72.0 h1:eWRCuwubtDrCJG0oSUMgnsbD4CmPFQF2ei4OFbXvwww= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= @@ -337,6 +339,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github/v25 v25.1.3 h1:Ht4YIQgUh4l4lc80fvGnw60khXysXvlgPxPP8uJG3EA= github.com/google/go-github/v25 v25.1.3/go.mod h1:6z5pC69qHtrPJ0sXPsj4BLnd82b+r6sLB7qcBoRZqpw= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -883,6 +887,8 @@ golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BG golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 h1:Mj83v+wSRNEar42a/MQgxk9X42TdEmrOl9i+y8WbxLo= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -944,6 +950,8 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadL golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1021,6 +1029,9 @@ golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4X golang.org/x/tools v0.0.0-20201030143252-cf7a54d06671/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201105220310-78b158585360 h1:/9CzsU8hOpnSUCtem1vfWNgsVeCTgkMdx+VE5YIYxnU= golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfSSmC/Hx/fGAQJUAQaM2gc= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -1057,6 +1068,8 @@ google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.35.0 h1:TBCmTTxUrRDA1iTctnK/fIeitxIZ+TQuaf0j29fmCGo= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0 h1:l2Nfbl2GPXdWorv+dT2XfinX2jOOw4zv1VhLstx+6rE= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1065,6 +1078,8 @@ google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpC google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1105,6 +1120,9 @@ google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba h1:HocWKLuilwaaLY56cHV38rw84wJ1nscA0Rs7OnO8mm8= google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e h1:wYR00/Ht+i/79g/gzhdehBgLIJCklKoc8Q/NebdzzpY= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= From af10096313551284624dca3607f7208ae510de1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Dec 2020 08:39:26 +0000 Subject: [PATCH 004/276] Bump cloud.google.com/go from 0.71.0 to 0.73.0 Bumps [cloud.google.com/go](https://github.com/googleapis/google-cloud-go) from 0.71.0 to 0.73.0. - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/master/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/v0.71.0...v0.73.0) Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index bd1a3ec070..8ae6c652b5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/GoogleCloudPlatform/terraformer go 1.15 require ( - cloud.google.com/go v0.72.0 + cloud.google.com/go v0.73.0 cloud.google.com/go/logging v1.1.2 cloud.google.com/go/storage v1.12.0 github.com/Azure/azure-sdk-for-go v42.0.0+incompatible @@ -51,7 +51,7 @@ require ( golang.org/x/text v0.3.4 gonum.org/v1/gonum v0.7.0 google.golang.org/api v0.36.0 - google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e + google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497 gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect k8s.io/apimachinery v0.17.5 k8s.io/client-go v0.17.5 diff --git a/go.sum b/go.sum index feb50ae17c..0ee0084efb 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,8 @@ cloud.google.com/go v0.71.0 h1:2ha722Z08cmRa0orJrzBaszYQcLbLFcsZHsGSj/kIF4= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= cloud.google.com/go v0.72.0 h1:eWRCuwubtDrCJG0oSUMgnsbD4CmPFQF2ei4OFbXvwww= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.73.0 h1:sGvc4e0Cmm4+DKQR76a9VwNukpacQK8TOl5pDl0Pcn0= +cloud.google.com/go v0.73.0/go.mod h1:BkDh9dFvGjCitVw03TNjKbBxXNKULXXIq6orU6HrJ4Q= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= @@ -365,6 +367,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201117184057-ae444373da19/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -833,6 +836,8 @@ golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -879,6 +884,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1032,6 +1039,8 @@ golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfSSmC/Hx/fGAQJUAQaM2gc= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201202200335-bef1c476418a h1:TYqOq/v+Ri5aADpldxXOj6PmvcPMOJbLjdALzZDQT2M= +golang.org/x/tools v0.0.0-20201202200335-bef1c476418a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -1123,6 +1132,8 @@ google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e h1:wYR00/Ht+i/79g/gzhdehBgLIJCklKoc8Q/NebdzzpY= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497 h1:jDYzwXmX9tLnuG4sL85HPmE1ruErXOopALp2i/0AHnI= +google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= From a32378c3869e3157666676d272614a35742c09e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Dec 2020 09:02:57 +0000 Subject: [PATCH 005/276] Bump k8s.io/client-go from 0.17.5 to 0.19.4 Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.17.5 to 0.19.4. - [Release notes](https://github.com/kubernetes/client-go/releases) - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.17.5...v0.19.4) Signed-off-by: dependabot[bot] --- go.mod | 5 ++-- go.sum | 74 ++++++++++++++++++++++++++++------------------------------ 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index 8ae6c652b5..9074f211b0 100644 --- a/go.mod +++ b/go.mod @@ -53,9 +53,8 @@ require ( google.golang.org/api v0.36.0 google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497 gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect - k8s.io/apimachinery v0.17.5 - k8s.io/client-go v0.17.5 - k8s.io/utils v0.0.0-20191218082557-f07c713de883 // indirect + k8s.io/apimachinery v0.19.4 + k8s.io/client-go v0.19.4 ) replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5 diff --git a/go.sum b/go.sum index 0ee0084efb..a09a0cbef9 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,7 @@ cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxK cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -63,10 +64,12 @@ github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest v0.11.12 h1:gI8ytXbxMfI+IVbI9mP2JGCTXIuhHLgRlvQ9X4PsnHE= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.8.3 h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw= github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= @@ -223,17 +226,18 @@ github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s9 github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 h1:Od9CDqwkw5F3vjN8Lp8CQhkMOEjC70eTW+AJlTepE6g= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884/go.mod h1:SB2lZXXkyipTEoPLxR3A5YglkZ7QwoXSsyI9h6yUeFc= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fastly/go-fastly v1.15.0 h1:t7f0ZnQy0rKYN8FCql4wHkfZNHajxDs1hT/phazOpp8= github.com/fastly/go-fastly v1.15.0/go.mod h1:jILbTQnU/K/7XHQNzQWd1O7hbXIcp6dKrxfRWqU6xfk= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= @@ -247,6 +251,7 @@ github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/ github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -261,6 +266,8 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= @@ -284,14 +291,11 @@ github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -307,7 +311,6 @@ github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -350,6 +353,8 @@ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASu github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/jsonapi v0.0.0-20170708005851-46d3ced04344 h1:G5TmuUtIYeR0scfa8ZQ06cfHeAAfVeFlIG8TVOCfuAA= github.com/google/jsonapi v0.0.0-20170708005851-46d3ced04344/go.mod h1:XSx4m2SziAqk9DXY9nz659easTq4q6TyrpYd9tHSm0g= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= @@ -378,10 +383,9 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gophercloud/gophercloud v0.13.0 h1:1XkslZZRm6Ks0bLup+hBNth+KQf+0JA1UeoB7YKw9E8= github.com/gophercloud/gophercloud v0.13.0/go.mod h1:VX0Ibx85B60B5XOrZr6kaNwrmPUzcmMpwxvQ1WQIIWM= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= @@ -499,8 +503,8 @@ github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7/go.mod h1:t4Tr0tn92 github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -521,6 +525,7 @@ github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91/go.mod h1:C2tFh8w3I6i4 github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -624,7 +629,7 @@ github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FW github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -779,7 +784,6 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -790,8 +794,6 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= @@ -838,7 +840,6 @@ golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -860,7 +861,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -908,7 +908,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -917,7 +916,6 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -930,8 +928,8 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -951,6 +949,7 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= @@ -959,7 +958,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1214,26 +1212,26 @@ honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.17.5 h1:EkVieIbn1sC8YCDwckLKLpf+LoVofXYW72+LTZWo4aQ= -k8s.io/api v0.17.5/go.mod h1:0zV5/ungglgy2Rlm3QK8fbxkXVs+BSJWpJP/+8gUVLY= -k8s.io/apimachinery v0.17.5 h1:QAjfgeTtSGksdkgyaPrIb4lhU16FWMIzxKejYD5S0gc= -k8s.io/apimachinery v0.17.5/go.mod h1:ioIo1G/a+uONV7Tv+ZmCbMG1/a3kVw5YcDdncd8ugQ0= -k8s.io/client-go v0.17.5 h1:Sm/9AQ415xPAX42JLKbJZnreXFgD2rVfDUDwOTm0gzA= -k8s.io/client-go v0.17.5/go.mod h1:S8uZpBpjJJdEH/fEyxcqg7Rn0P5jH+ilkgBHjriSmNo= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20200316234421-82d701f24f9d/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20191218082557-f07c713de883 h1:TA8t8OLS8m3/0dtTckekO0pCQ7qMnD19fsZTQEgCSKQ= -k8s.io/utils v0.0.0-20191218082557-f07c713de883/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/api v0.19.4 h1:I+1I4cgJYuCDgiLNjKx7SLmIbwgj9w7N7Zr5vSIdwpo= +k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk= +k8s.io/apimachinery v0.19.4 h1:+ZoddM7nbzrDCp0T3SWnyxqf8cbWPT2fkZImoyvHUG0= +k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/client-go v0.19.4 h1:85D3mDNoLF+xqpyE9Dh/OtrJDyJrSRKkHmDXIbEzer8= +k8s.io/client-go v0.19.4/go.mod h1:ZrEy7+wj9PjH5VMBCuu/BDlvtUAku0oVFk4MmnW9mWA= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From b24cf47921ccb892c13e2cd315f69b247f7595d1 Mon Sep 17 00:00:00 2001 From: Anil Kumar Nagaraj Date: Mon, 7 Dec 2020 18:20:13 +0530 Subject: [PATCH 006/276] Fixed review comments --- README.md | 29 +++--- providers/ibm/cos.go | 6 +- providers/ibm/database_elasticsearch.go | 24 ++--- providers/ibm/database_etcd.go | 24 ++--- providers/ibm/database_mongo.go | 24 ++--- providers/ibm/database_postgresql.go | 26 +++--- providers/ibm/database_rabbitmq.go | 24 ++--- providers/ibm/database_redis.go | 26 +++--- providers/ibm/iam.go | 5 +- providers/ibm/ibm_is_instance.go | 3 +- providers/ibm/ibm_is_security_group.go | 3 +- providers/ibm/ibm_is_subnet.go | 3 +- providers/ibm/ibm_is_vpc.go | 3 +- providers/ibm/ibm_kp.go | 113 ++++++++++++++++++++++++ providers/ibm/ibm_provider.go | 7 +- providers/ibm/instance_groups.go | 38 ++++---- providers/ibm/kp.go | 64 -------------- providers/ibm/utils.go | 14 +++ 18 files changed, 246 insertions(+), 190 deletions(-) create mode 100644 providers/ibm/ibm_kp.go delete mode 100644 providers/ibm/kp.go diff --git a/README.md b/README.md index a6dc411705..7691b084c2 100644 --- a/README.md +++ b/README.md @@ -864,21 +864,8 @@ List of supported AliCloud resources: If you want to run Terraformer with the IBM Cloud provider plugin on your system, complete the following steps: -1. [Download the IBM Cloud provider plugin for Terraform](https://github.com/IBM-Bluemix/terraform-provider-ibm/releases). -2. Unzip the release archive to extract the plugin binary(`terraform-provider-ibm_vX.Y.Z`). - -3. Move the binary into the Terraform [plugins directory](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins) for the platform. - - Linux/Unix/OS X: `~/.terraform.d/plugins/` e.g `~/.terraform.d/plugins/darwin_amd64` - - Windows: `%APPDATA%\terraform.d\plugins\` - -4. [Download the Terraformer](https://github.ibm.com/blueprint/terraformer/releases). - -5. chmod +x terraformer-all--${OS}--${ARCH} - -6. sudo mv terraformer-all--${OS}--${ARCH} /usr/local/bin/terraformer - -7. Export IBM Cloud API key as environment variables. +1. Export IBM Cloud API key as environment variables. Example: ``` @@ -886,7 +873,7 @@ If you want to run Terraformer with the IBM Cloud provider plugin on your system export IC_REGION= terraformer import ibm -r ibm_cos,ibm_iam.... ``` -8. Use flag for Resource Group to classify resources accordingly. +2. Use flag for Resource Group to classify resources accordingly. Example: ``` @@ -896,6 +883,9 @@ If you want to run Terraformer with the IBM Cloud provider plugin on your system ``` List of supported IBM Cloud resources: +* `ibm_kp` + * `ibm_resource_instance` + * `ibm_kms_key` * `ibm_cos` * `ibm_resource_instance` * `ibm_cos_bucket` @@ -930,6 +920,15 @@ List of supported IBM Cloud resources: * `ibm_is_instance` * `ibm_is_security_group` * `ibm_is_security_group_rule` +* `ibm_cis` + * `ibm_cis` + * `ibm_cis_dns_record` + * `ibm_cis_firewall` + * `ibm_cis_domain_settings` + * `ibm_cis_global_load_balancer` + * `ibm_cis_origin_pool` + * `ibm_cis_healthcheck` + * `ibm_cis_rate_limit` ### Use with DigitalOcean diff --git a/providers/ibm/cos.go b/providers/ibm/cos.go index ee673cb528..3b7b6c19ea 100644 --- a/providers/ibm/cos.go +++ b/providers/ibm/cos.go @@ -94,12 +94,12 @@ func (g *COSGenerator) InitResources() error { s3Conf := ibmaws.NewConfig().WithCredentials(ibmiam.NewStaticCredentials(ibmaws.NewConfig(), authEndpoint, os.Getenv("IC_API_KEY"), cs.ID)).WithS3ForcePathStyle(true).WithEndpoint("s3.us-south.cloud-object-storage.appdomain.cloud") s3Sess := cossession.Must(cossession.NewSession()) s3Client := coss3.New(s3Sess, s3Conf) + singleSiteLocationRegex, _ := regexp.Compile("^[a-z]{3}[0-9][0-9]-[a-z]{4,8}$") + regionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{2,5}-[a-z]{4,8}$") + crossRegionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{4,8}$") d, _ := s3Client.ListBucketsExtended(&coss3.ListBucketsExtendedInput{}) for _, b := range d.Buckets { var apiType, location string - singleSiteLocationRegex, _ := regexp.Compile("^[a-z]{3}[0-9][0-9]-[a-z]{4,8}$") - regionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{2,5}-[a-z]{4,8}$") - crossRegionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{4,8}$") bLocationConstraint := *b.LocationConstraint if singleSiteLocationRegex.MatchString(bLocationConstraint) { apiType = "ss1" diff --git a/providers/ibm/database_elasticsearch.go b/providers/ibm/database_elasticsearch.go index 8e7c0eb3c8..6ab5f87ed3 100644 --- a/providers/ibm/database_elasticsearch.go +++ b/providers/ibm/database_elasticsearch.go @@ -1,15 +1,3 @@ -package ibm - -import ( - "os" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/session" -) - // Copyright 2019 The Terraformer Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +12,18 @@ import ( // See the License for the specific language governing permissions and // limitations under the License. +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + // DatabaseElasticSearchGenerator ... type DatabaseElasticSearchGenerator struct { IBMService diff --git a/providers/ibm/database_etcd.go b/providers/ibm/database_etcd.go index 6477e3e76f..23885c11d3 100644 --- a/providers/ibm/database_etcd.go +++ b/providers/ibm/database_etcd.go @@ -1,15 +1,3 @@ -package ibm - -import ( - "os" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/session" -) - // Copyright 2019 The Terraformer Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +12,18 @@ import ( // See the License for the specific language governing permissions and // limitations under the License. +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + // DatabaseETCDGenerator ... type DatabaseETCDGenerator struct { IBMService diff --git a/providers/ibm/database_mongo.go b/providers/ibm/database_mongo.go index dc48dff2e2..65a8d67434 100644 --- a/providers/ibm/database_mongo.go +++ b/providers/ibm/database_mongo.go @@ -1,15 +1,3 @@ -package ibm - -import ( - "os" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/session" -) - // Copyright 2019 The Terraformer Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +12,18 @@ import ( // See the License for the specific language governing permissions and // limitations under the License. +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + // DatabaseMongoGenerator ... type DatabaseMongoGenerator struct { IBMService diff --git a/providers/ibm/database_postgresql.go b/providers/ibm/database_postgresql.go index df519241ed..fff1aa29c4 100644 --- a/providers/ibm/database_postgresql.go +++ b/providers/ibm/database_postgresql.go @@ -1,16 +1,3 @@ -package ibm - -import ( - "log" - "os" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/session" -) - // Copyright 2019 The Terraformer Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,6 +12,18 @@ import ( // See the License for the specific language governing permissions and // limitations under the License. +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + // DatabasePostgresqlGenerator ... type DatabasePostgresqlGenerator struct { IBMService @@ -39,7 +38,6 @@ func (g DatabasePostgresqlGenerator) loadPostgresqlDB(dbID string, dbName string "ibm_database", "ibm", []string{}) - log.Printf("Resources list %+v", resources) return resources } diff --git a/providers/ibm/database_rabbitmq.go b/providers/ibm/database_rabbitmq.go index d5196bdb7f..97c5f3fd9f 100644 --- a/providers/ibm/database_rabbitmq.go +++ b/providers/ibm/database_rabbitmq.go @@ -1,15 +1,3 @@ -package ibm - -import ( - "os" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/session" -) - // Copyright 2019 The Terraformer Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +12,18 @@ import ( // See the License for the specific language governing permissions and // limitations under the License. +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + // DatabaseRabbitMQGenerator ... type DatabaseRabbitMQGenerator struct { IBMService diff --git a/providers/ibm/database_redis.go b/providers/ibm/database_redis.go index 360db9d2ba..c1b87fab2b 100644 --- a/providers/ibm/database_redis.go +++ b/providers/ibm/database_redis.go @@ -1,15 +1,3 @@ -package ibm - -import ( - "os" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/session" -) - // Copyright 2019 The Terraformer Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,7 +12,19 @@ import ( // See the License for the specific language governing permissions and // limitations under the License. -// DatabaseGenerator ... +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +//DatabaseRedisGenerator ... type DatabaseRedisGenerator struct { IBMService } diff --git a/providers/ibm/iam.go b/providers/ibm/iam.go index 74b357d3a3..fe1862adb8 100644 --- a/providers/ibm/iam.go +++ b/providers/ibm/iam.go @@ -18,7 +18,6 @@ import ( "fmt" "os" "strconv" - "time" "github.com/GoogleCloudPlatform/terraformer/terraformutils" bluemix "github.com/IBM-Cloud/bluemix-go" @@ -57,8 +56,8 @@ func (g IAMGenerator) loadAccessGroups(grpID, grpName string) terraformutils.Res func (g IAMGenerator) loadAccessGroupMembers(grpID string) terraformutils.Resource { var resources terraformutils.Resource resources = terraformutils.NewSimpleResource( - fmt.Sprintf("%s/%s", grpID, time.Now().UTC().String()), - time.Now().UTC().String(), + fmt.Sprintf("%s/%s", grpID, grpID), + grpID, "ibm_iam_access_group_members", "ibm", []string{}) diff --git a/providers/ibm/ibm_is_instance.go b/providers/ibm/ibm_is_instance.go index 704ee4f29a..141cd5a7cb 100644 --- a/providers/ibm/ibm_is_instance.go +++ b/providers/ibm/ibm_is_instance.go @@ -16,7 +16,6 @@ package ibm import ( "fmt" - "log" "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -44,7 +43,7 @@ func (g *InstanceGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - log.Fatal("No API key set") + return fmt.Errorf("No API key set") } rg := g.Args["resource_group"] diff --git a/providers/ibm/ibm_is_security_group.go b/providers/ibm/ibm_is_security_group.go index 61726bbf4f..dbd0247f13 100644 --- a/providers/ibm/ibm_is_security_group.go +++ b/providers/ibm/ibm_is_security_group.go @@ -16,7 +16,6 @@ package ibm import ( "fmt" - "log" "os" "reflect" @@ -56,7 +55,7 @@ func (g *SecurityGroupGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - log.Fatal("No API key set") + return fmt.Errorf("No API key set") } rg := g.Args["resource_group"] diff --git a/providers/ibm/ibm_is_subnet.go b/providers/ibm/ibm_is_subnet.go index a229bee6bc..8a0deafc0b 100644 --- a/providers/ibm/ibm_is_subnet.go +++ b/providers/ibm/ibm_is_subnet.go @@ -16,7 +16,6 @@ package ibm import ( "fmt" - "log" "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -44,7 +43,7 @@ func (g *SubnetGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - log.Fatal("No API key set") + return fmt.Errorf("No API key set") } rg := g.Args["resource_group"] diff --git a/providers/ibm/ibm_is_vpc.go b/providers/ibm/ibm_is_vpc.go index 9fd8a4095b..df1bb8bf02 100644 --- a/providers/ibm/ibm_is_vpc.go +++ b/providers/ibm/ibm_is_vpc.go @@ -16,7 +16,6 @@ package ibm import ( "fmt" - "log" "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -66,7 +65,7 @@ func (g *VPCGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - log.Fatal("No API key set") + return fmt.Errorf("No API key set") } rg := g.Args["resource_group"] diff --git a/providers/ibm/ibm_kp.go b/providers/ibm/ibm_kp.go new file mode 100644 index 0000000000..a621707652 --- /dev/null +++ b/providers/ibm/ibm_kp.go @@ -0,0 +1,113 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "context" + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" + kp "github.com/IBM/keyprotect-go-client" +) + +type KPGenerator struct { + IBMService +} + +func (g KPGenerator) loadKP(kpID, kpName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + kpID, + kpID, + "ibm_resource_instance", + "ibm", + []string{}) + return resources +} + +func (g KPGenerator) loadkPKeys(kpKeyCRN, kpKeyID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + kpKeyCRN, + kpKeyID, + "ibm_kms_key", + "ibm", + []string{}) + return resources +} + +func (g *KPGenerator) InitResources() error { + region := envFallBack([]string{"IC_REGION"}, "us-south") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("kms", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + kpInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + kpurl := fmt.Sprintf("https://%s.kms.cloud.ibm.com", region) + options := kp.ClientConfig{ + BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kpurl), + APIKey: os.Getenv("IC_API_KEY"), + Verbose: kp.VerboseFailOnly, + } + + client, err := kp.New(options, kp.DefaultTransport()) + if err != nil { + return err + } + for _, kp := range kpInstances { + g.Resources = append(g.Resources, g.loadKP(kp.ID, kp.Name)) + client.Config.InstanceID = kp.Guid + + output, err := client.GetKeys(context.Background(), 100, 0) + if err != nil { + return err + } + for _, key := range output.Keys { + g.Resources = append(g.Resources, g.loadkPKeys(key.CRN, key.ID)) + } + + } + + return nil +} diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index 07bbc022d9..60029eeaa7 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -18,7 +18,6 @@ import ( "errors" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" ) type IBMProvider struct { @@ -40,9 +39,7 @@ func (p *IBMProvider) GetName() string { func (p *IBMProvider) GetProviderData(arg ...string) map[string]interface{} { return map[string]interface{}{ "provider": map[string]interface{}{ - "ibm": map[string]interface{}{ - "version": providerwrapper.GetProviderVersion(p.GetName()), - }, + "ibm": map[string]interface{}{}, }, } } @@ -53,7 +50,7 @@ func (IBMProvider) GetResourceConnections() map[string]map[string][]string { func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "keyprotect": &KPGenerator{}, + "ibm_kp": &KPGenerator{}, "ibm_container_vpc_cluster": &VPCClusterGenerator{}, "ibm_container_cluster": &ContainerClusterGenerator{}, "ibm_cos": &COSGenerator{}, diff --git a/providers/ibm/instance_groups.go b/providers/ibm/instance_groups.go index 773eb3451e..0d32b75f6f 100644 --- a/providers/ibm/instance_groups.go +++ b/providers/ibm/instance_groups.go @@ -16,9 +16,9 @@ package ibm import ( "fmt" - "log" "math/rand" "os" + "sync" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/IBM/go-sdk-core/v4/core" @@ -27,7 +27,6 @@ import ( type InstanceGroupGenerator struct { IBMService - importDone chan bool fatalErrors chan error } @@ -70,7 +69,8 @@ func (g *InstanceGroupGenerator) loadInstanceGroupMangerPolicy(instanceGroupID, return resources } -func (g *InstanceGroupGenerator) handlePolicies(sess *vpcv1.VpcV1, instanceGroupID, instanceGroupManagerID string, policies []string) { +func (g *InstanceGroupGenerator) handlePolicies(sess *vpcv1.VpcV1, instanceGroupID, instanceGroupManagerID string, policies []string, waitGroup *sync.WaitGroup) { + defer waitGroup.Done() for _, instanceGroupManagerPolicyID := range policies { getInstanceGroupManagerPolicyOptions := vpcv1.GetInstanceGroupManagerPolicyOptions{ ID: &instanceGroupManagerPolicyID, @@ -89,7 +89,9 @@ func (g *InstanceGroupGenerator) handlePolicies(sess *vpcv1.VpcV1, instanceGroup } } -func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroupID string, managers []string) { +func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroupID string, managers []string, waitGroup *sync.WaitGroup) { + defer waitGroup.Done() + var policiesWG sync.WaitGroup for _, instanceGroupManagerID := range managers { getInstanceGroupManagerOptions := vpcv1.GetInstanceGroupManagerOptions{ ID: &instanceGroupManagerID, @@ -106,13 +108,15 @@ func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroup for i := 0; i < len(instanceGroupManager.Policies); i++ { policies = append(policies, string(*(instanceGroupManager.Policies[i].ID))) } - - go g.handlePolicies(sess, instanceGroupID, instanceGroupManagerID, policies) + policiesWG.Add(1) + go g.handlePolicies(sess, instanceGroupID, instanceGroupManagerID, policies, &policiesWG) } + policiesWG.Wait() } -func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1) { +func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1, waitGroup *sync.WaitGroup) { // Support for pagination + defer waitGroup.Done() start := "" allrecs := []vpcv1.InstanceGroup{} for { @@ -131,6 +135,8 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1) { } } + var managersWG sync.WaitGroup + for _, instanceGroup := range allrecs { instanceGoupID := *instanceGroup.ID g.Resources = append(g.Resources, g.loadInstanceGroup(instanceGoupID, *instanceGroup.Name)) @@ -138,15 +144,16 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1) { for i := 0; i < len(instanceGroup.Managers); i++ { managers = append(managers, string(*(instanceGroup.Managers[i].ID))) } - go g.handleManagers(sess, instanceGoupID, managers) + managersWG.Add(1) + go g.handleManagers(sess, instanceGoupID, managers, &managersWG) } - close(g.importDone) + managersWG.Wait() } func (g *InstanceGroupGenerator) InitResources() error { apiKey := os.Getenv("IBMCLOUD_API_KEY") if apiKey == "" { - log.Fatal("No API key set") + return fmt.Errorf("No API key set") } // Instantiate the service with an API key based IAM authenticator @@ -156,23 +163,20 @@ func (g *InstanceGroupGenerator) InitResources() error { }, }) if err != nil { - log.Fatal("Error creating VPC Service.") return err } - g.importDone = make(chan bool) g.fatalErrors = make(chan error) - go g.handleInstanceGroups(sess) + var instanceGroupWG sync.WaitGroup + instanceGroupWG.Add(1) + go g.handleInstanceGroups(sess, &instanceGroupWG) select { - case <-g.importDone: - log.Println("Done Importing") - break case err := <-g.fatalErrors: close(g.fatalErrors) - log.Fatal("Error: ", err) return err } + instanceGroupWG.Wait() return nil } diff --git a/providers/ibm/kp.go b/providers/ibm/kp.go deleted file mode 100644 index de66858a15..0000000000 --- a/providers/ibm/kp.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2019 The Terraformer Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ibm - -import ( - "context" - "fmt" - "os" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - kp "github.com/IBM/keyprotect-go-client" -) - -type KPGenerator struct { - IBMService -} - -func (g KPGenerator) createResources(keysList []kp.Key) []terraformutils.Resource { - var resources []terraformutils.Resource - for _, key := range keysList { - resources = append(resources, terraformutils.NewSimpleResource( - key.CRN, - key.ID, - "ibm_kp_key", - "ibm", - []string{})) - } - return resources -} - -func (g *KPGenerator) InitResources() error { - region := envFallBack([]string{"IC_REGION"}, "us-south") - kpurl := fmt.Sprintf("https://%s.kms.cloud.ibm.com", region) - options := kp.ClientConfig{ - BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kpurl), - APIKey: os.Getenv("IC_API_KEY"), - Verbose: kp.VerboseFailOnly, - } - - client, err := kp.New(options, kp.DefaultTransport()) - if err != nil { - return err - } - client.Config.InstanceID = "e63cc5b3-2594-4e13-b1b1-e8263095ff4b" - - output, err := client.GetKeys(context.Background(), 100, 0) - if err != nil { - return err - } - g.Resources = g.createResources(output.Keys) - return nil -} diff --git a/providers/ibm/utils.go b/providers/ibm/utils.go index 100fe487e6..adb9bced66 100644 --- a/providers/ibm/utils.go +++ b/providers/ibm/utils.go @@ -1,3 +1,17 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package ibm import ( From f3ed9783f3dca5f8811cfc827047cd58a8d7c83c Mon Sep 17 00:00:00 2001 From: magodo Date: Fri, 11 Dec 2020 10:21:04 +0800 Subject: [PATCH 007/276] format --- build/multi-build/main.go | 2 +- cmd/import.go | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/multi-build/main.go b/build/multi-build/main.go index 0ab6ef42d5..b078a6d938 100644 --- a/build/multi-build/main.go +++ b/build/multi-build/main.go @@ -104,4 +104,4 @@ func main() { } } } -} \ No newline at end of file +} diff --git a/cmd/import.go b/cmd/import.go index 61add6bb28..8e8ed0034e 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -34,23 +34,23 @@ import ( ) type ImportOptions struct { - Resources []string - Excludes []string - PathPattern string - PathOutput string - State string - Bucket string - Profile string - Verbose bool - Zone string - Regions []string - Projects []string + Resources []string + Excludes []string + PathPattern string + PathOutput string + State string + Bucket string + Profile string + Verbose bool + Zone string + Regions []string + Projects []string ResourceGroup string - Connect bool - Compact bool - Filter []string - Plan bool `json:"-"` - Output string + Connect bool + Compact bool + Filter []string + Plan bool `json:"-"` + Output string } const DefaultPathPattern = "{output}/{provider}/{service}/" From 5f35edbe384bdb028d1ec09410c9161c90c5a580 Mon Sep 17 00:00:00 2001 From: magodo Date: Fri, 11 Dec 2020 10:22:43 +0800 Subject: [PATCH 008/276] fix lint error --- providers/azure/storage_container.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/providers/azure/storage_container.go b/providers/azure/storage_container.go index df623929d0..2c5b292751 100644 --- a/providers/azure/storage_container.go +++ b/providers/azure/storage_container.go @@ -85,9 +85,7 @@ func (g *StorageContainerGenerator) getStorageAccounts() ([]storage.Account, err return nil, err } if paccounts := accountsResult.Value; paccounts != nil { - for _, account := range *paccounts { - accounts = append(accounts, account) - } + accounts = append(accounts, *paccount...) } } else { accountsIterator, err := accountsClient.ListComplete(ctx) From 110d7666bdd775250b38320564e676cda341ef6e Mon Sep 17 00:00:00 2001 From: magodo Date: Fri, 11 Dec 2020 10:45:51 +0800 Subject: [PATCH 009/276] fix typo --- go.mod | 12 ++- go.sum | 128 ++++++++++++++++++++++++++- providers/azure/storage_container.go | 2 +- 3 files changed, 137 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 9074f211b0..24609c0092 100644 --- a/go.mod +++ b/go.mod @@ -10,15 +10,23 @@ require ( github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 + github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 + github.com/IBM/go-sdk-core/v3 v3.3.1 + github.com/IBM/go-sdk-core/v4 v4.9.0 + github.com/IBM/ibm-cos-sdk-go v1.5.0 + github.com/IBM/keyprotect-go-client v0.5.2 + github.com/IBM/networking-go-sdk v0.12.1 + github.com/IBM/vpc-go-sdk v0.3.1 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible - github.com/aws/aws-sdk-go v1.30.19 + github.com/aws/aws-sdk-go v1.34.28 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.5 github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 + github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.35.1 github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/fastly/go-fastly v1.15.0 @@ -31,7 +39,7 @@ require ( github.com/hashicorp/terraform v0.12.29 github.com/heroku/heroku-go/v5 v5.1.0 github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 - github.com/jmespath/go-jmespath v0.3.0 + github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d github.com/linode/linodego v0.24.0 diff --git a/go.sum b/go.sum index a09a0cbef9..f160dffbc2 100644 --- a/go.sum +++ b/go.sum @@ -108,6 +108,23 @@ github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 h1:TsOhRZ1r0WptlynSSBp8Eu github.com/DataDog/datadog-api-client-go v1.0.0-beta.9/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= github.com/DataDog/datadog-go v3.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 h1:CQEiiiSY2KD3U3WnBpYo6Bh6/VD6+LlL6+Hd3AH+utY= +github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0= +github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= +github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY= +github.com/IBM/go-sdk-core/v3 v3.3.1 h1:DoXjP1+Wm8Yd4XJsvBMRcYLvQwSLFnzKlMjSrg3Rzpw= +github.com/IBM/go-sdk-core/v3 v3.3.1/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QCCKDRsUA2M0= +github.com/IBM/go-sdk-core/v4 v4.5.1/go.mod h1:lTUXbqIX6/aAbSCkP6q59+dyFsTwZAc0ewRS2vJWVbg= +github.com/IBM/go-sdk-core/v4 v4.9.0 h1:OkSg5kaEfVoNuBA4IsIOz8Ur5rbGHbWxmWCZ7nK/oc0= +github.com/IBM/go-sdk-core/v4 v4.9.0/go.mod h1:DbQ+3pFoIjxGGTEiA9zQ2V0cemMNmFMkLBBnR729HKg= +github.com/IBM/ibm-cos-sdk-go v1.5.0 h1:YCmAgsdtp/irQep5g+62OvjLNj35tMXLqTC5jQ+YjWo= +github.com/IBM/ibm-cos-sdk-go v1.5.0/go.mod h1:4mqv/ejW1PKW+Ij6ytU+W8j1UZeLmSEsR5K+flBaWMY= +github.com/IBM/keyprotect-go-client v0.5.2 h1:A4yp2Fc7mg4dtotZErZXwJb9XKpb3ONexnVB+/JqLDM= +github.com/IBM/keyprotect-go-client v0.5.2/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI= +github.com/IBM/networking-go-sdk v0.12.1 h1:GmzrRjvAyqKMfUPM8Y/R5dce0x5AXTqmseVZ3n7eZks= +github.com/IBM/networking-go-sdk v0.12.1/go.mod h1:lzkGBnw5glMB7Nxawfgu19MH4Tjy3KRQ2SYMYl2ck7o= +github.com/IBM/vpc-go-sdk v0.3.1 h1:v7jSq+pkORQOTUxsb/114TzSXvVu1+EIM53Tu/hkJ5o= +github.com/IBM/vpc-go-sdk v0.3.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= @@ -153,13 +170,15 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.30.19 h1:vRwsYgbUvC25Cb3oKXTyTYk3R5n1LRVk8zbvL4inWsc= -github.com/aws/aws-sdk-go v1.30.19/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= @@ -248,9 +267,11 @@ github.com/fatih/motion v1.1.0/go.mod h1:go/hyCtg5rx6FjoC0o+iInMzlY2u7OeHayKYDY6 github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -268,24 +289,59 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.10 h1:FEv6Pt/V4wLwP4vOCZbWlpfmi8kj4UiRip34IDE6SGw= +github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-resty/resty/v2 v2.1.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221 h1:HJ7/f/eGwr7jlZl0lsnNT38/mKcSluFGTc5uLHn4pwI= github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -397,6 +453,7 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmg github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= @@ -427,6 +484,8 @@ github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn github.com/hashicorp/go-plugin v1.3.0 h1:4d/wJojzvHV1I4i/rrjVaeuyxWrLzDE1mDCyDy8fXS8= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= +github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= @@ -495,6 +554,12 @@ github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= @@ -515,12 +580,16 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.2.1/go.mod h1:RAoUvqkWr2rUa2I19qKMEVZQe4BVtcHGTMCUOcCU2Lg= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91/go.mod h1:C2tFh8w3I6i4lnUJfoBx2Hwku3mgu4wPNTtUNp1i5KI= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -538,6 +607,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc33M4Weg78J/fDFsKWTiEsAvriH6x4EHbcR3zus= github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= @@ -552,6 +623,8 @@ github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54 github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -607,12 +680,14 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 h1:TLDEP4t/KAbbIBVqMQlmf0MaLBm0eMAGHKtrOFNGHUM= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409/go.mod h1:q1krA85sGCNuxTOIcH9WSFf4nEO7he+IDDf5SW+xs1s= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= @@ -621,6 +696,8 @@ github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDh github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836/go.mod h1:6Q8/OMaaKAgTX7/jt2bOXVDrm1eJhoNd+iwzghR7jvs= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -630,9 +707,17 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -649,6 +734,7 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -671,17 +757,23 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/godef v1.1.2/go.mod h1:WtY9A/ovuQ+UakAJ1/CEqwwulX/WJjb2kgkokCHi/GY= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= @@ -695,6 +787,7 @@ github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= @@ -710,6 +803,8 @@ github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnT github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -722,6 +817,8 @@ github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BST github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -744,6 +841,8 @@ github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgq github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= @@ -768,6 +867,9 @@ github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a/go.mod h1:ofmGw6LrMy github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= +go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -787,8 +889,10 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -873,6 +977,7 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -880,6 +985,7 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= @@ -900,6 +1006,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= @@ -920,17 +1027,23 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -947,6 +1060,7 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -988,10 +1102,14 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190408220357-e5b8258f4918/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -1022,6 +1140,7 @@ golang.org/x/tools v0.0.0-20200501155019-2658dc0cadb5 h1:skr8G4q25c51+6Dl9dOaUHi golang.org/x/tools v0.0.0-20200501155019-2658dc0cadb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1183,12 +1302,17 @@ gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXa gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.19.0 h1:PTE3gBwP61sZfxOsROkUZbXONv+7N5Mw1Et6S+4NGBA= gopkg.in/go-playground/validator.v9 v9.19.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= +gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/h2non/gock.v1 v1.0.15 h1:SzLqcIlb/fDfg7UvukMpNcWsu7sI5tWwL+KCATZqks0= gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/providers/azure/storage_container.go b/providers/azure/storage_container.go index 2c5b292751..147af6889c 100644 --- a/providers/azure/storage_container.go +++ b/providers/azure/storage_container.go @@ -85,7 +85,7 @@ func (g *StorageContainerGenerator) getStorageAccounts() ([]storage.Account, err return nil, err } if paccounts := accountsResult.Value; paccounts != nil { - accounts = append(accounts, *paccount...) + accounts = append(accounts, *paccounts...) } } else { accountsIterator, err := accountsClient.ListComplete(ctx) From 2a40a693209a2df8f0f202356d8f65e0f8aa0bf0 Mon Sep 17 00:00:00 2001 From: Oliver L Schoenborn Date: Sun, 13 Dec 2020 20:44:51 -0500 Subject: [PATCH 010/276] Clarify type filtering in readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 72af8c7cd9..22db4c71c4 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,12 @@ To import resources from all services, use `--resources="*"` . If you want to ex Filters are a way to choose which resources `terraformer` imports. It's possible to filter resources by its identifiers or attributes. Multiple filtering values are separated by `:`. If an identifier contains this symbol, value should be wrapped in `'` e.g. `--filter=resource=id1:'project:dataset_id'`. Identifier based filters will be executed before Terraformer will try to refresh remote state. +Use `Type` when you need to filter only one of several types of resources. Multiple filters can be combined when importing different resource types. An example would be importing all AWS security groups from a specific AWS VPC: +``` +terraformer import aws -r sg,vpc --filter Type=sg;Name=vpc_id;Value=VPC_ID --filter Type=vpc;Name=id;Value=VPC_ID +``` +Notice how the `Name` is different for `sg` than it is for `vpc`. + ##### Resource ID Filtering is based on Terraform resource ID patterns. To find valid ID patterns for your resource, check the import part of the [Terraform documentation][terraform-providers]. From c3917c60cb97305d2716808318e753b828cbe015 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Dec 2020 07:05:02 +0000 Subject: [PATCH 011/276] Bump github.com/spf13/cobra from 1.0.0 to 1.1.1 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.0.0 to 1.1.1. - [Release notes](https://github.com/spf13/cobra/releases) - [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md) - [Commits](https://github.com/spf13/cobra/compare/v1.0.0...v1.1.1) Signed-off-by: dependabot[bot] --- go.mod | 15 ++++-- go.sum | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 167 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 9074f211b0..cb9d55f207 100644 --- a/go.mod +++ b/go.mod @@ -10,15 +10,23 @@ require ( github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 + github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 + github.com/IBM/go-sdk-core/v3 v3.3.1 + github.com/IBM/go-sdk-core/v4 v4.9.0 + github.com/IBM/ibm-cos-sdk-go v1.5.0 + github.com/IBM/keyprotect-go-client v0.5.2 + github.com/IBM/networking-go-sdk v0.12.1 + github.com/IBM/vpc-go-sdk v0.3.1 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible - github.com/aws/aws-sdk-go v1.30.19 + github.com/aws/aws-sdk-go v1.34.28 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.5 github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 + github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.35.1 github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/fastly/go-fastly v1.15.0 @@ -31,7 +39,7 @@ require ( github.com/hashicorp/terraform v0.12.29 github.com/heroku/heroku-go/v5 v5.1.0 github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 - github.com/jmespath/go-jmespath v0.3.0 + github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d github.com/linode/linodego v0.24.0 @@ -39,8 +47,7 @@ require ( github.com/ns1/ns1-go v2.4.0+incompatible github.com/paultyng/go-newrelic/v4 v4.10.0 github.com/pkg/errors v0.9.1 - github.com/smartystreets/goconvey v1.6.4 // indirect - github.com/spf13/cobra v1.0.0 + github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 github.com/vultr/govultr v0.5.0 github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 diff --git a/go.sum b/go.sum index a09a0cbef9..0d0d15eb95 100644 --- a/go.sum +++ b/go.sum @@ -35,6 +35,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/logging v1.1.2 h1:KNALX0NZn8UJhqKnqoHxhMqyoZfBZoh5wF7CQJZ5XrU= cloud.google.com/go/logging v1.1.2/go.mod h1:KrljuAHIw631j9+QXsnq9vDwsrwmdxfGpivMR68M7DY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -108,6 +109,23 @@ github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 h1:TsOhRZ1r0WptlynSSBp8Eu github.com/DataDog/datadog-api-client-go v1.0.0-beta.9/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= github.com/DataDog/datadog-go v3.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 h1:CQEiiiSY2KD3U3WnBpYo6Bh6/VD6+LlL6+Hd3AH+utY= +github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0= +github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= +github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY= +github.com/IBM/go-sdk-core/v3 v3.3.1 h1:DoXjP1+Wm8Yd4XJsvBMRcYLvQwSLFnzKlMjSrg3Rzpw= +github.com/IBM/go-sdk-core/v3 v3.3.1/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QCCKDRsUA2M0= +github.com/IBM/go-sdk-core/v4 v4.5.1/go.mod h1:lTUXbqIX6/aAbSCkP6q59+dyFsTwZAc0ewRS2vJWVbg= +github.com/IBM/go-sdk-core/v4 v4.9.0 h1:OkSg5kaEfVoNuBA4IsIOz8Ur5rbGHbWxmWCZ7nK/oc0= +github.com/IBM/go-sdk-core/v4 v4.9.0/go.mod h1:DbQ+3pFoIjxGGTEiA9zQ2V0cemMNmFMkLBBnR729HKg= +github.com/IBM/ibm-cos-sdk-go v1.5.0 h1:YCmAgsdtp/irQep5g+62OvjLNj35tMXLqTC5jQ+YjWo= +github.com/IBM/ibm-cos-sdk-go v1.5.0/go.mod h1:4mqv/ejW1PKW+Ij6ytU+W8j1UZeLmSEsR5K+flBaWMY= +github.com/IBM/keyprotect-go-client v0.5.2 h1:A4yp2Fc7mg4dtotZErZXwJb9XKpb3ONexnVB+/JqLDM= +github.com/IBM/keyprotect-go-client v0.5.2/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI= +github.com/IBM/networking-go-sdk v0.12.1 h1:GmzrRjvAyqKMfUPM8Y/R5dce0x5AXTqmseVZ3n7eZks= +github.com/IBM/networking-go-sdk v0.12.1/go.mod h1:lzkGBnw5glMB7Nxawfgu19MH4Tjy3KRQ2SYMYl2ck7o= +github.com/IBM/vpc-go-sdk v0.3.1 h1:v7jSq+pkORQOTUxsb/114TzSXvVu1+EIM53Tu/hkJ5o= +github.com/IBM/vpc-go-sdk v0.3.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= @@ -147,19 +165,22 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.30.19 h1:vRwsYgbUvC25Cb3oKXTyTYk3R5n1LRVk8zbvL4inWsc= -github.com/aws/aws-sdk-go v1.30.19/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= @@ -169,6 +190,7 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1U github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= @@ -192,8 +214,10 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -248,9 +272,11 @@ github.com/fatih/motion v1.1.0/go.mod h1:go/hyCtg5rx6FjoC0o+iInMzlY2u7OeHayKYDY6 github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -268,24 +294,59 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.10 h1:FEv6Pt/V4wLwP4vOCZbWlpfmi8kj4UiRip34IDE6SGw= +github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-resty/resty/v2 v2.1.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221 h1:HJ7/f/eGwr7jlZl0lsnNT38/mKcSluFGTc5uLHn4pwI= github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -392,14 +453,18 @@ github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -419,6 +484,8 @@ github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= @@ -427,6 +494,8 @@ github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn github.com/hashicorp/go-plugin v1.3.0 h1:4d/wJojzvHV1I4i/rrjVaeuyxWrLzDE1mDCyDy8fXS8= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= +github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= @@ -434,6 +503,8 @@ github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhE github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnOn8E8stHc= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= @@ -442,6 +513,7 @@ github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= @@ -456,8 +528,11 @@ github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNws github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 h1:T1Q6ag9tCwun16AW+XK3tAql24P4uTGUMIn1/92WsQQ= github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/terraform v0.12.29 h1:UkuApT6qh6KONIT1Jz7HoV8f4B+x71db3bmGcBzjBB0= github.com/hashicorp/terraform v0.12.29/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhkKZNlHPcr4P55U= github.com/hashicorp/terraform-config-inspect v0.0.0-20190821133035-82a99dc22ef4/go.mod h1:JDmizlhaP5P0rYTTZB0reDMefAiJyfWPEtugV4in1oI= @@ -495,6 +570,12 @@ github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= @@ -515,12 +596,16 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.2.1/go.mod h1:RAoUvqkWr2rUa2I19qKMEVZQe4BVtcHGTMCUOcCU2Lg= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91/go.mod h1:C2tFh8w3I6i4lnUJfoBx2Hwku3mgu4wPNTtUNp1i5KI= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -538,6 +623,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc33M4Weg78J/fDFsKWTiEsAvriH6x4EHbcR3zus= github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= @@ -552,6 +639,8 @@ github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54 github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -574,6 +663,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee h1:7Ac2RNGC8DAwDNd5uZyuYLoJOlVXyBGbO1VtFboDamk= github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee/go.mod h1:yd3I5pyIO5TrBH7+Ym94u8qp9xc6NTHAqESeI8kOJY8= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= @@ -590,9 +680,11 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -607,12 +699,14 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 h1:TLDEP4t/KAbbIBVqMQlmf0MaLBm0eMAGHKtrOFNGHUM= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409/go.mod h1:q1krA85sGCNuxTOIcH9WSFf4nEO7he+IDDf5SW+xs1s= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= @@ -621,6 +715,8 @@ github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDh github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836/go.mod h1:6Q8/OMaaKAgTX7/jt2bOXVDrm1eJhoNd+iwzghR7jvs= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -630,9 +726,17 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -649,6 +753,7 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -671,17 +776,24 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/godef v1.1.2/go.mod h1:WtY9A/ovuQ+UakAJ1/CEqwwulX/WJjb2kgkokCHi/GY= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= @@ -695,9 +807,10 @@ github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= +github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -705,11 +818,13 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -722,6 +837,8 @@ github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BST github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -744,6 +861,8 @@ github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgq github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= @@ -768,6 +887,9 @@ github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a/go.mod h1:ofmGw6LrMy github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= +go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -783,12 +905,15 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -845,7 +970,9 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -873,6 +1000,7 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -880,6 +1008,7 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= @@ -900,6 +1029,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= @@ -912,6 +1042,7 @@ golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -920,17 +1051,23 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -947,6 +1084,7 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -988,16 +1126,21 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190408220357-e5b8258f4918/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1022,6 +1165,7 @@ golang.org/x/tools v0.0.0-20200501155019-2658dc0cadb5 h1:skr8G4q25c51+6Dl9dOaUHi golang.org/x/tools v0.0.0-20200501155019-2658dc0cadb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1183,12 +1327,19 @@ gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXa gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.19.0 h1:PTE3gBwP61sZfxOsROkUZbXONv+7N5Mw1Et6S+4NGBA= gopkg.in/go-playground/validator.v9 v9.19.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= +gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/h2non/gock.v1 v1.0.15 h1:SzLqcIlb/fDfg7UvukMpNcWsu7sI5tWwL+KCATZqks0= gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 03aa2f231f07a0e2f0584ced53ce3321ef873bfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Dec 2020 10:22:18 +0000 Subject: [PATCH 012/276] Bump github.com/fastly/go-fastly from 1.15.0 to 1.18.0 Bumps [github.com/fastly/go-fastly](https://github.com/fastly/go-fastly) from 1.15.0 to 1.18.0. - [Release notes](https://github.com/fastly/go-fastly/releases) - [Changelog](https://github.com/fastly/go-fastly/blob/master/CHANGELOG.md) - [Commits](https://github.com/fastly/go-fastly/compare/v1.15.0...v1.18.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cb9d55f207..285dbce927 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.35.1 github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 - github.com/fastly/go-fastly v1.15.0 + github.com/fastly/go-fastly v1.18.0 github.com/google/go-github/v25 v25.1.3 github.com/gophercloud/gophercloud v0.13.0 github.com/hashicorp/go-azure-helpers v0.10.0 diff --git a/go.sum b/go.sum index 0d0d15eb95..182632e3cc 100644 --- a/go.sum +++ b/go.sum @@ -262,8 +262,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fastly/go-fastly v1.15.0 h1:t7f0ZnQy0rKYN8FCql4wHkfZNHajxDs1hT/phazOpp8= -github.com/fastly/go-fastly v1.15.0/go.mod h1:jILbTQnU/K/7XHQNzQWd1O7hbXIcp6dKrxfRWqU6xfk= +github.com/fastly/go-fastly v1.18.0 h1:fyVq/142VTFz5ZkNE5d57K+NkTmtwxt2K2Mh5sV5scg= +github.com/fastly/go-fastly v1.18.0/go.mod h1:fwYSSnZ6zEClwRS65T0f57Yh83Tc4gL12GgttQwJZfA= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -1167,6 +1167,7 @@ golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200624163319-25775e59acb7/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= From 836d2608daf072bb0a4ba2312105e02e0d5983b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Dec 2020 10:23:06 +0000 Subject: [PATCH 013/276] Bump github.com/aws/aws-sdk-go from 1.30.19 to 1.36.7 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.19 to 1.36.7. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.19...v1.36.7) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index cb9d55f207..cfd9a56e5d 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible - github.com/aws/aws-sdk-go v1.34.28 + github.com/aws/aws-sdk-go v1.36.7 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.5 diff --git a/go.sum b/go.sum index 0d0d15eb95..f62efeb1b6 100644 --- a/go.sum +++ b/go.sum @@ -181,6 +181,8 @@ github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/aws/aws-sdk-go v1.36.7 h1:XoJPAjKoqvdL531XGWxKYn5eGX/xMoXzMN5fBtoyfSY= +github.com/aws/aws-sdk-go v1.36.7/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= From b6cafc29e700ae64ea1f5de759455c4cd0d33440 Mon Sep 17 00:00:00 2001 From: mikeurbanski1 Date: Sat, 19 Dec 2020 02:14:50 -0600 Subject: [PATCH 014/276] Add log group resource (#37) * add log group resource * put cloudwatchlogs in correct place * formatting * change cloudwatchlogs to logs to match aws cli * add cloudwatch_log_group * rename to logs --- README.md | 2 + providers/aws/aws_provider.go | 1 + providers/aws/logs.go | 83 +++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 providers/aws/logs.go diff --git a/README.md b/README.md index 4c23f38599..05b2c53036 100644 --- a/README.md +++ b/README.md @@ -576,6 +576,8 @@ In that case terraformer will not know with which region resources are associate * `aws_lambda_function` * `aws_lambda_function_event_invoke_config` * `aws_lambda_layer_version` +* `logs` + * `aws_cloudwatch_log_group` * `media_package` * `aws_media_package_channel` * `media_store` diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index 713d98aaf8..ae038747a8 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -270,6 +270,7 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "kinesis": &AwsFacade{service: &KinesisGenerator{}}, "kms": &AwsFacade{service: &KmsGenerator{}}, "lambda": &AwsFacade{service: &LambdaGenerator{}}, + "logs": &AwsFacade{service: &LogsGenerator{}}, "media_package": &AwsFacade{service: &MediaPackageGenerator{}}, "media_store": &AwsFacade{service: &MediaStoreGenerator{}}, "msk": &AwsFacade{service: &MskGenerator{}}, diff --git a/providers/aws/logs.go b/providers/aws/logs.go new file mode 100644 index 0000000000..20185f07a9 --- /dev/null +++ b/providers/aws/logs.go @@ -0,0 +1,83 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aws + +import ( + "context" + "strconv" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs" +) + +var logsAllowEmptyValues = []string{"tags."} + +type LogsGenerator struct { + AWSService +} + +func (g *LogsGenerator) createResources(logGroups *cloudwatchlogs.DescribeLogGroupsResponse) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, logGroup := range logGroups.LogGroups { + resourceName := aws.StringValue(logGroup.LogGroupName) + + attributes := map[string]string{} + + if logGroup.RetentionInDays != nil { + attributes["retention_in_days"] = strconv.FormatInt(*logGroup.RetentionInDays, 10) + } + + if logGroup.KmsKeyId != nil { + attributes["kms_key_id"] = *logGroup.KmsKeyId + } + + resources = append(resources, terraformutils.NewResource( + resourceName, + resourceName, + "aws_cloudwatch_log_group", + "aws", + attributes, + logsAllowEmptyValues, + map[string]interface{}{})) + } + return resources +} + +// Generate TerraformResources from AWS API +func (g *LogsGenerator) InitResources() error { + config, e := g.generateConfig() + if e != nil { + return e + } + svc := cloudwatchlogs.New(config) + + logGroups, err := svc.DescribeLogGroupsRequest(&cloudwatchlogs.DescribeLogGroupsInput{}).Send(context.Background()) + if err != nil { + return err + } + g.Resources = g.createResources(logGroups) + return nil +} + +// remove retention_in_days if it is 0 (it gets added by the "refresh" stage) +func (g *LogsGenerator) PostConvertHook() error { + for _, resource := range g.Resources { + if resource.Item["retention_in_days"] == "0" { + delete(resource.Item, "retention_in_days") + } + } + return nil +} From 8af7d36ad31209c98055e6583775a2c7c8241337 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 06:46:01 +0000 Subject: [PATCH 015/276] Bump github.com/linode/linodego from 0.24.0 to 0.24.1 Bumps [github.com/linode/linodego](https://github.com/linode/linodego) from 0.24.0 to 0.24.1. - [Release notes](https://github.com/linode/linodego/releases) - [Commits](https://github.com/linode/linodego/compare/v0.24.0...v0.24.1) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index aba06a9e84..b5fa2d5152 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d - github.com/linode/linodego v0.24.0 + github.com/linode/linodego v0.24.1 github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/ns1/ns1-go v2.4.0+incompatible github.com/paultyng/go-newrelic/v4 v4.10.0 diff --git a/go.sum b/go.sum index 9a166f35bc..a5d7cd4308 100644 --- a/go.sum +++ b/go.sum @@ -635,8 +635,8 @@ github.com/likexian/gokit v0.20.15/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2Pm github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= -github.com/linode/linodego v0.24.0 h1:o6hNS0T7jeikOfUHoJhUhA/e2QTCsw9MGccVmRHRLE4= -github.com/linode/linodego v0.24.0/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= +github.com/linode/linodego v0.24.1 h1:3s7/F54z9XZfefzrFqnHMD9DIEYVyOddPm+gyTEFFzc= +github.com/linode/linodego v0.24.1/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= From 309b1067b331f0ae21507aa00e1e2db0fd7cbda1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 06:46:12 +0000 Subject: [PATCH 016/276] Bump github.com/hashicorp/go-plugin from 1.3.0 to 1.4.0 Bumps [github.com/hashicorp/go-plugin](https://github.com/hashicorp/go-plugin) from 1.3.0 to 1.4.0. - [Release notes](https://github.com/hashicorp/go-plugin/releases) - [Commits](https://github.com/hashicorp/go-plugin/compare/v1.3.0...v1.4.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index aba06a9e84..190b71cb34 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/gophercloud/gophercloud v0.13.0 github.com/hashicorp/go-azure-helpers v0.10.0 github.com/hashicorp/go-hclog v0.14.1 - github.com/hashicorp/go-plugin v1.3.0 + github.com/hashicorp/go-plugin v1.4.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.29 github.com/heroku/heroku-go/v5 v5.1.0 diff --git a/go.sum b/go.sum index 9a166f35bc..e47550f511 100644 --- a/go.sum +++ b/go.sum @@ -495,6 +495,8 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.3.0 h1:4d/wJojzvHV1I4i/rrjVaeuyxWrLzDE1mDCyDy8fXS8= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= +github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= +github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= From 08b080adb072ca0dcfd27b6d1d8f57461a77ae6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 06:47:04 +0000 Subject: [PATCH 017/276] Bump k8s.io/client-go from 0.19.4 to 0.20.1 Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.19.4 to 0.20.1. - [Release notes](https://github.com/kubernetes/client-go/releases) - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.19.4...v0.20.1) Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 59 +++++++++++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index aba06a9e84..81eb9ee680 100644 --- a/go.mod +++ b/go.mod @@ -60,8 +60,8 @@ require ( google.golang.org/api v0.36.0 google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497 gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect - k8s.io/apimachinery v0.19.4 - k8s.io/client-go v0.19.4 + k8s.io/apimachinery v0.20.1 + k8s.io/client-go v0.20.1 ) replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5 diff --git a/go.sum b/go.sum index 9a166f35bc..4c00c93e0d 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,6 @@ cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxK cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -65,14 +64,14 @@ github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.12 h1:gI8ytXbxMfI+IVbI9mP2JGCTXIuhHLgRlvQ9X4PsnHE= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.8.3 h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw= github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/azure/cli v0.2.0 h1:pSwNMF0qotgehbQNllUWwJ4V3vnrLKOzHrwDLEZK904= @@ -86,6 +85,7 @@ github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxB github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= @@ -130,8 +130,8 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= @@ -298,14 +298,17 @@ github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.10 h1:FEv6Pt/V4wLwP4vOCZbWlpfmi8kj4UiRip34IDE6SGw= github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -616,6 +619,7 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -640,7 +644,8 @@ github.com/linode/linodego v0.24.0/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8 github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= @@ -917,6 +922,7 @@ golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -986,10 +992,12 @@ golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1062,6 +1070,7 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1089,13 +1098,13 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1118,7 +1127,6 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181207195948-8634b1ecd393/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1137,6 +1145,7 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1366,25 +1375,25 @@ honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.19.4 h1:I+1I4cgJYuCDgiLNjKx7SLmIbwgj9w7N7Zr5vSIdwpo= -k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk= -k8s.io/apimachinery v0.19.4 h1:+ZoddM7nbzrDCp0T3SWnyxqf8cbWPT2fkZImoyvHUG0= -k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/client-go v0.19.4 h1:85D3mDNoLF+xqpyE9Dh/OtrJDyJrSRKkHmDXIbEzer8= -k8s.io/client-go v0.19.4/go.mod h1:ZrEy7+wj9PjH5VMBCuu/BDlvtUAku0oVFk4MmnW9mWA= +k8s.io/api v0.20.1 h1:ud1c3W3YNzGd6ABJlbFfKXBKXO+1KdGfcgGGNgFR03E= +k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= +k8s.io/apimachinery v0.20.1 h1:LAhz8pKbgR8tUwn7boK+b2HZdt7MiTu2mkYtFMUjTRQ= +k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/client-go v0.20.1 h1:Qquik0xNFbK9aUG92pxHYsyfea5/RPO9o9bSywNor+M= +k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= +k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= From 1906eed8553ee9fee045cedf12667196de689da5 Mon Sep 17 00:00:00 2001 From: Luis San Martin Date: Mon, 28 Dec 2020 07:06:15 +0100 Subject: [PATCH 018/276] add support for rabbitmq shovels --- providers/rabbitmq/rabbitmq_provider.go | 4 ++ providers/rabbitmq/shovel.go | 72 +++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 providers/rabbitmq/shovel.go diff --git a/providers/rabbitmq/rabbitmq_provider.go b/providers/rabbitmq/rabbitmq_provider.go index 264654fab7..39e7ed470a 100644 --- a/providers/rabbitmq/rabbitmq_provider.go +++ b/providers/rabbitmq/rabbitmq_provider.go @@ -81,6 +81,7 @@ func (p *RBTProvider) GetSupportedService() map[string]terraformutils.ServiceGen "queues": &QueueGenerator{}, "users": &UserGenerator{}, "vhosts": &VhostGenerator{}, + "shovels": &ShovelGenerator{}, } } @@ -94,6 +95,9 @@ func (RBTProvider) GetResourceConnections() map[string]map[string][]string { "exchanges": { "vhosts": []string{"vhost", "self_link"}, }, + "shovels": { + "vhosts": []string{"vhost", "self_link"}, + }, "permissions": { "users": []string{"user", "self_link"}, "vhosts": []string{"vhost", "self_link"}, diff --git a/providers/rabbitmq/shovel.go b/providers/rabbitmq/shovel.go new file mode 100644 index 0000000000..5c635509f7 --- /dev/null +++ b/providers/rabbitmq/shovel.go @@ -0,0 +1,72 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package rabbitmq + +import ( + "encoding/json" + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type ShovelGenerator struct { + RBTService +} + +type Shovel struct { + Name string `json:"name"` + Vhost string `json:"vhost"` +} + +type Shovels []Shovel + +var ShovelAllowEmptyValues = []string{} +var ShovelAdditionalFields = map[string]interface{}{} + +func (g ShovelGenerator) createResources(shovels Shovels) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, shovel := range shovels { + if len(shovel.Name) == 0 { + continue + } + resources = append(resources, terraformutils.NewResource( + fmt.Sprintf("%s@%s", shovel.Name, shovel.Vhost), + fmt.Sprintf("shovel_%s_%s", normalizeResourceName(shovel.Vhost), normalizeResourceName(shovel.Name)), + "rabbitmq_shovel", + "rabbitmq", + map[string]string{ + "name": shovel.Name, + "vhost": shovel.Vhost, + }, + ShovelAllowEmptyValues, + ShovelAdditionalFields, + )) + } + return resources +} + +func (g *ShovelGenerator) InitResources() error { + body, err := g.generateRequest("/api/shovels?columns=name,vhost") + if err != nil { + return err + } + var shovels Shovels + err = json.Unmarshal(body, &shovels) + if err != nil { + return err + } + g.Resources = g.createResources(shovels) + return nil +} From e28aff63dbcf9bc9e2f86e257c8599e2bac4c66e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Dec 2020 06:44:13 +0000 Subject: [PATCH 019/276] Bump github.com/cloudflare/cloudflare-go from 0.13.5 to 0.13.6 Bumps [github.com/cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) from 0.13.5 to 0.13.6. - [Release notes](https://github.com/cloudflare/cloudflare-go/releases) - [Commits](https://github.com/cloudflare/cloudflare-go/compare/v0.13.5...v0.13.6) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4cc131ed8a..fb7b3ba193 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/aws/aws-sdk-go v1.36.7 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect - github.com/cloudflare/cloudflare-go v0.13.5 + github.com/cloudflare/cloudflare-go v0.13.6 github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible diff --git a/go.sum b/go.sum index 303a77f04a..476a0fd5af 100644 --- a/go.sum +++ b/go.sum @@ -210,8 +210,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.13.5 h1:28S2iEUK67exPyt/IkmAIFbDAVjyKU1cYzrURj5k84s= -github.com/cloudflare/cloudflare-go v0.13.5/go.mod h1:OgJ1r3tslnIyWr7kX2OCBKUbSnUIyFKEIlZex9qgmIo= +github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= +github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -1027,6 +1027,8 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTi golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= From 634a17b32ba9191f5b3187443729f943e1eb34bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Dec 2020 14:08:26 +0000 Subject: [PATCH 020/276] Bump cloud.google.com/go from 0.73.0 to 0.74.0 Bumps [cloud.google.com/go](https://github.com/googleapis/google-cloud-go) from 0.73.0 to 0.74.0. - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/master/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/v0.73.0...v0.74.0) Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 26 +++++++++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index fb7b3ba193..5a2d95b0b2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/GoogleCloudPlatform/terraformer go 1.15 require ( - cloud.google.com/go v0.73.0 + cloud.google.com/go v0.74.0 cloud.google.com/go/logging v1.1.2 cloud.google.com/go/storage v1.12.0 github.com/Azure/azure-sdk-for-go v42.0.0+incompatible @@ -54,11 +54,11 @@ require ( github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 github.com/zclconf/go-cty v1.7.0 github.com/zorkian/go-datadog-api v2.30.0+incompatible - golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 + golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 golang.org/x/text v0.3.4 gonum.org/v1/gonum v0.7.0 google.golang.org/api v0.36.0 - google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497 + google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect k8s.io/apimachinery v0.20.1 k8s.io/client-go v0.20.1 diff --git a/go.sum b/go.sum index 476a0fd5af..0260198c18 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,8 @@ cloud.google.com/go v0.71.0 h1:2ha722Z08cmRa0orJrzBaszYQcLbLFcsZHsGSj/kIF4= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= cloud.google.com/go v0.72.0 h1:eWRCuwubtDrCJG0oSUMgnsbD4CmPFQF2ei4OFbXvwww= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.73.0 h1:sGvc4e0Cmm4+DKQR76a9VwNukpacQK8TOl5pDl0Pcn0= -cloud.google.com/go v0.73.0/go.mod h1:BkDh9dFvGjCitVw03TNjKbBxXNKULXXIq6orU6HrJ4Q= +cloud.google.com/go v0.74.0 h1:kpgPA77kSSbjSs+fWHkPTxQ6J5Z2Qkruo5jfXEkHxNQ= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= @@ -213,6 +213,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -262,6 +263,7 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fastly/go-fastly v1.18.0 h1:fyVq/142VTFz5ZkNE5d57K+NkTmtwxt2K2Mh5sV5scg= @@ -438,7 +440,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201117184057-ae444373da19/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -963,6 +965,8 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1029,6 +1033,8 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2l golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1039,6 +1045,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 h1:Mj83v+wSRNEar42a/MQgxk9X42TdEmrOl9i+y8WbxLo= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1109,8 +1117,10 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1197,8 +1207,8 @@ golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfSSmC/Hx/fGAQJUAQaM2gc= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201202200335-bef1c476418a h1:TYqOq/v+Ri5aADpldxXOj6PmvcPMOJbLjdALzZDQT2M= -golang.org/x/tools v0.0.0-20201202200335-bef1c476418a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2 h1:vEtypaVub6UvKkiXZ2xx9QIvp9TL7sI7xp7vdi2kezA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -1290,8 +1300,8 @@ google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e h1:wYR00/Ht+i/79g/gzhdehBgLIJCklKoc8Q/NebdzzpY= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497 h1:jDYzwXmX9tLnuG4sL85HPmE1ruErXOopALp2i/0AHnI= -google.golang.org/genproto v0.0.0-20201203001206-6486ece9c497/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc h1:BgQmMjmd7K1zov8j8lYULHW0WnmBGUIMp6+VDwlGErc= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1315,6 +1325,8 @@ google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 729a697136acb1034ffac193297804272b85819e Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Wed, 30 Dec 2020 10:57:56 -0800 Subject: [PATCH 021/276] Fix mikrotik link to point to the correct provider --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f370f610d..ac2f798bd7 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ Links to download Terraform Providers: * Keycloak provider >=1.19.0 - [here](https://github.com/mrparkers/terraform-provider-keycloak/) * Logz.io provider >=1.1.1 - [here](https://github.com/jonboydell/logzio_terraform_provider/) * Commercetools provider >= 0.21.0 - [here](https://github.com/labd/terraform-provider-commercetools) - * Mikrotik provider >= 0.2.2 - [here](https://github.com/labd/terraform-provider-commercetools) + * Mikrotik provider >= 0.2.2 - [here](https://github.com/ddelnano/terraform-provider-mikrotik) * GmailFilter provider >= 1.0.1 - [here](https://github.com/yamamoto-febc/terraform-provider-gmailfilter) Information on provider plugins: From 667ec3bd77ce0e2f21cd911e6a5c59930aa125ca Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 3 Jan 2021 08:34:51 +0800 Subject: [PATCH 022/276] added CloudHSM --- README.md | 3 ++ providers/aws/aws_provider.go | 1 + providers/aws/cloudhsm.go | 66 +++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 providers/aws/cloudhsm.go diff --git a/README.md b/README.md index ac2f798bd7..8acd5fe220 100644 --- a/README.md +++ b/README.md @@ -477,6 +477,9 @@ In that case terraformer will not know with which region resources are associate * `aws_cloudformation_stack` * `aws_cloudformation_stack_set` * `aws_cloudformation_stack_set_instance` +* `cloudhsm` + * `aws_cloudhsm_v2_cluster` + * `aws_cloudhsm_v2_hsm` * `cloudtrail` * `aws_cloudtrail` * `cloudwatch` diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index ae038747a8..982a7a9bee 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -237,6 +237,7 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "cloud9": &AwsFacade{service: &Cloud9Generator{}}, "cloudformation": &AwsFacade{service: &CloudFormationGenerator{}}, "cloudfront": &AwsFacade{service: &CloudFrontGenerator{}}, + "cloudhsm": &AwsFacade{service: &CloudHsmGenerator{}}, "cloudtrail": &AwsFacade{service: &CloudTrailGenerator{}}, "cloudwatch": &AwsFacade{service: &CloudWatchGenerator{}}, "codebuild": &AwsFacade{service: &CodeBuildGenerator{}}, diff --git a/providers/aws/cloudhsm.go b/providers/aws/cloudhsm.go new file mode 100644 index 0000000000..1f89bed0b4 --- /dev/null +++ b/providers/aws/cloudhsm.go @@ -0,0 +1,66 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aws + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/aws/aws-sdk-go-v2/aws" +) + +var cloudHsmAllowEmptyValues = []string{"tags."} + +type CloudHsmGenerator struct { + AWSService +} + +func (g *CloudHsmGenerator) InitResources() error { + config, e := g.generateConfig() + if e != nil { + return e + } + svc := cloudhsmv2.New(config) + + p := cloudhsmv2.NewDescribeClustersPaginator(svc.DescribeClustersRequest(&cloudhsmv2.DescribeClustersInput{})) + for p.Next(context.Background()) { + for _, cluster := range p.CurrentPage().Clusters { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + aws.StringValue(cluster.ClusterId), + aws.StringValue(cluster.ClusterId), + "aws_cloudhsm_v2_cluster", + "aws", + cloudHsmAllowEmptyValues, + )) + + for _, hsm := range cluster.Hsms { + g.Resources = append(g.Resources, terraformutils.NewResource( + aws.StringValue(hsm.HsmId), + aws.StringValue(hsm.HsmId), + "aws_cloudhsm_v2_hsm", + "aws", + map[string]string{ + "cluster_id": aws.StringValue(hsm.ClusterId), + }, + cloudHsmAllowEmptyValues, + map[string]interface{}{}, + )) + + } + } + } + return p.Err() +} From b52072c3a1739ad19398ebeb1c58e0661b5eaff5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 06:50:46 +0000 Subject: [PATCH 023/276] Bump github.com/aws/aws-sdk-go from 1.36.7 to 1.36.19 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.36.7 to 1.36.19. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.36.7...v1.36.19) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5a2d95b0b2..3e85f168a9 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible - github.com/aws/aws-sdk-go v1.36.7 + github.com/aws/aws-sdk-go v1.36.19 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 diff --git a/go.sum b/go.sum index 0260198c18..86fb1ccff8 100644 --- a/go.sum +++ b/go.sum @@ -181,8 +181,8 @@ github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/aws-sdk-go v1.36.7 h1:XoJPAjKoqvdL531XGWxKYn5eGX/xMoXzMN5fBtoyfSY= -github.com/aws/aws-sdk-go v1.36.7/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA= +github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= From 96f82a54c82ddca37343a9ca1e05ee55ece6e00a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 10:37:34 +0000 Subject: [PATCH 024/276] Bump github.com/Azure/azure-sdk-for-go Bumps [github.com/Azure/azure-sdk-for-go](https://github.com/Azure/azure-sdk-for-go) from 42.0.0+incompatible to 42.3.0+incompatible. - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/v42.0.0...v42.3.0) Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5a2d95b0b2..d86e76b505 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( cloud.google.com/go v0.74.0 cloud.google.com/go/logging v1.1.2 cloud.google.com/go/storage v1.12.0 - github.com/Azure/azure-sdk-for-go v42.0.0+incompatible + github.com/Azure/azure-sdk-for-go v42.3.0+incompatible github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 @@ -20,7 +20,7 @@ require ( github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible - github.com/aws/aws-sdk-go v1.36.7 + github.com/aws/aws-sdk-go v1.36.19 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 diff --git a/go.sum b/go.sum index 0260198c18..c1c1a4965f 100644 --- a/go.sum +++ b/go.sum @@ -56,8 +56,8 @@ github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v36.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v42.0.0+incompatible h1:yz6sFf5bHZ+gEOQVuK5JhPqTTAmv+OvSLSaqgzqaCwY= -github.com/Azure/azure-sdk-for-go v42.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v42.3.0+incompatible h1:PAHkmPqd/vQV4LJcqzEUM1elCyTMWjbrO8oFMl0dvBE= +github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.10.0 h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs= github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESNmQdijykocJ0YOxmMX8SE= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -181,8 +181,8 @@ github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/aws-sdk-go v1.36.7 h1:XoJPAjKoqvdL531XGWxKYn5eGX/xMoXzMN5fBtoyfSY= -github.com/aws/aws-sdk-go v1.36.7/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA= +github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= From 0c04e926842f1a9b06df579cbbc020595a1b1e2d Mon Sep 17 00:00:00 2001 From: rotemavni Date: Tue, 19 Jan 2021 13:57:14 +0200 Subject: [PATCH 025/276] stable version --- cmd/import.go | 263 ++++++++++++++++++++- cmd/provider_cmd_aws.go | 10 +- main_test.go | 39 +++ terraformutils/providerwrapper/provider.go | 19 +- terraformutils/utils.go | 75 +++++- 5 files changed, 391 insertions(+), 15 deletions(-) create mode 100644 main_test.go diff --git a/cmd/import.go b/cmd/import.go index 8e8ed0034e..0a0581e719 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -17,9 +17,12 @@ import ( "fmt" "io/ioutil" "log" + "math/rand" "os" "sort" "strings" + "sync" + "time" "github.com/GoogleCloudPlatform/terraformer/terraformutils/terraformerstring" @@ -51,6 +54,8 @@ type ImportOptions struct { Filter []string Plan bool `json:"-"` Output string + RetryCount int + RetrySleepMs int } const DefaultPathPattern = "{output}/{provider}/{service}/" @@ -77,6 +82,256 @@ func newImportCmd() *cobra.Command { return cmd } +func initOptionsAndWrapper(provider terraformutils.ProviderGenerator, options ImportOptions, args []string) (*providerwrapper.ProviderWrapper, ImportOptions, error) { + err := provider.Init(args) + if err != nil { + return nil, options, err + } + + if terraformerstring.ContainsString(options.Resources, "*") { + log.Println("Attempting an import of ALL resources in " + provider.GetName()) + options.Resources = providerServices(provider) + } + + if options.Excludes != nil { + localSlice := []string{} + for _, r := range options.Resources { + remove := false + for _, e := range options.Excludes { + if r == e { + remove = true + log.Println("Excluding resource " + e) + } + } + if !remove { + localSlice = append(localSlice, r) + } + } + options.Resources = localSlice + } + + providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose, options.RetryCount, options.RetrySleepMs) + if err != nil { + return nil, options, err + } + + return providerWrapper, options, nil +} + +func initAllServiceResources(providers []terraformutils.ProviderGenerator, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper) (map[terraformutils.ProviderGenerator]string, error) { + var wg sync.WaitGroup + numOfResources := len(options.Resources) + wg.Add(numOfResources) + failedServicesChan := make(chan string, numOfResources) + serviceByProvider := map[terraformutils.ProviderGenerator]string{} + filteredServiceByProvider := map[terraformutils.ProviderGenerator]string{} + for i, service := range options.Resources { + serviceProvider := providers[i] + serviceByProvider[serviceProvider] = service + err := serviceProvider.Init(args) + if err != nil { + return nil, err + } + go initServiceResources(service, serviceProvider, options, providerWrapper, &wg, failedServicesChan) + } + wg.Wait() + close(failedServicesChan) + var failedServices []string + for failedService := range failedServicesChan { + failedServices = append(failedServices, failedService) + } + + for provider := range serviceByProvider { + service := serviceByProvider[provider] + isFailed := false + for _, failedService := range failedServices { + if failedService == service { + isFailed = true + break + } + } + if !isFailed { + filteredServiceByProvider[provider] = service + } + } + + return filteredServiceByProvider, nil +} + +func shuffleResources(providers []terraformutils.ProviderGenerator, serviceByProvider map[terraformutils.ProviderGenerator]string) []map[*terraformutils.Resource]terraformutils.ProviderGenerator { + var allResources []map[*terraformutils.Resource]terraformutils.ProviderGenerator + for i := range providers { + provider := providers[i] + log.Printf("num of resources for service %s: %d", serviceByProvider[provider], len(provider.GetService().GetResources())) + providerResources := provider.GetService().GetResources() + for i := range providerResources { + resource := providerResources[i] + allResources = append(allResources, map[*terraformutils.Resource]terraformutils.ProviderGenerator{&resource: provider}) + } + } + + rand.Seed(time.Now().UnixNano()) + rand.Shuffle(len(allResources), func(i, j int) { allResources[i], allResources[j] = allResources[j], allResources[i] }) + + return allResources +} + +func ImportRoundRobin(providers []terraformutils.ProviderGenerator, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper) error { + defer providerWrapper.Kill() + + serviceByProvider, err := initAllServiceResources(providers, options, args, providerWrapper) + if err != nil { + return err + } + + shuffledResources := shuffleResources(providers, serviceByProvider) + + refreshedResources, err := terraformutils.RefreshResourcesByProvider(shuffledResources, providerWrapper) + providerToResources := make(map[terraformutils.ProviderGenerator][]terraformutils.Resource) + + for resource := range refreshedResources { + p := refreshedResources[resource] + if providerToResources[p] == nil { + providerToResources[p] = []terraformutils.Resource{} + } + providerToResources[p] = append(providerToResources[p], *resource) + } + + err = importFromPlan2(providerToResources, options, args, providerWrapper, serviceByProvider, providers[0]) + + return err +} + +func importFromPlan2(providerToResources map[terraformutils.ProviderGenerator][]terraformutils.Resource, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper, serviceByProvider map[terraformutils.ProviderGenerator]string, provider terraformutils.ProviderGenerator) error { + plan := &ImportPlan{ + Provider: provider.GetName(), + Options: options, + Args: args, + ImportedResource: map[string][]terraformutils.Resource{}, + } + for p := range providerToResources { + service := serviceByProvider[p] + plan.ImportedResource[service] = append(plan.ImportedResource[service], providerToResources[p]...) + } + + if options.Plan { + path := Path(options.PathPattern, provider.GetName(), "terraformer", options.PathOutput) + return ExportPlanFile(plan, path, "plan.json") + } + + return ImportFromPlan(provider, plan) +} + +func importFromPlan(providerToResources map[terraformutils.ProviderGenerator][]terraformutils.Resource, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper, serviceByProvider map[terraformutils.ProviderGenerator]string) error { + var wg sync.WaitGroup + numOfProviders := len(providerToResources) + wg.Add(numOfProviders) + errors := make(chan error, numOfProviders) + for p := range providerToResources { + resources, err := refreshServiceResources(p, providerWrapper, providerToResources[p]) + if err != nil { + return err + } + go importFromPlanWorker(p, options, args, resources, serviceByProvider[p], &wg, errors) + } + + wg.Wait() + close(errors) + err, done := <-errors + if done { + return err + } + + return nil +} + +func importFromPlanWorker(provider terraformutils.ProviderGenerator, options ImportOptions, args []string, resources []terraformutils.Resource, service string, wg *sync.WaitGroup, errors chan error) { + plan := &ImportPlan{ + Provider: provider.GetName(), + Options: options, + Args: args, + ImportedResource: map[string][]terraformutils.Resource{}, + } + + plan.ImportedResource[service] = append(plan.ImportedResource[service], resources...) + + if options.Plan { + path := Path(options.PathPattern, provider.GetName(), "terraformer", options.PathOutput) + err := ExportPlanFile(plan, path, "plan.json") + wg.Done() + if err != nil { + errors <- err + } + } + err := ImportFromPlan(provider, plan) + wg.Done() + if err != nil { + errors <- err + } +} + +func initServiceResources(service string, provider terraformutils.ProviderGenerator, + options ImportOptions, providerWrapper *providerwrapper.ProviderWrapper, wg *sync.WaitGroup, failedServices chan string) { + log.Println(provider.GetName() + " importing... " + service) + err := provider.InitService(service, options.Verbose) + if err != nil { + failedServices <- service + log.Printf("%s error importing %s, err: %s\n", provider.GetName(), service, err) + wg.Done() + return + } + provider.GetService().ParseFilters(options.Filter) + err = provider.GetService().InitResources() + if err != nil { + failedServices <- service + log.Printf("%s error initializing resources in service %s, err: %s\n", provider.GetName(), service, err) + wg.Done() + return + } + + provider.GetService().PopulateIgnoreKeys(providerWrapper) + provider.GetService().InitialCleanup() + log.Println(provider.GetName() + " done importing " + service) + wg.Done() +} + +func refreshServiceResources(provider terraformutils.ProviderGenerator, providerWrapper *providerwrapper.ProviderWrapper, refreshedResources []terraformutils.Resource) ([]terraformutils.Resource, error) { + provider.GetService().SetResources(refreshedResources) + + for i := range provider.GetService().GetResources() { + err := provider.GetService().GetResources()[i].ConvertTFstate(providerWrapper) + if err != nil { + return nil, err + } + } + provider.GetService().PostRefreshCleanup() + + // change structs with additional data for each resource + err := provider.GetService().PostConvertHook() + if err != nil { + return nil, err + } + return provider.GetService().GetResources(), nil +} + +func getResourcesAddresses(resources []terraformutils.Resource) []*terraformutils.Resource { + results := []*terraformutils.Resource{} + for i := range resources { + results = append(results, &resources[i]) + } + + return results +} + +func getResourcesValues(resources []*terraformutils.Resource) []terraformutils.Resource { + results := []terraformutils.Resource{} + for i := range resources { + results = append(results, *resources[i]) + } + + return results +} + func Import(provider terraformutils.ProviderGenerator, options ImportOptions, args []string) error { err := provider.Init(args) if err != nil { @@ -112,7 +367,7 @@ func Import(provider terraformutils.ProviderGenerator, options ImportOptions, ar options.Resources = localSlice } - providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose) + providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose, options.RetryCount, options.RetrySleepMs) if err != nil { return err } @@ -150,11 +405,11 @@ func buildServiceResources(service string, provider terraformutils.ProviderGener provider.GetService().PopulateIgnoreKeys(providerWrapper) provider.GetService().InitialCleanup() - refreshedResources, err := terraformutils.RefreshResources(provider.GetService().GetResources(), providerWrapper) + refreshedResources, err := terraformutils.RefreshResources(getResourcesAddresses(provider.GetService().GetResources()), providerWrapper, nil) if err != nil { return nil, err } - provider.GetService().SetResources(refreshedResources) + provider.GetService().SetResources(getResourcesValues(refreshedResources)) for i := range provider.GetService().GetResources() { err = provider.GetService().GetResources()[i].ConvertTFstate(providerWrapper) @@ -358,4 +613,6 @@ func baseProviderFlags(flag *pflag.FlagSet, options *ImportOptions, sampleRes, s flag.StringSliceVarP(&options.Filter, "filter", "f", []string{}, sampleFilters) flag.BoolVarP(&options.Verbose, "verbose", "v", false, "") flag.StringVarP(&options.Output, "output", "O", "hcl", "output format hcl or json") + flag.IntVarP(&options.RetryCount, "retry-number", "n", 5, "number of retries to perform when refresh fails") + flag.IntVarP(&options.RetrySleepMs, "retry-sleep-ms", "m", 300, "time in ms to sleep between retries") } diff --git a/cmd/provider_cmd_aws.go b/cmd/provider_cmd_aws.go index 7a00c74315..fa168cc61d 100644 --- a/cmd/provider_cmd_aws.go +++ b/cmd/provider_cmd_aws.go @@ -109,7 +109,15 @@ func importRegionResources(options ImportOptions, originalPathPattern string, re } else { log.Println(provider.GetName() + " importing default region") } - err := Import(provider, options, []string{region, options.Profile}) + args := []string{region, options.Profile} + + providerWrapper, options, err := initOptionsAndWrapper(provider, options, args) + providersPerResources := make([]terraformutils.ProviderGenerator, len(options.Resources)) + for i := range options.Resources { + providersPerResources[i] = newAWSProvider() + } + err = ImportRoundRobin(providersPerResources, options, args, providerWrapper) + //err := Import(provider, options, []string{region, options.Profile}) if err != nil { return err } diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000000..886a62e1b4 --- /dev/null +++ b/main_test.go @@ -0,0 +1,39 @@ +package main + +import ( + "github.com/GoogleCloudPlatform/terraformer/cmd" + "log" + "os" + "testing" + "time" +) + +func TestTerraformerMain(t1 *testing.T) { + t1.Run("run main", func(t1 *testing.T) { + tCommand := cmd.NewCmdRoot() + tCommand.SetArgs([]string{ + "import", + "aws", + "--regions=sa-east-1", + //"--regions=us-west-1", + //"--regions=us-east-1", + //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", + "--resources=\"*\"", + //"--resources=sg", + //"--resources=cloudformation,sg,s3", + //"--resources=cloudformation,sg", + //"--resources=sg,vpc", + //"--resources=kms", + "--profile=nubank", + //"--retry-number=5", + //"--retry-sleep-ms=300", + }) + start := time.Now() + if err := tCommand.Execute(); err != nil { + log.Println(err) + os.Exit(1) + } + log.Printf("Importing took %s", time.Since(start)) + + }) +} diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index 2165e895fd..30fb5efb1f 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -56,12 +56,23 @@ type ProviderWrapper struct { providerName string config cty.Value schema *providers.GetSchemaResponse + retryCount int + retrySleepMs int } -func NewProviderWrapper(providerName string, providerConfig cty.Value, verbose bool) (*ProviderWrapper, error) { +func NewProviderWrapper(providerName string, providerConfig cty.Value, verbose bool, retryOptions ...int) (*ProviderWrapper, error) { p := &ProviderWrapper{} p.providerName = providerName p.config = providerConfig + + if len(retryOptions) == 2 { + p.retryCount = retryOptions[0] + p.retrySleepMs = retryOptions[1] + } else { + p.retryCount = 5 + p.retrySleepMs = 300 + } + err := p.initProvider(verbose) return p, err @@ -149,15 +160,15 @@ func (p *ProviderWrapper) Refresh(info *terraform.InstanceInfo, state *terraform } successReadResource := false resp := providers.ReadResourceResponse{} - for i := 0; i < 5; i++ { + for i := 0; i < p.retryCount; i++ { resp = p.Provider.ReadResource(providers.ReadResourceRequest{ TypeName: info.Type, PriorState: priorState, Private: []byte{}, }) if resp.Diagnostics.HasErrors() { - log.Println("WARN: Fail read resource from provider, wait 300ms before retry") - time.Sleep(300 * time.Millisecond) + log.Printf("WARN: Fail read resource from provider, wait %dms before retry\n", p.retrySleepMs) + time.Sleep(time.Duration(p.retrySleepMs) * time.Millisecond) continue } else { successReadResource = true diff --git a/terraformutils/utils.go b/terraformutils/utils.go index 0ac39c72fa..317a408f3c 100644 --- a/terraformutils/utils.go +++ b/terraformutils/utils.go @@ -65,21 +65,35 @@ func PrintTfState(resources []Resource) ([]byte, error) { return buf.Bytes(), err } -func RefreshResources(resources []Resource, provider *providerwrapper.ProviderWrapper) ([]Resource, error) { - refreshedResources := []Resource{} +func RefreshResources(resources []*Resource, provider *providerwrapper.ProviderWrapper, slowProcessingResources [][]*Resource) ([]*Resource, error) { + refreshedResources := []*Resource{} input := make(chan *Resource, 100) var wg sync.WaitGroup poolSize := 15 - if slowProcessingRequired(resources) { - poolSize = 1 - } + //if slowProcessingRequired(resources) { + // poolSize = 1 + //} for i := 0; i < poolSize; i++ { go RefreshResourceWorker(input, &wg, provider) } for i := range resources { wg.Add(1) - input <- &resources[i] + input <- resources[i] + } + + spInputs := []chan *Resource{} + for i, resourceGroup := range slowProcessingResources { + spInputs = append(spInputs, make(chan *Resource, 100)) + for j := range resourceGroup { + spInputs[i] <- resourceGroup[j] + } + } + + for i := 0; i < len(spInputs); i++ { + go RefreshResourceWorker(spInputs[i], &wg, provider) + wg.Add(len(slowProcessingResources[i])) } + wg.Wait() close(input) for _, r := range resources { @@ -89,10 +103,57 @@ func RefreshResources(resources []Resource, provider *providerwrapper.ProviderWr log.Printf("ERROR: Unable to refresh resource %s", r.ResourceName) } } + + for _, resourceGroup := range slowProcessingResources { + for i := range resourceGroup { + r := resourceGroup[i] + if r.InstanceState != nil && r.InstanceState.ID != "" { + refreshedResources = append(refreshedResources, r) + } else { + log.Printf("ERROR: Unable to refresh resource %s", r.ResourceName) + } + } + } return refreshedResources, nil } -func slowProcessingRequired(resources []Resource) bool { +func RefreshResourcesByProvider(resourcesByProvider []map[*Resource]ProviderGenerator, providerWrapper *providerwrapper.ProviderWrapper) (map[*Resource]ProviderGenerator, error) { + flattenedResourcesByProvider := make(map[*Resource]ProviderGenerator) + refreshedResourcesByProvider := make(map[*Resource]ProviderGenerator) + slowProcessingResources := make(map[ProviderGenerator][]*Resource) + var resources []*Resource + for _, resourceProviderPair := range resourcesByProvider { + for resourcePtr := range resourceProviderPair { + if resourcePtr.SlowQueryRequired { + provider := resourceProviderPair[resourcePtr] + if slowProcessingResources[provider] == nil { + slowProcessingResources[provider] = []*Resource{} + } + slowProcessingResources[provider] = append(slowProcessingResources[provider], resourcePtr) + flattenedResourcesByProvider[resourcePtr] = resourceProviderPair[resourcePtr] + } else { + flattenedResourcesByProvider[resourcePtr] = resourceProviderPair[resourcePtr] + resources = append(resources, resourcePtr) + } + } + } + + var spResourcesList [][]*Resource + for p := range slowProcessingResources { + spResourcesList = append(spResourcesList, slowProcessingResources[p]) + } + + refreshedResources, err := RefreshResources(resources, providerWrapper, spResourcesList) + if err != nil { + return nil, err + } + for _, r := range refreshedResources { + refreshedResourcesByProvider[r] = flattenedResourcesByProvider[r] + } + return refreshedResourcesByProvider, nil +} + +func slowProcessingRequired(resources []*Resource) bool { for _, r := range resources { if r.SlowQueryRequired { return true From d71987afe9a867c5a4330b1bbbb5729e678d42fd Mon Sep 17 00:00:00 2001 From: rotemavni Date: Tue, 19 Jan 2021 18:03:11 +0200 Subject: [PATCH 026/276] code cleanup + use provider_mapping --- cmd/import.go | 301 +++++----------------------- cmd/provider_cmd_aws.go | 10 +- main_test.go | 30 +++ terraformutils/providers_mapping.go | 151 ++++++++++++++ terraformutils/utils.go | 53 ++--- 5 files changed, 251 insertions(+), 294 deletions(-) create mode 100644 terraformutils/providers_mapping.go diff --git a/cmd/import.go b/cmd/import.go index 0a0581e719..935d6afe2c 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -15,16 +15,13 @@ package cmd import ( "fmt" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/terraformerstring" "io/ioutil" "log" - "math/rand" "os" "sort" "strings" "sync" - "time" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils/terraformerstring" "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" @@ -82,6 +79,34 @@ func newImportCmd() *cobra.Command { return cmd } +func Import(provider terraformutils.ProviderGenerator, options ImportOptions, args []string) error { + + providerWrapper, options, err := initOptionsAndWrapper(provider, options, args) + if err != nil { + return err + } + defer providerWrapper.Kill() + providerMapping := terraformutils.NewProvidersMapping(provider) + + err = initAllServicesResources(providerMapping, options, args, providerWrapper) + if err != nil { + return err + } + + err = terraformutils.RefreshResourcesByProvider(providerMapping, providerWrapper) + if err != nil { + return err + } + + providerMapping.ConvertTFStates(providerWrapper) + // change structs with additional data for each resource + providerMapping.CleanupProviders() + + err = importFromPlan(providerMapping, options, args) + + return err +} + func initOptionsAndWrapper(provider terraformutils.ProviderGenerator, options ImportOptions, args []string) (*providerwrapper.ProviderWrapper, ImportOptions, error) { err := provider.Init(args) if err != nil { @@ -118,159 +143,58 @@ func initOptionsAndWrapper(provider terraformutils.ProviderGenerator, options Im return providerWrapper, options, nil } -func initAllServiceResources(providers []terraformutils.ProviderGenerator, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper) (map[terraformutils.ProviderGenerator]string, error) { - var wg sync.WaitGroup +func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper) error { numOfResources := len(options.Resources) + var wg sync.WaitGroup wg.Add(numOfResources) + failedServicesChan := make(chan string, numOfResources) - serviceByProvider := map[terraformutils.ProviderGenerator]string{} - filteredServiceByProvider := map[terraformutils.ProviderGenerator]string{} - for i, service := range options.Resources { - serviceProvider := providers[i] - serviceByProvider[serviceProvider] = service + + for _, service := range options.Resources { + serviceProvider := providersMapping.AddServiceToProvider(service) err := serviceProvider.Init(args) if err != nil { - return nil, err + return err } - go initServiceResources(service, serviceProvider, options, providerWrapper, &wg, failedServicesChan) + go initServiceResourcesWorker(service, serviceProvider, options, providerWrapper, &wg, failedServicesChan) } wg.Wait() close(failedServicesChan) + + // remove providers that failed to init their service var failedServices []string for failedService := range failedServicesChan { failedServices = append(failedServices, failedService) } - for provider := range serviceByProvider { - service := serviceByProvider[provider] - isFailed := false - for _, failedService := range failedServices { - if failedService == service { - isFailed = true - break - } - } - if !isFailed { - filteredServiceByProvider[provider] = service - } - } - - return filteredServiceByProvider, nil -} - -func shuffleResources(providers []terraformutils.ProviderGenerator, serviceByProvider map[terraformutils.ProviderGenerator]string) []map[*terraformutils.Resource]terraformutils.ProviderGenerator { - var allResources []map[*terraformutils.Resource]terraformutils.ProviderGenerator - for i := range providers { - provider := providers[i] - log.Printf("num of resources for service %s: %d", serviceByProvider[provider], len(provider.GetService().GetResources())) - providerResources := provider.GetService().GetResources() - for i := range providerResources { - resource := providerResources[i] - allResources = append(allResources, map[*terraformutils.Resource]terraformutils.ProviderGenerator{&resource: provider}) - } - } - - rand.Seed(time.Now().UnixNano()) - rand.Shuffle(len(allResources), func(i, j int) { allResources[i], allResources[j] = allResources[j], allResources[i] }) - - return allResources -} - -func ImportRoundRobin(providers []terraformutils.ProviderGenerator, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper) error { - defer providerWrapper.Kill() + providersMapping.RemoveServices(failedServices) + providersMapping.ProcessResources() - serviceByProvider, err := initAllServiceResources(providers, options, args, providerWrapper) - if err != nil { - return err - } - - shuffledResources := shuffleResources(providers, serviceByProvider) - - refreshedResources, err := terraformutils.RefreshResourcesByProvider(shuffledResources, providerWrapper) - providerToResources := make(map[terraformutils.ProviderGenerator][]terraformutils.Resource) - - for resource := range refreshedResources { - p := refreshedResources[resource] - if providerToResources[p] == nil { - providerToResources[p] = []terraformutils.Resource{} - } - providerToResources[p] = append(providerToResources[p], *resource) - } - - err = importFromPlan2(providerToResources, options, args, providerWrapper, serviceByProvider, providers[0]) - - return err + return nil } -func importFromPlan2(providerToResources map[terraformutils.ProviderGenerator][]terraformutils.Resource, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper, serviceByProvider map[terraformutils.ProviderGenerator]string, provider terraformutils.ProviderGenerator) error { +func importFromPlan(providerMapping *terraformutils.ProvidersMapping, options ImportOptions, args []string) error { plan := &ImportPlan{ - Provider: provider.GetName(), + Provider: providerMapping.GetBaseProvider().GetName(), Options: options, Args: args, ImportedResource: map[string][]terraformutils.Resource{}, } - for p := range providerToResources { - service := serviceByProvider[p] - plan.ImportedResource[service] = append(plan.ImportedResource[service], providerToResources[p]...) + + resourcesByService := providerMapping.GetResourcesByService() + for service := range resourcesByService { + plan.ImportedResource[service] = append(plan.ImportedResource[service], resourcesByService[service]...) } if options.Plan { - path := Path(options.PathPattern, provider.GetName(), "terraformer", options.PathOutput) + path := Path(options.PathPattern, providerMapping.GetBaseProvider().GetName(), "terraformer", options.PathOutput) return ExportPlanFile(plan, path, "plan.json") } - return ImportFromPlan(provider, plan) -} - -func importFromPlan(providerToResources map[terraformutils.ProviderGenerator][]terraformutils.Resource, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper, serviceByProvider map[terraformutils.ProviderGenerator]string) error { - var wg sync.WaitGroup - numOfProviders := len(providerToResources) - wg.Add(numOfProviders) - errors := make(chan error, numOfProviders) - for p := range providerToResources { - resources, err := refreshServiceResources(p, providerWrapper, providerToResources[p]) - if err != nil { - return err - } - go importFromPlanWorker(p, options, args, resources, serviceByProvider[p], &wg, errors) - } - - wg.Wait() - close(errors) - err, done := <-errors - if done { - return err - } - - return nil -} - -func importFromPlanWorker(provider terraformutils.ProviderGenerator, options ImportOptions, args []string, resources []terraformutils.Resource, service string, wg *sync.WaitGroup, errors chan error) { - plan := &ImportPlan{ - Provider: provider.GetName(), - Options: options, - Args: args, - ImportedResource: map[string][]terraformutils.Resource{}, - } - - plan.ImportedResource[service] = append(plan.ImportedResource[service], resources...) - - if options.Plan { - path := Path(options.PathPattern, provider.GetName(), "terraformer", options.PathOutput) - err := ExportPlanFile(plan, path, "plan.json") - wg.Done() - if err != nil { - errors <- err - } - } - err := ImportFromPlan(provider, plan) - wg.Done() - if err != nil { - errors <- err - } + return ImportFromPlan(providerMapping.GetBaseProvider(), plan) } -func initServiceResources(service string, provider terraformutils.ProviderGenerator, +func initServiceResourcesWorker(service string, provider terraformutils.ProviderGenerator, options ImportOptions, providerWrapper *providerwrapper.ProviderWrapper, wg *sync.WaitGroup, failedServices chan string) { log.Println(provider.GetName() + " importing... " + service) err := provider.InitService(service, options.Verbose) @@ -295,25 +219,6 @@ func initServiceResources(service string, provider terraformutils.ProviderGenera wg.Done() } -func refreshServiceResources(provider terraformutils.ProviderGenerator, providerWrapper *providerwrapper.ProviderWrapper, refreshedResources []terraformutils.Resource) ([]terraformutils.Resource, error) { - provider.GetService().SetResources(refreshedResources) - - for i := range provider.GetService().GetResources() { - err := provider.GetService().GetResources()[i].ConvertTFstate(providerWrapper) - if err != nil { - return nil, err - } - } - provider.GetService().PostRefreshCleanup() - - // change structs with additional data for each resource - err := provider.GetService().PostConvertHook() - if err != nil { - return nil, err - } - return provider.GetService().GetResources(), nil -} - func getResourcesAddresses(resources []terraformutils.Resource) []*terraformutils.Resource { results := []*terraformutils.Resource{} for i := range resources { @@ -323,110 +228,6 @@ func getResourcesAddresses(resources []terraformutils.Resource) []*terraformutil return results } -func getResourcesValues(resources []*terraformutils.Resource) []terraformutils.Resource { - results := []terraformutils.Resource{} - for i := range resources { - results = append(results, *resources[i]) - } - - return results -} - -func Import(provider terraformutils.ProviderGenerator, options ImportOptions, args []string) error { - err := provider.Init(args) - if err != nil { - return err - } - - plan := &ImportPlan{ - Provider: provider.GetName(), - Options: options, - Args: args, - ImportedResource: map[string][]terraformutils.Resource{}, - } - - if terraformerstring.ContainsString(options.Resources, "*") { - log.Println("Attempting an import of ALL resources in " + provider.GetName()) - options.Resources = providerServices(provider) - } - - if options.Excludes != nil { - localSlice := []string{} - for _, r := range options.Resources { - remove := false - for _, e := range options.Excludes { - if r == e { - remove = true - log.Println("Excluding resource " + e) - } - } - if !remove { - localSlice = append(localSlice, r) - } - } - options.Resources = localSlice - } - - providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose, options.RetryCount, options.RetrySleepMs) - if err != nil { - return err - } - - defer providerWrapper.Kill() - - for _, service := range options.Resources { - resources, err := buildServiceResources(service, provider, options, providerWrapper) - if err != nil { - log.Println(err) - continue - } - plan.ImportedResource[service] = append(plan.ImportedResource[service], resources...) - } - if options.Plan { - path := Path(options.PathPattern, provider.GetName(), "terraformer", options.PathOutput) - return ExportPlanFile(plan, path, "plan.json") - } - return ImportFromPlan(provider, plan) -} - -func buildServiceResources(service string, provider terraformutils.ProviderGenerator, - options ImportOptions, providerWrapper *providerwrapper.ProviderWrapper) ([]terraformutils.Resource, error) { - log.Println(provider.GetName() + " importing... " + service) - err := provider.InitService(service, options.Verbose) - if err != nil { - return nil, err - } - provider.GetService().ParseFilters(options.Filter) - err = provider.GetService().InitResources() - if err != nil { - return nil, err - } - - provider.GetService().PopulateIgnoreKeys(providerWrapper) - provider.GetService().InitialCleanup() - - refreshedResources, err := terraformutils.RefreshResources(getResourcesAddresses(provider.GetService().GetResources()), providerWrapper, nil) - if err != nil { - return nil, err - } - provider.GetService().SetResources(getResourcesValues(refreshedResources)) - - for i := range provider.GetService().GetResources() { - err = provider.GetService().GetResources()[i].ConvertTFstate(providerWrapper) - if err != nil { - return nil, err - } - } - provider.GetService().PostRefreshCleanup() - - // change structs with additional data for each resource - err = provider.GetService().PostConvertHook() - if err != nil { - return nil, err - } - return provider.GetService().GetResources(), nil -} - func ImportFromPlan(provider terraformutils.ProviderGenerator, plan *ImportPlan) error { options := plan.Options importedResource := plan.ImportedResource diff --git a/cmd/provider_cmd_aws.go b/cmd/provider_cmd_aws.go index fa168cc61d..7a00c74315 100644 --- a/cmd/provider_cmd_aws.go +++ b/cmd/provider_cmd_aws.go @@ -109,15 +109,7 @@ func importRegionResources(options ImportOptions, originalPathPattern string, re } else { log.Println(provider.GetName() + " importing default region") } - args := []string{region, options.Profile} - - providerWrapper, options, err := initOptionsAndWrapper(provider, options, args) - providersPerResources := make([]terraformutils.ProviderGenerator, len(options.Resources)) - for i := range options.Resources { - providersPerResources[i] = newAWSProvider() - } - err = ImportRoundRobin(providersPerResources, options, args, providerWrapper) - //err := Import(provider, options, []string{region, options.Profile}) + err := Import(provider, options, []string{region, options.Profile}) if err != nil { return err } diff --git a/main_test.go b/main_test.go index 886a62e1b4..b50998bced 100644 --- a/main_test.go +++ b/main_test.go @@ -37,3 +37,33 @@ func TestTerraformerMain(t1 *testing.T) { }) } + +func TestTerraformerMain2(t1 *testing.T) { + t1.Run("run main", func(t1 *testing.T) { + tCommand := cmd.NewCmdRoot() + tCommand.SetArgs([]string{ + "import", + "aws", + //"--regions=sa-east-1", + "--regions=us-west-1", + //"--regions=us-east-1", + //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", + "--resources=\"*\"", + //"--resources=sg", + //"--resources=cloudformation,sg,s3", + //"--resources=cloudformation,sg", + //"--resources=sg,vpc", + //"--resources=kms", + "--profile=nubank", + //"--retry-number=5", + //"--retry-sleep-ms=300", + }) + start := time.Now() + if err := tCommand.Execute(); err != nil { + log.Println(err) + os.Exit(1) + } + log.Printf("Importing took %s", time.Since(start)) + + }) +} diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go new file mode 100644 index 0000000000..ffe17ec7de --- /dev/null +++ b/terraformutils/providers_mapping.go @@ -0,0 +1,151 @@ +package terraformutils + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" + "log" + "math/rand" + "reflect" + "time" +) + +type ProvidersMapping struct { + baseProvider ProviderGenerator + Resources map[*Resource]bool + Services map[string]bool + Providers map[ProviderGenerator]bool + providerToService map[ProviderGenerator]string + serviceToProvider map[string]ProviderGenerator + resourceToProvider map[*Resource]ProviderGenerator +} + +func NewProvidersMapping(baseProvider ProviderGenerator) *ProvidersMapping { + providersMapping := &ProvidersMapping{ + baseProvider: baseProvider, + Resources: map[*Resource]bool{}, + Services: map[string]bool{}, + Providers: map[ProviderGenerator]bool{}, + providerToService: map[ProviderGenerator]string{}, + serviceToProvider: map[string]ProviderGenerator{}, + resourceToProvider: map[*Resource]ProviderGenerator{}, + } + + return providersMapping +} + +func deepCopyProvider(provider ProviderGenerator) ProviderGenerator { + var copy ProviderGenerator + copy = reflect.New(reflect.ValueOf(provider).Elem().Type()).Interface().(ProviderGenerator) + + return copy +} + +func (p *ProvidersMapping) GetBaseProvider() ProviderGenerator { + return p.baseProvider +} + +func (p *ProvidersMapping) AddServiceToProvider(service string) ProviderGenerator { + newProvider := deepCopyProvider(p.baseProvider) + p.Providers[newProvider] = true + p.Services[service] = true + p.providerToService[newProvider] = service + + return newProvider +} + +func (p *ProvidersMapping) GetServices() []string { + services := make([]string, len(p.Services)) + for service := range p.Services { + services = append(services, service) + } + + return services +} + +func (p *ProvidersMapping) RemoveServices(services []string) { + for _, service := range services { + delete(p.Services, service) + + matchingProvider := p.serviceToProvider[service] + delete(p.Providers, matchingProvider) + delete(p.providerToService, matchingProvider) + delete(p.serviceToProvider, service) + } +} + +func (p *ProvidersMapping) ShuffleResources() []*Resource { + resources := []*Resource{} + for resource := range p.Resources { + resources = append(resources, resource) + } + rand.Seed(time.Now().UnixNano()) + rand.Shuffle(len(resources), func(i, j int) { resources[i], resources[j] = resources[j], resources[i] }) + + return resources +} + +func (p *ProvidersMapping) ProcessResources() { + for provider := range p.Providers { + resources := provider.GetService().GetResources() + for i := range resources { + resource := resources[i] + p.Resources[&resource] = true + p.resourceToProvider[&resource] = provider + } + } +} + +func (p *ProvidersMapping) MatchProvider(resource *Resource) ProviderGenerator { + return p.resourceToProvider[resource] +} + +func (p *ProvidersMapping) SetResources(resourceToKeep []*Resource) { + p.Resources = map[*Resource]bool{} + resourcesGroupsByProviders := map[ProviderGenerator][]Resource{} + for i := range resourceToKeep { + resource := resourceToKeep[i] + provider := p.resourceToProvider[resource] + if resourcesGroupsByProviders[provider] == nil { + resourcesGroupsByProviders[provider] = []Resource{} + } + resourcesGroupsByProviders[provider] = append(resourcesGroupsByProviders[provider], *resource) + p.Resources[resource] = true + } + + for provider := range p.Providers { + provider.GetService().SetResources(resourcesGroupsByProviders[provider]) + } +} + +func (p *ProvidersMapping) GetResourcesByService() map[string][]Resource { + mapping := map[string][]Resource{} + for service := range p.Services { + mapping[service] = []Resource{} + } + + for resource := range p.Resources { + provider := p.resourceToProvider[resource] + service := p.providerToService[provider] + mapping[service] = append(mapping[service], *resource) + } + + return mapping +} + +func (p *ProvidersMapping) ConvertTFStates(providerWrapper *providerwrapper.ProviderWrapper) { + for resource := range p.Resources { + err := resource.ConvertTFstate(providerWrapper) + if err != nil { + log.Printf("failed to convert resources %s because of error %s", resource.InstanceInfo.Id, err) + } + } +} + +func (p *ProvidersMapping) CleanupProviders() { + for provider := range p.Providers { + provider.GetService().PostRefreshCleanup() + err := provider.GetService().PostConvertHook() + if err != nil { + log.Printf("failed run PostConvertHook because of error %s", err) + } + } +} diff --git a/terraformutils/utils.go b/terraformutils/utils.go index 317a408f3c..d5d5e05305 100644 --- a/terraformutils/utils.go +++ b/terraformutils/utils.go @@ -16,11 +16,10 @@ package terraformutils import ( "bytes" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" "log" "sync" - "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" - "github.com/hashicorp/terraform/terraform" ) @@ -70,9 +69,7 @@ func RefreshResources(resources []*Resource, provider *providerwrapper.ProviderW input := make(chan *Resource, 100) var wg sync.WaitGroup poolSize := 15 - //if slowProcessingRequired(resources) { - // poolSize = 1 - //} + for i := 0; i < poolSize; i++ { go RefreshResourceWorker(input, &wg, provider) } @@ -117,24 +114,20 @@ func RefreshResources(resources []*Resource, provider *providerwrapper.ProviderW return refreshedResources, nil } -func RefreshResourcesByProvider(resourcesByProvider []map[*Resource]ProviderGenerator, providerWrapper *providerwrapper.ProviderWrapper) (map[*Resource]ProviderGenerator, error) { - flattenedResourcesByProvider := make(map[*Resource]ProviderGenerator) - refreshedResourcesByProvider := make(map[*Resource]ProviderGenerator) +func RefreshResourcesByProvider(providersMapping *ProvidersMapping, providerWrapper *providerwrapper.ProviderWrapper) error { + allResources := providersMapping.ShuffleResources() slowProcessingResources := make(map[ProviderGenerator][]*Resource) - var resources []*Resource - for _, resourceProviderPair := range resourcesByProvider { - for resourcePtr := range resourceProviderPair { - if resourcePtr.SlowQueryRequired { - provider := resourceProviderPair[resourcePtr] - if slowProcessingResources[provider] == nil { - slowProcessingResources[provider] = []*Resource{} - } - slowProcessingResources[provider] = append(slowProcessingResources[provider], resourcePtr) - flattenedResourcesByProvider[resourcePtr] = resourceProviderPair[resourcePtr] - } else { - flattenedResourcesByProvider[resourcePtr] = resourceProviderPair[resourcePtr] - resources = append(resources, resourcePtr) + regularResources := []*Resource{} + for i := range allResources { + resource := allResources[i] + if resource.SlowQueryRequired { + provider := providersMapping.MatchProvider(resource) + if slowProcessingResources[provider] == nil { + slowProcessingResources[provider] = []*Resource{} } + slowProcessingResources[provider] = append(slowProcessingResources[provider], resource) + } else { + regularResources = append(regularResources, resource) } } @@ -143,23 +136,13 @@ func RefreshResourcesByProvider(resourcesByProvider []map[*Resource]ProviderGene spResourcesList = append(spResourcesList, slowProcessingResources[p]) } - refreshedResources, err := RefreshResources(resources, providerWrapper, spResourcesList) + refreshedResources, err := RefreshResources(regularResources, providerWrapper, spResourcesList) if err != nil { - return nil, err - } - for _, r := range refreshedResources { - refreshedResourcesByProvider[r] = flattenedResourcesByProvider[r] + return err } - return refreshedResourcesByProvider, nil -} -func slowProcessingRequired(resources []*Resource) bool { - for _, r := range resources { - if r.SlowQueryRequired { - return true - } - } - return false + providersMapping.SetResources(refreshedResources) + return nil } func RefreshResourceWorker(input chan *Resource, wg *sync.WaitGroup, provider *providerwrapper.ProviderWrapper) { From 4f2825dea4ba9937c3dc2389e9b0155c0df72563 Mon Sep 17 00:00:00 2001 From: rotemavni Date: Tue, 19 Jan 2021 18:18:11 +0200 Subject: [PATCH 027/276] fixed problem with provider_mapping --- main_test.go | 4 ++-- terraformutils/providers_mapping.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main_test.go b/main_test.go index b50998bced..87a7a5cb7b 100644 --- a/main_test.go +++ b/main_test.go @@ -48,11 +48,11 @@ func TestTerraformerMain2(t1 *testing.T) { "--regions=us-west-1", //"--regions=us-east-1", //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", - "--resources=\"*\"", + //"--resources=\"*\"", //"--resources=sg", //"--resources=cloudformation,sg,s3", //"--resources=cloudformation,sg", - //"--resources=sg,vpc", + "--resources=sg,vpc,codepipeline,efs,ebs", //"--resources=kms", "--profile=nubank", //"--retry-number=5", diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go index ffe17ec7de..3936dbdb2f 100644 --- a/terraformutils/providers_mapping.go +++ b/terraformutils/providers_mapping.go @@ -48,6 +48,7 @@ func (p *ProvidersMapping) AddServiceToProvider(service string) ProviderGenerato p.Providers[newProvider] = true p.Services[service] = true p.providerToService[newProvider] = service + p.serviceToProvider[service] = newProvider return newProvider } @@ -86,6 +87,7 @@ func (p *ProvidersMapping) ShuffleResources() []*Resource { func (p *ProvidersMapping) ProcessResources() { for provider := range p.Providers { resources := provider.GetService().GetResources() + log.Printf("num of resources for service %s: %d", p.providerToService[provider], len(provider.GetService().GetResources())) for i := range resources { resource := resources[i] p.Resources[&resource] = true From c47bdf9e1e6f7d1d1b5fc4b436920931e8496412 Mon Sep 17 00:00:00 2001 From: rotemavni Date: Tue, 19 Jan 2021 18:18:24 +0200 Subject: [PATCH 028/276] deleted main_test.go --- main_test.go | 69 ---------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 main_test.go diff --git a/main_test.go b/main_test.go deleted file mode 100644 index 87a7a5cb7b..0000000000 --- a/main_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package main - -import ( - "github.com/GoogleCloudPlatform/terraformer/cmd" - "log" - "os" - "testing" - "time" -) - -func TestTerraformerMain(t1 *testing.T) { - t1.Run("run main", func(t1 *testing.T) { - tCommand := cmd.NewCmdRoot() - tCommand.SetArgs([]string{ - "import", - "aws", - "--regions=sa-east-1", - //"--regions=us-west-1", - //"--regions=us-east-1", - //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", - "--resources=\"*\"", - //"--resources=sg", - //"--resources=cloudformation,sg,s3", - //"--resources=cloudformation,sg", - //"--resources=sg,vpc", - //"--resources=kms", - "--profile=nubank", - //"--retry-number=5", - //"--retry-sleep-ms=300", - }) - start := time.Now() - if err := tCommand.Execute(); err != nil { - log.Println(err) - os.Exit(1) - } - log.Printf("Importing took %s", time.Since(start)) - - }) -} - -func TestTerraformerMain2(t1 *testing.T) { - t1.Run("run main", func(t1 *testing.T) { - tCommand := cmd.NewCmdRoot() - tCommand.SetArgs([]string{ - "import", - "aws", - //"--regions=sa-east-1", - "--regions=us-west-1", - //"--regions=us-east-1", - //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", - //"--resources=\"*\"", - //"--resources=sg", - //"--resources=cloudformation,sg,s3", - //"--resources=cloudformation,sg", - "--resources=sg,vpc,codepipeline,efs,ebs", - //"--resources=kms", - "--profile=nubank", - //"--retry-number=5", - //"--retry-sleep-ms=300", - }) - start := time.Now() - if err := tCommand.Execute(); err != nil { - log.Println(err) - os.Exit(1) - } - log.Printf("Importing took %s", time.Since(start)) - - }) -} From 74272869ef22e0537b128dd23eb5487ab5090236 Mon Sep 17 00:00:00 2001 From: rotemavni Date: Tue, 19 Jan 2021 18:20:42 +0200 Subject: [PATCH 029/276] Revert "deleted main_test.go" This reverts commit c47bdf9e --- main_test.go | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 main_test.go diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000000..87a7a5cb7b --- /dev/null +++ b/main_test.go @@ -0,0 +1,69 @@ +package main + +import ( + "github.com/GoogleCloudPlatform/terraformer/cmd" + "log" + "os" + "testing" + "time" +) + +func TestTerraformerMain(t1 *testing.T) { + t1.Run("run main", func(t1 *testing.T) { + tCommand := cmd.NewCmdRoot() + tCommand.SetArgs([]string{ + "import", + "aws", + "--regions=sa-east-1", + //"--regions=us-west-1", + //"--regions=us-east-1", + //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", + "--resources=\"*\"", + //"--resources=sg", + //"--resources=cloudformation,sg,s3", + //"--resources=cloudformation,sg", + //"--resources=sg,vpc", + //"--resources=kms", + "--profile=nubank", + //"--retry-number=5", + //"--retry-sleep-ms=300", + }) + start := time.Now() + if err := tCommand.Execute(); err != nil { + log.Println(err) + os.Exit(1) + } + log.Printf("Importing took %s", time.Since(start)) + + }) +} + +func TestTerraformerMain2(t1 *testing.T) { + t1.Run("run main", func(t1 *testing.T) { + tCommand := cmd.NewCmdRoot() + tCommand.SetArgs([]string{ + "import", + "aws", + //"--regions=sa-east-1", + "--regions=us-west-1", + //"--regions=us-east-1", + //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", + //"--resources=\"*\"", + //"--resources=sg", + //"--resources=cloudformation,sg,s3", + //"--resources=cloudformation,sg", + "--resources=sg,vpc,codepipeline,efs,ebs", + //"--resources=kms", + "--profile=nubank", + //"--retry-number=5", + //"--retry-sleep-ms=300", + }) + start := time.Now() + if err := tCommand.Execute(); err != nil { + log.Println(err) + os.Exit(1) + } + log.Printf("Importing took %s", time.Since(start)) + + }) +} From dc94acd78e70c724746109226be1d1ea026f2d2c Mon Sep 17 00:00:00 2001 From: rotemavni Date: Tue, 19 Jan 2021 18:28:04 +0200 Subject: [PATCH 030/276] Revert "Revert "deleted main_test.go"" This reverts commit 74272869 --- main_test.go | 69 ---------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 main_test.go diff --git a/main_test.go b/main_test.go deleted file mode 100644 index 87a7a5cb7b..0000000000 --- a/main_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package main - -import ( - "github.com/GoogleCloudPlatform/terraformer/cmd" - "log" - "os" - "testing" - "time" -) - -func TestTerraformerMain(t1 *testing.T) { - t1.Run("run main", func(t1 *testing.T) { - tCommand := cmd.NewCmdRoot() - tCommand.SetArgs([]string{ - "import", - "aws", - "--regions=sa-east-1", - //"--regions=us-west-1", - //"--regions=us-east-1", - //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", - "--resources=\"*\"", - //"--resources=sg", - //"--resources=cloudformation,sg,s3", - //"--resources=cloudformation,sg", - //"--resources=sg,vpc", - //"--resources=kms", - "--profile=nubank", - //"--retry-number=5", - //"--retry-sleep-ms=300", - }) - start := time.Now() - if err := tCommand.Execute(); err != nil { - log.Println(err) - os.Exit(1) - } - log.Printf("Importing took %s", time.Since(start)) - - }) -} - -func TestTerraformerMain2(t1 *testing.T) { - t1.Run("run main", func(t1 *testing.T) { - tCommand := cmd.NewCmdRoot() - tCommand.SetArgs([]string{ - "import", - "aws", - //"--regions=sa-east-1", - "--regions=us-west-1", - //"--regions=us-east-1", - //"--regions=ap-northeast-1,eu-central-1,eu-west-1,us-east-1,af-south-1,ap-northeast-2,eu-west-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-southeast-2,ca-central-1,sa-east-1,us-east-2,ap-southeast-1,aws-global,eu-north-1,eu-south-1,eu-west-3,me-south-1", - //"--resources=\"*\"", - //"--resources=sg", - //"--resources=cloudformation,sg,s3", - //"--resources=cloudformation,sg", - "--resources=sg,vpc,codepipeline,efs,ebs", - //"--resources=kms", - "--profile=nubank", - //"--retry-number=5", - //"--retry-sleep-ms=300", - }) - start := time.Now() - if err := tCommand.Execute(); err != nil { - log.Println(err) - os.Exit(1) - } - log.Printf("Importing took %s", time.Since(start)) - - }) -} From 9c32a1f787223d83683c35bc1c39250bc6fc31d5 Mon Sep 17 00:00:00 2001 From: rotemavni Date: Tue, 19 Jan 2021 18:39:20 +0200 Subject: [PATCH 031/276] refactored initAllServicesResources, added flags to README.md --- README.md | 2 ++ cmd/import.go | 20 +++----------------- terraformutils/providers_mapping.go | 4 ++-- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8acd5fe220..698bf964ba 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Flags: -r, --resources strings firewall,networks or * for all services -s, --state string local or bucket (default "local") -v, --verbose verbose mode + -n, --retry-number number of retries to perform if refresh fails + -m, --retry-sleep-ms time in ms to sleep between retries Use " import [provider] [command] --help" for more information about a command. ``` diff --git a/cmd/import.go b/cmd/import.go index 935d6afe2c..ea75df00bb 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -148,7 +148,7 @@ func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, var wg sync.WaitGroup wg.Add(numOfResources) - failedServicesChan := make(chan string, numOfResources) + failedServices := make(chan string, numOfResources) for _, service := range options.Resources { serviceProvider := providersMapping.AddServiceToProvider(service) @@ -156,17 +156,12 @@ func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, if err != nil { return err } - go initServiceResourcesWorker(service, serviceProvider, options, providerWrapper, &wg, failedServicesChan) + go initServiceResourcesWorker(service, serviceProvider, options, providerWrapper, &wg, failedServices) } wg.Wait() - close(failedServicesChan) + close(failedServices) // remove providers that failed to init their service - var failedServices []string - for failedService := range failedServicesChan { - failedServices = append(failedServices, failedService) - } - providersMapping.RemoveServices(failedServices) providersMapping.ProcessResources() @@ -219,15 +214,6 @@ func initServiceResourcesWorker(service string, provider terraformutils.Provider wg.Done() } -func getResourcesAddresses(resources []terraformutils.Resource) []*terraformutils.Resource { - results := []*terraformutils.Resource{} - for i := range resources { - results = append(results, &resources[i]) - } - - return results -} - func ImportFromPlan(provider terraformutils.ProviderGenerator, plan *ImportPlan) error { options := plan.Options importedResource := plan.ImportedResource diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go index 3936dbdb2f..26e143c48b 100644 --- a/terraformutils/providers_mapping.go +++ b/terraformutils/providers_mapping.go @@ -62,8 +62,8 @@ func (p *ProvidersMapping) GetServices() []string { return services } -func (p *ProvidersMapping) RemoveServices(services []string) { - for _, service := range services { +func (p *ProvidersMapping) RemoveServices(services chan string) { + for service := range services { delete(p.Services, service) matchingProvider := p.serviceToProvider[service] From 2667d2c7be5d1ca8d2ccbff7488cad00c6cbb864 Mon Sep 17 00:00:00 2001 From: rotemavni Date: Wed, 20 Jan 2021 09:28:52 +0200 Subject: [PATCH 032/276] fixed linters and problem with PostConvertHook --- cmd/import.go | 3 ++- terraformutils/providers_mapping.go | 22 +++++++++++++++++----- terraformutils/utils.go | 3 ++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/cmd/import.go b/cmd/import.go index ea75df00bb..ad16e66f48 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -15,7 +15,6 @@ package cmd import ( "fmt" - "github.com/GoogleCloudPlatform/terraformer/terraformutils/terraformerstring" "io/ioutil" "log" "os" @@ -23,6 +22,8 @@ import ( "strings" "sync" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/terraformerstring" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" "github.com/spf13/pflag" diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go index 26e143c48b..13d8f686fb 100644 --- a/terraformutils/providers_mapping.go +++ b/terraformutils/providers_mapping.go @@ -1,11 +1,12 @@ package terraformutils import ( - "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" "log" "math/rand" "reflect" "time" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" ) type ProvidersMapping struct { @@ -33,10 +34,7 @@ func NewProvidersMapping(baseProvider ProviderGenerator) *ProvidersMapping { } func deepCopyProvider(provider ProviderGenerator) ProviderGenerator { - var copy ProviderGenerator - copy = reflect.New(reflect.ValueOf(provider).Elem().Type()).Interface().(ProviderGenerator) - - return copy + return reflect.New(reflect.ValueOf(provider).Elem().Type()).Interface().(ProviderGenerator) } func (p *ProvidersMapping) GetBaseProvider() ProviderGenerator { @@ -140,6 +138,20 @@ func (p *ProvidersMapping) ConvertTFStates(providerWrapper *providerwrapper.Prov log.Printf("failed to convert resources %s because of error %s", resource.InstanceInfo.Id, err) } } + + resourcesGroupsByProviders := map[ProviderGenerator][]Resource{} + for resource := range p.Resources { + provider := p.resourceToProvider[resource] + if resourcesGroupsByProviders[provider] == nil { + resourcesGroupsByProviders[provider] = []Resource{} + } + resourcesGroupsByProviders[provider] = append(resourcesGroupsByProviders[provider], *resource) + } + + for provider := range p.Providers { + provider.GetService().SetResources(resourcesGroupsByProviders[provider]) + } + } func (p *ProvidersMapping) CleanupProviders() { diff --git a/terraformutils/utils.go b/terraformutils/utils.go index d5d5e05305..4da9420b64 100644 --- a/terraformutils/utils.go +++ b/terraformutils/utils.go @@ -16,10 +16,11 @@ package terraformutils import ( "bytes" - "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" "log" "sync" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" + "github.com/hashicorp/terraform/terraform" ) From 319532933f4117b35653cf5cab68c7615373383f Mon Sep 17 00:00:00 2001 From: rotemavni <52502521+rotemavni@users.noreply.github.com> Date: Wed, 20 Jan 2021 11:27:30 +0200 Subject: [PATCH 033/276] Refactor refresh mechanism (#55) * stable version * code cleanup + use provider_mapping * fixed problem with provider_mapping * deleted main_test.go * Revert "deleted main_test.go" This reverts commit c47bdf9e * Revert "Revert "deleted main_test.go"" This reverts commit 74272869 * refactored initAllServicesResources, added flags to README.md * fixed linters and problem with PostConvertHook --- README.md | 2 + cmd/import.go | 125 +++++++++++----- terraformutils/providers_mapping.go | 165 +++++++++++++++++++++ terraformutils/providerwrapper/provider.go | 19 ++- terraformutils/utils.go | 67 +++++++-- 5 files changed, 323 insertions(+), 55 deletions(-) create mode 100644 terraformutils/providers_mapping.go diff --git a/README.md b/README.md index 8acd5fe220..698bf964ba 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Flags: -r, --resources strings firewall,networks or * for all services -s, --state string local or bucket (default "local") -v, --verbose verbose mode + -n, --retry-number number of retries to perform if refresh fails + -m, --retry-sleep-ms time in ms to sleep between retries Use " import [provider] [command] --help" for more information about a command. ``` diff --git a/cmd/import.go b/cmd/import.go index 8e8ed0034e..ad16e66f48 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -20,6 +20,7 @@ import ( "os" "sort" "strings" + "sync" "github.com/GoogleCloudPlatform/terraformer/terraformutils/terraformerstring" @@ -51,6 +52,8 @@ type ImportOptions struct { Filter []string Plan bool `json:"-"` Output string + RetryCount int + RetrySleepMs int } const DefaultPathPattern = "{output}/{provider}/{service}/" @@ -78,16 +81,37 @@ func newImportCmd() *cobra.Command { } func Import(provider terraformutils.ProviderGenerator, options ImportOptions, args []string) error { - err := provider.Init(args) + + providerWrapper, options, err := initOptionsAndWrapper(provider, options, args) if err != nil { return err } + defer providerWrapper.Kill() + providerMapping := terraformutils.NewProvidersMapping(provider) - plan := &ImportPlan{ - Provider: provider.GetName(), - Options: options, - Args: args, - ImportedResource: map[string][]terraformutils.Resource{}, + err = initAllServicesResources(providerMapping, options, args, providerWrapper) + if err != nil { + return err + } + + err = terraformutils.RefreshResourcesByProvider(providerMapping, providerWrapper) + if err != nil { + return err + } + + providerMapping.ConvertTFStates(providerWrapper) + // change structs with additional data for each resource + providerMapping.CleanupProviders() + + err = importFromPlan(providerMapping, options, args) + + return err +} + +func initOptionsAndWrapper(provider terraformutils.ProviderGenerator, options ImportOptions, args []string) (*providerwrapper.ProviderWrapper, ImportOptions, error) { + err := provider.Init(args) + if err != nil { + return nil, options, err } if terraformerstring.ContainsString(options.Resources, "*") { @@ -112,64 +136,83 @@ func Import(provider terraformutils.ProviderGenerator, options ImportOptions, ar options.Resources = localSlice } - providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose) + providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose, options.RetryCount, options.RetrySleepMs) if err != nil { - return err + return nil, options, err } - defer providerWrapper.Kill() + return providerWrapper, options, nil +} + +func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, options ImportOptions, args []string, providerWrapper *providerwrapper.ProviderWrapper) error { + numOfResources := len(options.Resources) + var wg sync.WaitGroup + wg.Add(numOfResources) + + failedServices := make(chan string, numOfResources) for _, service := range options.Resources { - resources, err := buildServiceResources(service, provider, options, providerWrapper) + serviceProvider := providersMapping.AddServiceToProvider(service) + err := serviceProvider.Init(args) if err != nil { - log.Println(err) - continue + return err } - plan.ImportedResource[service] = append(plan.ImportedResource[service], resources...) + go initServiceResourcesWorker(service, serviceProvider, options, providerWrapper, &wg, failedServices) + } + wg.Wait() + close(failedServices) + + // remove providers that failed to init their service + providersMapping.RemoveServices(failedServices) + providersMapping.ProcessResources() + + return nil +} + +func importFromPlan(providerMapping *terraformutils.ProvidersMapping, options ImportOptions, args []string) error { + plan := &ImportPlan{ + Provider: providerMapping.GetBaseProvider().GetName(), + Options: options, + Args: args, + ImportedResource: map[string][]terraformutils.Resource{}, + } + + resourcesByService := providerMapping.GetResourcesByService() + for service := range resourcesByService { + plan.ImportedResource[service] = append(plan.ImportedResource[service], resourcesByService[service]...) } + if options.Plan { - path := Path(options.PathPattern, provider.GetName(), "terraformer", options.PathOutput) + path := Path(options.PathPattern, providerMapping.GetBaseProvider().GetName(), "terraformer", options.PathOutput) return ExportPlanFile(plan, path, "plan.json") } - return ImportFromPlan(provider, plan) + + return ImportFromPlan(providerMapping.GetBaseProvider(), plan) } -func buildServiceResources(service string, provider terraformutils.ProviderGenerator, - options ImportOptions, providerWrapper *providerwrapper.ProviderWrapper) ([]terraformutils.Resource, error) { +func initServiceResourcesWorker(service string, provider terraformutils.ProviderGenerator, + options ImportOptions, providerWrapper *providerwrapper.ProviderWrapper, wg *sync.WaitGroup, failedServices chan string) { log.Println(provider.GetName() + " importing... " + service) err := provider.InitService(service, options.Verbose) if err != nil { - return nil, err + failedServices <- service + log.Printf("%s error importing %s, err: %s\n", provider.GetName(), service, err) + wg.Done() + return } provider.GetService().ParseFilters(options.Filter) err = provider.GetService().InitResources() if err != nil { - return nil, err + failedServices <- service + log.Printf("%s error initializing resources in service %s, err: %s\n", provider.GetName(), service, err) + wg.Done() + return } provider.GetService().PopulateIgnoreKeys(providerWrapper) provider.GetService().InitialCleanup() - - refreshedResources, err := terraformutils.RefreshResources(provider.GetService().GetResources(), providerWrapper) - if err != nil { - return nil, err - } - provider.GetService().SetResources(refreshedResources) - - for i := range provider.GetService().GetResources() { - err = provider.GetService().GetResources()[i].ConvertTFstate(providerWrapper) - if err != nil { - return nil, err - } - } - provider.GetService().PostRefreshCleanup() - - // change structs with additional data for each resource - err = provider.GetService().PostConvertHook() - if err != nil { - return nil, err - } - return provider.GetService().GetResources(), nil + log.Println(provider.GetName() + " done importing " + service) + wg.Done() } func ImportFromPlan(provider terraformutils.ProviderGenerator, plan *ImportPlan) error { @@ -358,4 +401,6 @@ func baseProviderFlags(flag *pflag.FlagSet, options *ImportOptions, sampleRes, s flag.StringSliceVarP(&options.Filter, "filter", "f", []string{}, sampleFilters) flag.BoolVarP(&options.Verbose, "verbose", "v", false, "") flag.StringVarP(&options.Output, "output", "O", "hcl", "output format hcl or json") + flag.IntVarP(&options.RetryCount, "retry-number", "n", 5, "number of retries to perform when refresh fails") + flag.IntVarP(&options.RetrySleepMs, "retry-sleep-ms", "m", 300, "time in ms to sleep between retries") } diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go new file mode 100644 index 0000000000..13d8f686fb --- /dev/null +++ b/terraformutils/providers_mapping.go @@ -0,0 +1,165 @@ +package terraformutils + +import ( + "log" + "math/rand" + "reflect" + "time" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" +) + +type ProvidersMapping struct { + baseProvider ProviderGenerator + Resources map[*Resource]bool + Services map[string]bool + Providers map[ProviderGenerator]bool + providerToService map[ProviderGenerator]string + serviceToProvider map[string]ProviderGenerator + resourceToProvider map[*Resource]ProviderGenerator +} + +func NewProvidersMapping(baseProvider ProviderGenerator) *ProvidersMapping { + providersMapping := &ProvidersMapping{ + baseProvider: baseProvider, + Resources: map[*Resource]bool{}, + Services: map[string]bool{}, + Providers: map[ProviderGenerator]bool{}, + providerToService: map[ProviderGenerator]string{}, + serviceToProvider: map[string]ProviderGenerator{}, + resourceToProvider: map[*Resource]ProviderGenerator{}, + } + + return providersMapping +} + +func deepCopyProvider(provider ProviderGenerator) ProviderGenerator { + return reflect.New(reflect.ValueOf(provider).Elem().Type()).Interface().(ProviderGenerator) +} + +func (p *ProvidersMapping) GetBaseProvider() ProviderGenerator { + return p.baseProvider +} + +func (p *ProvidersMapping) AddServiceToProvider(service string) ProviderGenerator { + newProvider := deepCopyProvider(p.baseProvider) + p.Providers[newProvider] = true + p.Services[service] = true + p.providerToService[newProvider] = service + p.serviceToProvider[service] = newProvider + + return newProvider +} + +func (p *ProvidersMapping) GetServices() []string { + services := make([]string, len(p.Services)) + for service := range p.Services { + services = append(services, service) + } + + return services +} + +func (p *ProvidersMapping) RemoveServices(services chan string) { + for service := range services { + delete(p.Services, service) + + matchingProvider := p.serviceToProvider[service] + delete(p.Providers, matchingProvider) + delete(p.providerToService, matchingProvider) + delete(p.serviceToProvider, service) + } +} + +func (p *ProvidersMapping) ShuffleResources() []*Resource { + resources := []*Resource{} + for resource := range p.Resources { + resources = append(resources, resource) + } + rand.Seed(time.Now().UnixNano()) + rand.Shuffle(len(resources), func(i, j int) { resources[i], resources[j] = resources[j], resources[i] }) + + return resources +} + +func (p *ProvidersMapping) ProcessResources() { + for provider := range p.Providers { + resources := provider.GetService().GetResources() + log.Printf("num of resources for service %s: %d", p.providerToService[provider], len(provider.GetService().GetResources())) + for i := range resources { + resource := resources[i] + p.Resources[&resource] = true + p.resourceToProvider[&resource] = provider + } + } +} + +func (p *ProvidersMapping) MatchProvider(resource *Resource) ProviderGenerator { + return p.resourceToProvider[resource] +} + +func (p *ProvidersMapping) SetResources(resourceToKeep []*Resource) { + p.Resources = map[*Resource]bool{} + resourcesGroupsByProviders := map[ProviderGenerator][]Resource{} + for i := range resourceToKeep { + resource := resourceToKeep[i] + provider := p.resourceToProvider[resource] + if resourcesGroupsByProviders[provider] == nil { + resourcesGroupsByProviders[provider] = []Resource{} + } + resourcesGroupsByProviders[provider] = append(resourcesGroupsByProviders[provider], *resource) + p.Resources[resource] = true + } + + for provider := range p.Providers { + provider.GetService().SetResources(resourcesGroupsByProviders[provider]) + } +} + +func (p *ProvidersMapping) GetResourcesByService() map[string][]Resource { + mapping := map[string][]Resource{} + for service := range p.Services { + mapping[service] = []Resource{} + } + + for resource := range p.Resources { + provider := p.resourceToProvider[resource] + service := p.providerToService[provider] + mapping[service] = append(mapping[service], *resource) + } + + return mapping +} + +func (p *ProvidersMapping) ConvertTFStates(providerWrapper *providerwrapper.ProviderWrapper) { + for resource := range p.Resources { + err := resource.ConvertTFstate(providerWrapper) + if err != nil { + log.Printf("failed to convert resources %s because of error %s", resource.InstanceInfo.Id, err) + } + } + + resourcesGroupsByProviders := map[ProviderGenerator][]Resource{} + for resource := range p.Resources { + provider := p.resourceToProvider[resource] + if resourcesGroupsByProviders[provider] == nil { + resourcesGroupsByProviders[provider] = []Resource{} + } + resourcesGroupsByProviders[provider] = append(resourcesGroupsByProviders[provider], *resource) + } + + for provider := range p.Providers { + provider.GetService().SetResources(resourcesGroupsByProviders[provider]) + } + +} + +func (p *ProvidersMapping) CleanupProviders() { + for provider := range p.Providers { + provider.GetService().PostRefreshCleanup() + err := provider.GetService().PostConvertHook() + if err != nil { + log.Printf("failed run PostConvertHook because of error %s", err) + } + } +} diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index 2165e895fd..30fb5efb1f 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -56,12 +56,23 @@ type ProviderWrapper struct { providerName string config cty.Value schema *providers.GetSchemaResponse + retryCount int + retrySleepMs int } -func NewProviderWrapper(providerName string, providerConfig cty.Value, verbose bool) (*ProviderWrapper, error) { +func NewProviderWrapper(providerName string, providerConfig cty.Value, verbose bool, retryOptions ...int) (*ProviderWrapper, error) { p := &ProviderWrapper{} p.providerName = providerName p.config = providerConfig + + if len(retryOptions) == 2 { + p.retryCount = retryOptions[0] + p.retrySleepMs = retryOptions[1] + } else { + p.retryCount = 5 + p.retrySleepMs = 300 + } + err := p.initProvider(verbose) return p, err @@ -149,15 +160,15 @@ func (p *ProviderWrapper) Refresh(info *terraform.InstanceInfo, state *terraform } successReadResource := false resp := providers.ReadResourceResponse{} - for i := 0; i < 5; i++ { + for i := 0; i < p.retryCount; i++ { resp = p.Provider.ReadResource(providers.ReadResourceRequest{ TypeName: info.Type, PriorState: priorState, Private: []byte{}, }) if resp.Diagnostics.HasErrors() { - log.Println("WARN: Fail read resource from provider, wait 300ms before retry") - time.Sleep(300 * time.Millisecond) + log.Printf("WARN: Fail read resource from provider, wait %dms before retry\n", p.retrySleepMs) + time.Sleep(time.Duration(p.retrySleepMs) * time.Millisecond) continue } else { successReadResource = true diff --git a/terraformutils/utils.go b/terraformutils/utils.go index 0ac39c72fa..4da9420b64 100644 --- a/terraformutils/utils.go +++ b/terraformutils/utils.go @@ -65,21 +65,33 @@ func PrintTfState(resources []Resource) ([]byte, error) { return buf.Bytes(), err } -func RefreshResources(resources []Resource, provider *providerwrapper.ProviderWrapper) ([]Resource, error) { - refreshedResources := []Resource{} +func RefreshResources(resources []*Resource, provider *providerwrapper.ProviderWrapper, slowProcessingResources [][]*Resource) ([]*Resource, error) { + refreshedResources := []*Resource{} input := make(chan *Resource, 100) var wg sync.WaitGroup poolSize := 15 - if slowProcessingRequired(resources) { - poolSize = 1 - } + for i := 0; i < poolSize; i++ { go RefreshResourceWorker(input, &wg, provider) } for i := range resources { wg.Add(1) - input <- &resources[i] + input <- resources[i] + } + + spInputs := []chan *Resource{} + for i, resourceGroup := range slowProcessingResources { + spInputs = append(spInputs, make(chan *Resource, 100)) + for j := range resourceGroup { + spInputs[i] <- resourceGroup[j] + } + } + + for i := 0; i < len(spInputs); i++ { + go RefreshResourceWorker(spInputs[i], &wg, provider) + wg.Add(len(slowProcessingResources[i])) } + wg.Wait() close(input) for _, r := range resources { @@ -89,16 +101,49 @@ func RefreshResources(resources []Resource, provider *providerwrapper.ProviderWr log.Printf("ERROR: Unable to refresh resource %s", r.ResourceName) } } + + for _, resourceGroup := range slowProcessingResources { + for i := range resourceGroup { + r := resourceGroup[i] + if r.InstanceState != nil && r.InstanceState.ID != "" { + refreshedResources = append(refreshedResources, r) + } else { + log.Printf("ERROR: Unable to refresh resource %s", r.ResourceName) + } + } + } return refreshedResources, nil } -func slowProcessingRequired(resources []Resource) bool { - for _, r := range resources { - if r.SlowQueryRequired { - return true +func RefreshResourcesByProvider(providersMapping *ProvidersMapping, providerWrapper *providerwrapper.ProviderWrapper) error { + allResources := providersMapping.ShuffleResources() + slowProcessingResources := make(map[ProviderGenerator][]*Resource) + regularResources := []*Resource{} + for i := range allResources { + resource := allResources[i] + if resource.SlowQueryRequired { + provider := providersMapping.MatchProvider(resource) + if slowProcessingResources[provider] == nil { + slowProcessingResources[provider] = []*Resource{} + } + slowProcessingResources[provider] = append(slowProcessingResources[provider], resource) + } else { + regularResources = append(regularResources, resource) } } - return false + + var spResourcesList [][]*Resource + for p := range slowProcessingResources { + spResourcesList = append(spResourcesList, slowProcessingResources[p]) + } + + refreshedResources, err := RefreshResources(regularResources, providerWrapper, spResourcesList) + if err != nil { + return err + } + + providersMapping.SetResources(refreshedResources) + return nil } func RefreshResourceWorker(input chan *Resource, wg *sync.WaitGroup, provider *providerwrapper.ProviderWrapper) { From 5473d7bcaca164686580f28d7b259d4e174e137f Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 11:13:14 -0500 Subject: [PATCH 034/276] add cloud integration resources --- providers/datadog/datadog_provider.go | 19 +++-- providers/datadog/integration_aws.go | 69 +++++++++++++++++ .../datadog/integration_aws_lambda_arn.go | 73 ++++++++++++++++++ .../datadog/integration_aws_log_collection.go | 77 +++++++++++++++++++ providers/datadog/integration_azure.go | 68 ++++++++++++++++ providers/datadog/integration_gcp.go | 68 ++++++++++++++++ 6 files changed, 367 insertions(+), 7 deletions(-) create mode 100644 providers/datadog/integration_aws.go create mode 100644 providers/datadog/integration_aws_lambda_arn.go create mode 100644 providers/datadog/integration_aws_log_collection.go create mode 100644 providers/datadog/integration_azure.go create mode 100644 providers/datadog/integration_gcp.go diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 2199e20bff..3ee23b9456 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -137,13 +137,18 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { // GetSupportedService return map of support service for Datadog func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "dashboard": &DashboardGenerator{}, - "downtime": &DowntimeGenerator{}, - "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, - "synthetics": &SyntheticsGenerator{}, - "timeboard": &TimeboardGenerator{}, - "user": &UserGenerator{}, + "dashboard": &DashboardGenerator{}, + "downtime": &DowntimeGenerator{}, + "integration_aws": &IntegrationAWSGenerator{}, + "integration_aws_lambda_arn": &IntegrationAWSLambdaARNGenerator{}, + "integration_aws_log_collection": &IntegrationAWSLogCollectionGenerator{}, + "integration_azure": &IntegrationAzureGenerator{}, + "integration_gcp": &IntegrationGCPGenerator{}, + "monitor": &MonitorGenerator{}, + "screenboard": &ScreenboardGenerator{}, + "synthetics": &SyntheticsGenerator{}, + "timeboard": &TimeboardGenerator{}, + "user": &UserGenerator{}, } } diff --git a/providers/datadog/integration_aws.go b/providers/datadog/integration_aws.go new file mode 100644 index 0000000000..e181cfe52f --- /dev/null +++ b/providers/datadog/integration_aws.go @@ -0,0 +1,69 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationAWSAllowEmptyValues ... + IntegrationAWSAllowEmptyValues = []string{} +) + +// IntegrationAWSGenerator ... +type IntegrationAWSGenerator struct { + DatadogService +} + +func (g *IntegrationAWSGenerator) createResources(AWSAccounts []datadogV1.AWSAccount) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, account := range AWSAccounts { + resourceID := fmt.Sprintf("%s:%s", account.GetAccountId(), account.GetRoleName()) + resources = append(resources, g.createResource(resourceID)) + } + + return resources +} + +func (g *IntegrationAWSGenerator) createResource(resourceID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + resourceID, + fmt.Sprintf("integration_aws_%s", resourceID), + "datadog_integration_aws", + "datadog", + IntegrationAWSAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each monitor create 1 TerraformResource. +// Need IntegrationAWS ID formatted as ':' as ID for terraform resource +func (g *IntegrationAWSGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + integrations, _, err := datadogClientV1.AWSIntegrationApi.ListAWSAccounts(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(integrations.GetAccounts()) + return nil +} diff --git a/providers/datadog/integration_aws_lambda_arn.go b/providers/datadog/integration_aws_lambda_arn.go new file mode 100644 index 0000000000..5acbf6f42e --- /dev/null +++ b/providers/datadog/integration_aws_lambda_arn.go @@ -0,0 +1,73 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationAWSLambdaARNAllowEmptyValues ... + IntegrationAWSLambdaARNAllowEmptyValues = []string{} +) + +// IntegrationAWSLambdaARNGenerator ... +type IntegrationAWSLambdaARNGenerator struct { + DatadogService +} + +func (g *IntegrationAWSLambdaARNGenerator) createResources(logCollections []datadogV1.AWSLogsListResponse) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, logCollection := range logCollections { + for _, logCollectionLambdaArn := range logCollection.GetLambdas() { + accountID := logCollection.GetAccountId() + if v, ok := logCollectionLambdaArn.GetArnOk(); ok { + resourceID := fmt.Sprintf("%s %s", accountID, *v) + resources = append(resources, g.createResource(resourceID)) + } + } + } + return resources +} + +func (g *IntegrationAWSLambdaARNGenerator) createResource(resourceID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + resourceID, + fmt.Sprintf("integration_aws_lambda_arn_%s", resourceID), + "datadog_integration_aws_lambda_arn", + "datadog", + IntegrationAWSLambdaARNAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each monitor create 1 TerraformResource. +// Need IntegrationAWSLambdaARN ID formatted as ':' as ID for terraform resource +func (g *IntegrationAWSLambdaARNGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + logCollections, _, err := datadogClientV1.AWSLogsIntegrationApi.ListAWSLogsIntegrations(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(logCollections) + return nil +} diff --git a/providers/datadog/integration_aws_log_collection.go b/providers/datadog/integration_aws_log_collection.go new file mode 100644 index 0000000000..d7a957c085 --- /dev/null +++ b/providers/datadog/integration_aws_log_collection.go @@ -0,0 +1,77 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationAWSLogCollectionAllowEmptyValues ... + IntegrationAWSLogCollectionAllowEmptyValues = []string{"services"} +) + +// IntegrationAWSLogCollectionGenerator ... +type IntegrationAWSLogCollectionGenerator struct { + DatadogService +} + +func (g *IntegrationAWSLogCollectionGenerator) createResources(logCollections []datadogV1.AWSLogsListResponse) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, logCollection := range logCollections { + resourceID := logCollection.GetAccountId() + resources = append(resources, g.createResource(resourceID)) + } + return resources +} + +func (g *IntegrationAWSLogCollectionGenerator) createResource(resourceID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + resourceID, + fmt.Sprintf("integration_aws_log_collection_%s", resourceID), + "datadog_integration_aws_log_collection", + "datadog", + IntegrationAWSLogCollectionAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each monitor create 1 TerraformResource. +// Need IntegrationAWSLogCollection ID formatted as ':' as ID for terraform resource +func (g *IntegrationAWSLogCollectionGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + logCollections, _, err := datadogClientV1.AWSLogsIntegrationApi.ListAWSLogsIntegrations(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(logCollections) + return nil +} + +func (g *IntegrationAWSLogCollectionGenerator) PostConvertHook() error { + for _, r := range g.Resources { + // services is a required attribute but can be empty. This ensures we append an empty list + if r.Item["services"] == nil { + r.Item["services"] = []string{} + } + } + return nil +} diff --git a/providers/datadog/integration_azure.go b/providers/datadog/integration_azure.go new file mode 100644 index 0000000000..8484898eaa --- /dev/null +++ b/providers/datadog/integration_azure.go @@ -0,0 +1,68 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationAzureAllowEmptyValues ... + IntegrationAzureAllowEmptyValues = []string{} +) + +// IntegrationAzureGenerator ... +type IntegrationAzureGenerator struct { + DatadogService +} + +func (g *IntegrationAzureGenerator) createResources(AzureAccounts []datadogV1.AzureAccount) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, account := range AzureAccounts { + resourceID := fmt.Sprintf("%s:%s", account.GetTenantName(), account.GetClientId()) + resources = append(resources, g.createResource(resourceID)) + } + + return resources +} + +func (g *IntegrationAzureGenerator) createResource(resourceID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + resourceID, + fmt.Sprintf("integration_azure_%s", resourceID), + "datadog_integration_azure", + "datadog", + IntegrationAzureAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each monitor create 1 TerraformResource. +// Need IntegrationAzure ID formatted as ':' as ID for terraform resource +func (g *IntegrationAzureGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + integrations, _, err := datadogClientV1.AzureIntegrationApi.ListAzureIntegration(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(integrations) + return nil +} diff --git a/providers/datadog/integration_gcp.go b/providers/datadog/integration_gcp.go new file mode 100644 index 0000000000..6eefc1973b --- /dev/null +++ b/providers/datadog/integration_gcp.go @@ -0,0 +1,68 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationGCPAllowEmptyValues ... + IntegrationGCPAllowEmptyValues = []string{} +) + +// IntegrationGCPGenerator ... +type IntegrationGCPGenerator struct { + DatadogService +} + +func (g *IntegrationGCPGenerator) createResources(GCPAccounts []datadogV1.GCPAccount) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, account := range GCPAccounts { + resourceID := account.GetProjectId() + resources = append(resources, g.createResource(resourceID)) + } + + return resources +} + +func (g *IntegrationGCPGenerator) createResource(resourceID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + resourceID, + fmt.Sprintf("integration_gcp_%s", resourceID), + "datadog_integration_gcp", + "datadog", + IntegrationGCPAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each monitor create 1 TerraformResource. +// Need IntegrationGCP ID formatted as ':' as ID for terraform resource +func (g *IntegrationGCPGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + integrations, _, err := datadogClientV1.GCPIntegrationApi.ListGCPIntegration(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(integrations) + return nil +} From 8e8a4719f0483220f645f7228a8e272f61712efe Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 11:25:28 -0500 Subject: [PATCH 035/276] update readme.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 8acd5fe220..b0e2025929 100644 --- a/README.md +++ b/README.md @@ -1408,6 +1408,18 @@ List of supported Datadog services: * `datadog_dashboard` * `downtime` * `datadog_downtime` +* `integration_aws` + * `datadog_integration_aws` +* `integration_aws_lambda_arn` + * `datadog_integration_aws_lambda_arn` +* `integration_aws_log_collection` + * `datadog_integration_aws_log_collection` +* `integration_azure` + * `datadog_integration_azure` + * **_NOTE:_** Sensitive field `client_secret` is not generated and needs to be manually set +* `integration_gcp` + * `datadog_integration_gcp` + * **_NOTE:_** Sensitive fields `private_key, private_key_id, client_id` is not generated and needs to be manually set * `monitor` * `datadog_monitor` * `screenboard` From 5e5e2699349ae682a6fe62795ab6ab225decfeca Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 11:37:27 -0500 Subject: [PATCH 036/276] add logs resources --- providers/datadog/datadog_provider.go | 70 +++++++++-- providers/datadog/logs_archive.go | 89 ++++++++++++++ providers/datadog/logs_archive_order.go | 43 +++++++ providers/datadog/logs_custom_pipeline.go | 113 ++++++++++++++++++ providers/datadog/logs_index.go | 89 ++++++++++++++ providers/datadog/logs_index_order.go | 50 ++++++++ .../datadog/logs_integration_pipeline.go | 71 +++++++++++ providers/datadog/logs_pipeline_order.go | 50 ++++++++ 8 files changed, 565 insertions(+), 10 deletions(-) create mode 100644 providers/datadog/logs_archive.go create mode 100644 providers/datadog/logs_archive_order.go create mode 100644 providers/datadog/logs_custom_pipeline.go create mode 100644 providers/datadog/logs_index.go create mode 100644 providers/datadog/logs_index_order.go create mode 100644 providers/datadog/logs_integration_pipeline.go create mode 100644 providers/datadog/logs_pipeline_order.go diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 2199e20bff..12b6d2fd87 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -22,6 +22,7 @@ import ( "os" datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/zclconf/go-cty/cty" ) @@ -32,7 +33,9 @@ type DatadogProvider struct { //nolint appKey string apiURL string authV1 context.Context + authV2 context.Context datadogClientV1 *datadogV1.APIClient + datadogClientV2 *datadogV2.APIClient } // Init check env params and initialize API Client @@ -63,7 +66,7 @@ func (p *DatadogProvider) Init(args []string) error { p.apiURL = v } - // Initialize the Datadog API client + // Initialize the Datadog V1 API client authV1 := context.WithValue( context.Background(), datadogV1.ContextAPIKeys, @@ -91,11 +94,49 @@ func (p *DatadogProvider) Init(args []string) error { "protocol": parsedAPIURL.Scheme, }) } - p.authV1 = authV1 - configV1 := datadogV1.NewConfiguration() + + // Enable unstable operations + configV1.SetUnstableOperationEnabled("GetLogsIndex", true) + configV1.SetUnstableOperationEnabled("ListLogIndexes", true) + datadogClientV1 := datadogV1.NewAPIClient(configV1) + + // Initialize the Datadog V2 API client + authV2 := context.WithValue( + context.Background(), + datadogV2.ContextAPIKeys, + map[string]datadogV2.APIKey{ + "apiKeyAuth": { + Key: p.apiKey, + }, + "appKeyAuth": { + Key: p.appKey, + }, + }, + ) + if p.apiURL != "" { + parsedAPIURL, parseErr := url.Parse(p.apiURL) + if parseErr != nil { + return fmt.Errorf(`invalid API Url : %v`, parseErr) + } + if parsedAPIURL.Host == "" || parsedAPIURL.Scheme == "" { + return fmt.Errorf(`missing protocol or host : %v`, p.apiURL) + } + // If api url is passed, set and use the api name and protocol on ServerIndex{1} + authV2 = context.WithValue(authV2, datadogV2.ContextServerIndex, 1) + authV2 = context.WithValue(authV2, datadogV2.ContextServerVariables, map[string]string{ + "name": parsedAPIURL.Host, + "protocol": parsedAPIURL.Scheme, + }) + } + configV2 := datadogV2.NewConfiguration() + datadogClientV2 := datadogV2.NewAPIClient(configV2) + + p.authV1 = authV1 + p.authV2 = authV2 p.datadogClientV1 = datadogClientV1 + p.datadogClientV2 = datadogClientV2 return nil } @@ -129,7 +170,9 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { "app-key": p.appKey, "api-url": p.apiURL, "authV1": p.authV1, + "authV2": p.authV2, "datadogClientV1": p.datadogClientV1, + "datadogClientV2": p.datadogClientV2, }) return nil } @@ -137,13 +180,20 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { // GetSupportedService return map of support service for Datadog func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "dashboard": &DashboardGenerator{}, - "downtime": &DowntimeGenerator{}, - "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, - "synthetics": &SyntheticsGenerator{}, - "timeboard": &TimeboardGenerator{}, - "user": &UserGenerator{}, + "dashboard": &DashboardGenerator{}, + "downtime": &DowntimeGenerator{}, + "logs_archive": &LogsArchiveGenerator{}, + "logs_archive_order": &LogsArchiveOrderGenerator{}, + "logs_custom_pipeline": &LogsCustomPipelineGenerator{}, + "logs_integration_pipeline": &LogsIntegrationPipelineGenerator{}, + "logs_pipeline_order": &LogsPipelineOrderGenerator{}, + "logs_index": &LogsIndexGenerator{}, + "logs_index_order": &LogsIndexOrderGenerator{}, + "monitor": &MonitorGenerator{}, + "screenboard": &ScreenboardGenerator{}, + "synthetics": &SyntheticsGenerator{}, + "timeboard": &TimeboardGenerator{}, + "user": &UserGenerator{}, } } diff --git a/providers/datadog/logs_archive.go b/providers/datadog/logs_archive.go new file mode 100644 index 0000000000..e6c601bbff --- /dev/null +++ b/providers/datadog/logs_archive.go @@ -0,0 +1,89 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // LogsArchiveAllowEmptyValues ... + LogsArchiveAllowEmptyValues = []string{"path", "query"} +) + +// LogsArchiveGenerator ... +type LogsArchiveGenerator struct { + DatadogService +} + +func (g *LogsArchiveGenerator) createResources(logsArchives []datadogV2.LogsArchiveDefinition) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, logsArchive := range logsArchives { + logsArchiveId := logsArchive.GetId() + resources = append(resources, g.createResource(logsArchiveId)) + } + + return resources +} + +func (g *LogsArchiveGenerator) createResource(logsArchiveID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + logsArchiveID, + fmt.Sprintf("logs_archive_%s", logsArchiveID), + "datadog_logs_archive", + "datadog", + LogsArchiveAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each archive create 1 TerraformResource. +// Need LogsArchive ID as ID for terraform resource +func (g *LogsArchiveGenerator) InitResources() error { + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) + authV2 := g.Args["authV2"].(context.Context) + + resources := []terraformutils.Resource{} + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("logs_archive") { + for _, value := range filter.AcceptableValues { + resp, _, err := datadogClientV2.LogsArchivesApi.GetLogsArchive(authV2, value).Execute() + if err != nil { + return err + } + logsArchiveData := resp.GetData() + resources = append(resources, g.createResource(logsArchiveData.GetId())) + } + } + } + + if len(resources) > 0 { + g.Resources = resources + return nil + } + + logsArchiveListResp, _, err := datadogClientV2.LogsArchivesApi.ListLogsArchives(authV2).Execute() + logsArchiveList := logsArchiveListResp.GetData() + if err != nil { + return err + } + g.Resources = g.createResources(logsArchiveList) + return nil +} diff --git a/providers/datadog/logs_archive_order.go b/providers/datadog/logs_archive_order.go new file mode 100644 index 0000000000..baafed4004 --- /dev/null +++ b/providers/datadog/logs_archive_order.go @@ -0,0 +1,43 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // LogsArchiveOrderAllowEmptyValues ... + LogsArchiveOrderAllowEmptyValues = []string{} +) + +// LogsArchiveOrderGenerator ... +type LogsArchiveOrderGenerator struct { + DatadogService +} + +// InitResources Generate TerraformResources +func (g *LogsArchiveOrderGenerator) InitResources() error { + g.Resources = append(g.Resources, terraformutils.NewResource( + "archiveOrderID", + "archiveOrderID", + "datadog_logs_archive_order", + "datadog", + map[string]string{}, + LogsArchiveOrderAllowEmptyValues, + map[string]interface{}{}, + )) + return nil +} diff --git a/providers/datadog/logs_custom_pipeline.go b/providers/datadog/logs_custom_pipeline.go new file mode 100644 index 0000000000..f4ceb14f38 --- /dev/null +++ b/providers/datadog/logs_custom_pipeline.go @@ -0,0 +1,113 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "encoding/json" + "fmt" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "strings" +) + +var ( + // LogsCustomPipelineAllowEmptyValues ... + LogsCustomPipelineAllowEmptyValues = []string{"support_rules", "filter"} +) + +// LogsCustomPipelineGenerator ... +type LogsCustomPipelineGenerator struct { + DatadogService +} + +func (g *LogsCustomPipelineGenerator) createResources(logsCustomPipelines []datadogV1.LogsPipeline) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, logsCustomPipeline := range logsCustomPipelines { + // Import logs custom pipelines only + if !logsCustomPipeline.GetIsReadOnly(){ + resourceName := logsCustomPipeline.GetId() + resources = append(resources, g.createResource(resourceName)) + } + } + + return resources +} + +func (g *LogsCustomPipelineGenerator) createResource(LogsCustomPipelineID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + LogsCustomPipelineID, + fmt.Sprintf("logs_custom_pipeline_%s", LogsCustomPipelineID), + "datadog_logs_custom_pipeline", + "datadog", + LogsCustomPipelineAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each custom pipeline create 1 TerraformResource. +// Need LogsPipeline ID as ID for terraform resource +func (g *LogsCustomPipelineGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + resources := []terraformutils.Resource{} + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("logs_custom_pipeline") { + for _, value := range filter.AcceptableValues { + logsCustomPipeline, _, err := datadogClientV1.LogsPipelinesApi.GetLogsPipeline(authV1, value).Execute() + if err != nil { + return err + } + + resources = append(resources, g.createResource(logsCustomPipeline.GetId())) + } + } + } + + if len(resources) > 0 { + g.Resources = resources + return nil + } + + logsCustomPipelines, _, err := datadogClientV1.LogsPipelinesApi.ListLogsPipelines(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(logsCustomPipelines) + return nil +} + +func (g *LogsCustomPipelineGenerator) PostConvertHook() error { + for i, r := range g.Resources { + for k, v := range r.Item { + // Hack to properly escape `%{` used in pipeline processors + if k == "processor" { + var z interface{} + jsonByte, err := json.Marshal(v) + if err != nil { + continue + } + jsonByte = []byte(strings.ReplaceAll(string(jsonByte), "%{", "%%{")) + err = json.Unmarshal(jsonByte, &z) + if err = json.Unmarshal(jsonByte, &z); err != nil { + continue + } + g.Resources[i].Item[k] = z + } + } + } + return nil +} diff --git a/providers/datadog/logs_index.go b/providers/datadog/logs_index.go new file mode 100644 index 0000000000..efa8a0f99d --- /dev/null +++ b/providers/datadog/logs_index.go @@ -0,0 +1,89 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // LogsIndexAllowEmptyValues ... + LogsIndexAllowEmptyValues = []string{"filter"} +) + +// LogsIndexGenerator ... +type LogsIndexGenerator struct { + DatadogService +} + +func (g *LogsIndexGenerator) createResources(logs_indexes []datadogV1.LogsIndex) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, logsIndex := range logs_indexes { + resourceName := logsIndex.GetName() + resources = append(resources, g.createResource(resourceName)) + } + + return resources +} + +func (g *LogsIndexGenerator) createResource(logsIndexName string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + logsIndexName, + fmt.Sprintf("logs_index_%s", logsIndexName), + "datadog_logs_index", + "datadog", + LogsIndexAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each index create 1 TerraformResource. +// Need LogsIndex Name as ID for terraform resource +func (g *LogsIndexGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + resources := []terraformutils.Resource{} + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("logs_index") { + for _, value := range filter.AcceptableValues { + logsIndex, _, err := datadogClientV1.LogsIndexesApi.GetLogsIndex(authV1, value).Execute() + if err != nil { + return err + } + + resources = append(resources, g.createResource(logsIndex.GetName())) + } + } + } + + if len(resources) > 0 { + g.Resources = resources + return nil + } + + logsIndexList, _, err := datadogClientV1.LogsIndexesApi.ListLogIndexes(authV1).Execute() + logsIndex := logsIndexList.GetIndexes() + if err != nil { + return err + } + g.Resources = g.createResources(logsIndex) + return nil +} diff --git a/providers/datadog/logs_index_order.go b/providers/datadog/logs_index_order.go new file mode 100644 index 0000000000..2d2094314d --- /dev/null +++ b/providers/datadog/logs_index_order.go @@ -0,0 +1,50 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "fmt" + "time" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // LogsIndexOrderAllowEmptyValues ... + LogsIndexOrderAllowEmptyValues = []string{} +) + +// LogsIndexOrderGenerator ... +type LogsIndexOrderGenerator struct { + DatadogService +} + +// InitResources Generate TerraformResources +func (g *LogsIndexOrderGenerator) InitResources() error { + currentDate := time.Now().Format("20060102150405") + resourceName := fmt.Sprintf("logs_index_order_%s", currentDate) + g.Resources = append(g.Resources, terraformutils.NewResource( + resourceName, + resourceName, + "datadog_logs_index_order", + "datadog", + map[string]string{ + "name": resourceName, + }, + LogsIndexOrderAllowEmptyValues, + map[string]interface{}{}, + )) + return nil +} diff --git a/providers/datadog/logs_integration_pipeline.go b/providers/datadog/logs_integration_pipeline.go new file mode 100644 index 0000000000..c9a526c2cd --- /dev/null +++ b/providers/datadog/logs_integration_pipeline.go @@ -0,0 +1,71 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // LogsIntegrationPipelineAllowEmptyValues ... + LogsIntegrationPipelineAllowEmptyValues = []string{} +) + +// LogsIntegrationPipelineGenerator ... +type LogsIntegrationPipelineGenerator struct { + DatadogService +} + +func (g *LogsIntegrationPipelineGenerator) createResources(logsIntegrationPipelines []datadogV1.LogsPipeline) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, logsIntegrationPipeline := range logsIntegrationPipelines { + // Import logs integration pipelines only + if logsIntegrationPipeline.GetIsReadOnly(){ + resourceId := logsIntegrationPipeline.GetId() + resourceName := logsIntegrationPipeline.GetName() + resources = append(resources, g.createResource(resourceId, resourceName)) + } + } + + return resources +} + +func (g *LogsIntegrationPipelineGenerator) createResource(LogsIntegrationPipelineID string, LogsIntegrationPipelineName string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + LogsIntegrationPipelineID, + LogsIntegrationPipelineName, + "datadog_logs_integration_pipeline", + "datadog", + LogsIntegrationPipelineAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each integration pipeline create 1 TerraformResource. +// Need LogsPipeline ID as ID for terraform resource +func (g *LogsIntegrationPipelineGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + logsIntegrationPipelines, _, err := datadogClientV1.LogsPipelinesApi.ListLogsPipelines(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(logsIntegrationPipelines) + return nil +} diff --git a/providers/datadog/logs_pipeline_order.go b/providers/datadog/logs_pipeline_order.go new file mode 100644 index 0000000000..a71b441244 --- /dev/null +++ b/providers/datadog/logs_pipeline_order.go @@ -0,0 +1,50 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "fmt" + "time" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // LogsPipelineOrderAllowEmptyValues ... + LogsPipelineOrderAllowEmptyValues = []string{} +) + +// LogsPipelineOrderGenerator ... +type LogsPipelineOrderGenerator struct { + DatadogService +} + +// InitResources Generate TerraformResources +func (g *LogsPipelineOrderGenerator) InitResources() error { + currentDate := time.Now().Format("20060102150405") + resourceName := fmt.Sprintf("logs_pipeline_order_%s", currentDate) + g.Resources = append(g.Resources, terraformutils.NewResource( + resourceName, + resourceName, + "datadog_logs_pipeline_order", + "datadog", + map[string]string{ + "name": resourceName, + }, + LogsPipelineOrderAllowEmptyValues, + map[string]interface{}{}, + )) + return nil +} From 65ebd2ffadd696df652f968fe0a11b90a6966795 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 11:38:02 -0500 Subject: [PATCH 037/276] update readme.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 8acd5fe220..78175f9106 100644 --- a/README.md +++ b/README.md @@ -1408,6 +1408,20 @@ List of supported Datadog services: * `datadog_dashboard` * `downtime` * `datadog_downtime` +* `logs_archive` + * `datadog_logs_archive` +* `logs_archive_order` + * `datadog_logs_archive_order` +* `logs_custom_pipeline` + * `datadog_logs_custom_pipeline` +* `logs_integration_pipeline` + * `datadog_logs_integration_pipeline` +* `logs_pipeline_order` + * `datadog_logs_pipeline_order` +* `logs_index` + * `datadog_logs_index` +* `logs_index_order` + * `datadog_logs_index_order` * `monitor` * `datadog_monitor` * `screenboard` From a9c3251a9bb7a34cce6e6495cc8f3e4bf33b4804 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 11:47:08 -0500 Subject: [PATCH 038/276] lint --- providers/datadog/datadog_provider.go | 4 ++-- providers/datadog/logs_custom_pipeline.go | 2 +- providers/datadog/logs_integration_pipeline.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 12b6d2fd87..8e9b1255c5 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -185,10 +185,10 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "logs_archive": &LogsArchiveGenerator{}, "logs_archive_order": &LogsArchiveOrderGenerator{}, "logs_custom_pipeline": &LogsCustomPipelineGenerator{}, - "logs_integration_pipeline": &LogsIntegrationPipelineGenerator{}, - "logs_pipeline_order": &LogsPipelineOrderGenerator{}, "logs_index": &LogsIndexGenerator{}, "logs_index_order": &LogsIndexOrderGenerator{}, + "logs_integration_pipeline": &LogsIntegrationPipelineGenerator{}, + "logs_pipeline_order": &LogsPipelineOrderGenerator{}, "monitor": &MonitorGenerator{}, "screenboard": &ScreenboardGenerator{}, "synthetics": &SyntheticsGenerator{}, diff --git a/providers/datadog/logs_custom_pipeline.go b/providers/datadog/logs_custom_pipeline.go index f4ceb14f38..3970985614 100644 --- a/providers/datadog/logs_custom_pipeline.go +++ b/providers/datadog/logs_custom_pipeline.go @@ -37,7 +37,7 @@ func (g *LogsCustomPipelineGenerator) createResources(logsCustomPipelines []data resources := []terraformutils.Resource{} for _, logsCustomPipeline := range logsCustomPipelines { // Import logs custom pipelines only - if !logsCustomPipeline.GetIsReadOnly(){ + if !logsCustomPipeline.GetIsReadOnly() { resourceName := logsCustomPipeline.GetId() resources = append(resources, g.createResource(resourceName)) } diff --git a/providers/datadog/logs_integration_pipeline.go b/providers/datadog/logs_integration_pipeline.go index c9a526c2cd..45702aa5be 100644 --- a/providers/datadog/logs_integration_pipeline.go +++ b/providers/datadog/logs_integration_pipeline.go @@ -35,10 +35,10 @@ func (g *LogsIntegrationPipelineGenerator) createResources(logsIntegrationPipeli resources := []terraformutils.Resource{} for _, logsIntegrationPipeline := range logsIntegrationPipelines { // Import logs integration pipelines only - if logsIntegrationPipeline.GetIsReadOnly(){ + if logsIntegrationPipeline.GetIsReadOnly() { resourceId := logsIntegrationPipeline.GetId() resourceName := logsIntegrationPipeline.GetName() - resources = append(resources, g.createResource(resourceId, resourceName)) + resources = append(resources, g.createResource(resourceId, resourceName)) } } From 737311b62b0fcb71fbdb7255084765805d59dd39 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 16:44:26 -0500 Subject: [PATCH 039/276] add metric_metadata resource --- README.md | 2 + providers/datadog/datadog_provider.go | 15 +++--- providers/datadog/metric_metadata.go | 78 +++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 providers/datadog/metric_metadata.go diff --git a/README.md b/README.md index 8acd5fe220..debea5730b 100644 --- a/README.md +++ b/README.md @@ -1408,6 +1408,8 @@ List of supported Datadog services: * `datadog_dashboard` * `downtime` * `datadog_downtime` +* `metric_metadata` + * `datadog_metric_metadata` * `monitor` * `datadog_monitor` * `screenboard` diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 2199e20bff..8727dc2d2f 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -137,13 +137,14 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { // GetSupportedService return map of support service for Datadog func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "dashboard": &DashboardGenerator{}, - "downtime": &DowntimeGenerator{}, - "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, - "synthetics": &SyntheticsGenerator{}, - "timeboard": &TimeboardGenerator{}, - "user": &UserGenerator{}, + "dashboard": &DashboardGenerator{}, + "downtime": &DowntimeGenerator{}, + "monitor": &MonitorGenerator{}, + "metric_metadata": &MetricMetadataGenerator{}, + "screenboard": &ScreenboardGenerator{}, + "synthetics": &SyntheticsGenerator{}, + "timeboard": &TimeboardGenerator{}, + "user": &UserGenerator{}, } } diff --git a/providers/datadog/metric_metadata.go b/providers/datadog/metric_metadata.go new file mode 100644 index 0000000000..77df147541 --- /dev/null +++ b/providers/datadog/metric_metadata.go @@ -0,0 +1,78 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "errors" + "fmt" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // MetricMetadataAllowEmptyValues ... + MetricMetadataAllowEmptyValues = []string{} +) + +// MetricMetadataGenerator ... +type MetricMetadataGenerator struct { + DatadogService +} + +func (g *MetricMetadataGenerator) createResources(metrics []string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, metric := range metrics { + resourceName := metric + resources = append(resources, g.createResource(resourceName)) + } + + return resources +} + +func (g *MetricMetadataGenerator) createResource(metricName string) terraformutils.Resource { + return terraformutils.NewResource( + metricName, + fmt.Sprintf("metric_metadata_%s", metricName), + "datadog_metric_metadata", + "datadog", + map[string]string{ + "metric": metricName, + }, + MetricMetadataAllowEmptyValues, + map[string]interface{}{}, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each metric create 1 TerraformResource. +// Need Metric Name as ID for terraform resource +func (g *MetricMetadataGenerator) InitResources() error { + resources := []terraformutils.Resource{} + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("metric_metadata") { + for _, value := range filter.AcceptableValues { + resources = append(resources, g.createResource(value)) + } + } + } + + // Collecting all metrics_metadata can be an expensive task. + // Hence, only allow collections of metrics from filter + if len(resources) == 0 { + return errors.New("filtering is required for importing datadog_metric_metadata resource") + } + g.Resources = resources + + return nil +} From c9d4cafe5d49085a8ed8fd0ed6287873d49829b1 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 18:39:01 -0500 Subject: [PATCH 040/276] add datadog role resource --- README.md | 2 + providers/datadog/datadog_provider.go | 1 + providers/datadog/role.go | 71 +++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 providers/datadog/role.go diff --git a/README.md b/README.md index 8acd5fe220..7124edc978 100644 --- a/README.md +++ b/README.md @@ -1410,6 +1410,8 @@ List of supported Datadog services: * `datadog_downtime` * `monitor` * `datadog_monitor` +* `role` + * `datadog_role` * `screenboard` * `datadog_screenboard` * `synthetics` diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 2199e20bff..b6b794e4a6 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -140,6 +140,7 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "dashboard": &DashboardGenerator{}, "downtime": &DowntimeGenerator{}, "monitor": &MonitorGenerator{}, + "role": &RoleGenerator{}, "screenboard": &ScreenboardGenerator{}, "synthetics": &SyntheticsGenerator{}, "timeboard": &TimeboardGenerator{}, diff --git a/providers/datadog/role.go b/providers/datadog/role.go new file mode 100644 index 0000000000..c3debee869 --- /dev/null +++ b/providers/datadog/role.go @@ -0,0 +1,71 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // RoleAllowEmptyValues ... + RoleAllowEmptyValues = []string{} +) + +// RoleGenerator ... +type RoleGenerator struct { + DatadogService +} + +func (g *RoleGenerator) createResources(roles []datadogV2.Role) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, role := range roles { + resourceName := role.GetId() + resource := g.createResource(resourceName) + resource.IgnoreKeys = append(resource.IgnoreKeys, "permission.([0-9]+).name") + resources = append(resources, resource) + } + + return resources +} + +func (g *RoleGenerator) createResource(roleID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + roleID, + fmt.Sprintf("role_%s", roleID), + "datadog_role", + "datadog", + RoleAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each role create 1 TerraformResource. +// Need Role ID as ID for terraform resource +func (g *RoleGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV2"].(*datadogV2.APIClient) + authV1 := g.Args["authV2"].(context.Context) + + roles, _, err := datadogClientV1.RolesApi.ListRoles(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(roles.GetData()) + return nil +} From c9b4814496c3503a2e07009cd64c27b98e483e97 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 02:36:49 -0500 Subject: [PATCH 041/276] lint --- providers/datadog/metric_metadata.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/providers/datadog/metric_metadata.go b/providers/datadog/metric_metadata.go index 77df147541..c0ae4960ae 100644 --- a/providers/datadog/metric_metadata.go +++ b/providers/datadog/metric_metadata.go @@ -17,6 +17,7 @@ package datadog import ( "errors" "fmt" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -30,16 +31,6 @@ type MetricMetadataGenerator struct { DatadogService } -func (g *MetricMetadataGenerator) createResources(metrics []string) []terraformutils.Resource { - resources := []terraformutils.Resource{} - for _, metric := range metrics { - resourceName := metric - resources = append(resources, g.createResource(resourceName)) - } - - return resources -} - func (g *MetricMetadataGenerator) createResource(metricName string) terraformutils.Resource { return terraformutils.NewResource( metricName, @@ -68,11 +59,10 @@ func (g *MetricMetadataGenerator) InitResources() error { } // Collecting all metrics_metadata can be an expensive task. - // Hence, only allow collections of metrics from filter + // Hence, only allow collections of metrics passed via filter if len(resources) == 0 { return errors.New("filtering is required for importing datadog_metric_metadata resource") } g.Resources = resources - return nil } From 4f13619ec102af552f9a59c70ea1136a19546314 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 02:48:06 -0500 Subject: [PATCH 042/276] lint --- providers/datadog/logs_archive.go | 4 ++-- providers/datadog/logs_custom_pipeline.go | 11 ++++++----- providers/datadog/logs_index.go | 4 ++-- providers/datadog/logs_integration_pipeline.go | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/providers/datadog/logs_archive.go b/providers/datadog/logs_archive.go index e6c601bbff..94365f1ac0 100644 --- a/providers/datadog/logs_archive.go +++ b/providers/datadog/logs_archive.go @@ -36,8 +36,8 @@ type LogsArchiveGenerator struct { func (g *LogsArchiveGenerator) createResources(logsArchives []datadogV2.LogsArchiveDefinition) []terraformutils.Resource { resources := []terraformutils.Resource{} for _, logsArchive := range logsArchives { - logsArchiveId := logsArchive.GetId() - resources = append(resources, g.createResource(logsArchiveId)) + logsArchiveID := logsArchive.GetId() + resources = append(resources, g.createResource(logsArchiveID)) } return resources diff --git a/providers/datadog/logs_custom_pipeline.go b/providers/datadog/logs_custom_pipeline.go index 3970985614..81c30ac216 100644 --- a/providers/datadog/logs_custom_pipeline.go +++ b/providers/datadog/logs_custom_pipeline.go @@ -18,9 +18,11 @@ import ( "context" "encoding/json" "fmt" + "strings" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "strings" ) var ( @@ -46,10 +48,10 @@ func (g *LogsCustomPipelineGenerator) createResources(logsCustomPipelines []data return resources } -func (g *LogsCustomPipelineGenerator) createResource(LogsCustomPipelineID string) terraformutils.Resource { +func (g *LogsCustomPipelineGenerator) createResource(logsCustomPipelineID string) terraformutils.Resource { return terraformutils.NewSimpleResource( - LogsCustomPipelineID, - fmt.Sprintf("logs_custom_pipeline_%s", LogsCustomPipelineID), + logsCustomPipelineID, + fmt.Sprintf("logs_custom_pipeline_%s", logsCustomPipelineID), "datadog_logs_custom_pipeline", "datadog", LogsCustomPipelineAllowEmptyValues, @@ -101,7 +103,6 @@ func (g *LogsCustomPipelineGenerator) PostConvertHook() error { continue } jsonByte = []byte(strings.ReplaceAll(string(jsonByte), "%{", "%%{")) - err = json.Unmarshal(jsonByte, &z) if err = json.Unmarshal(jsonByte, &z); err != nil { continue } diff --git a/providers/datadog/logs_index.go b/providers/datadog/logs_index.go index efa8a0f99d..348ccec156 100644 --- a/providers/datadog/logs_index.go +++ b/providers/datadog/logs_index.go @@ -33,9 +33,9 @@ type LogsIndexGenerator struct { DatadogService } -func (g *LogsIndexGenerator) createResources(logs_indexes []datadogV1.LogsIndex) []terraformutils.Resource { +func (g *LogsIndexGenerator) createResources(logsIndexes []datadogV1.LogsIndex) []terraformutils.Resource { resources := []terraformutils.Resource{} - for _, logsIndex := range logs_indexes { + for _, logsIndex := range logsIndexes { resourceName := logsIndex.GetName() resources = append(resources, g.createResource(resourceName)) } diff --git a/providers/datadog/logs_integration_pipeline.go b/providers/datadog/logs_integration_pipeline.go index 45702aa5be..bdf982a04c 100644 --- a/providers/datadog/logs_integration_pipeline.go +++ b/providers/datadog/logs_integration_pipeline.go @@ -36,18 +36,18 @@ func (g *LogsIntegrationPipelineGenerator) createResources(logsIntegrationPipeli for _, logsIntegrationPipeline := range logsIntegrationPipelines { // Import logs integration pipelines only if logsIntegrationPipeline.GetIsReadOnly() { - resourceId := logsIntegrationPipeline.GetId() + resourceID := logsIntegrationPipeline.GetId() resourceName := logsIntegrationPipeline.GetName() - resources = append(resources, g.createResource(resourceId, resourceName)) + resources = append(resources, g.createResource(resourceID, resourceName)) } } return resources } -func (g *LogsIntegrationPipelineGenerator) createResource(LogsIntegrationPipelineID string, LogsIntegrationPipelineName string) terraformutils.Resource { +func (g *LogsIntegrationPipelineGenerator) createResource(logsIntegrationPipelineID string, LogsIntegrationPipelineName string) terraformutils.Resource { return terraformutils.NewSimpleResource( - LogsIntegrationPipelineID, + logsIntegrationPipelineID, LogsIntegrationPipelineName, "datadog_logs_integration_pipeline", "datadog", From 2495c71a852fcd9ed0d8f6d4ba9d3e4df7f711f4 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 02:52:07 -0500 Subject: [PATCH 043/276] lint --- providers/datadog/integration_aws.go | 4 ++-- providers/datadog/integration_aws_log_collection.go | 1 + providers/datadog/integration_azure.go | 5 +++-- providers/datadog/integration_gcp.go | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/providers/datadog/integration_aws.go b/providers/datadog/integration_aws.go index e181cfe52f..3d5a5bc047 100644 --- a/providers/datadog/integration_aws.go +++ b/providers/datadog/integration_aws.go @@ -33,9 +33,9 @@ type IntegrationAWSGenerator struct { DatadogService } -func (g *IntegrationAWSGenerator) createResources(AWSAccounts []datadogV1.AWSAccount) []terraformutils.Resource { +func (g *IntegrationAWSGenerator) createResources(awsAccounts []datadogV1.AWSAccount) []terraformutils.Resource { resources := []terraformutils.Resource{} - for _, account := range AWSAccounts { + for _, account := range awsAccounts { resourceID := fmt.Sprintf("%s:%s", account.GetAccountId(), account.GetRoleName()) resources = append(resources, g.createResource(resourceID)) } diff --git a/providers/datadog/integration_aws_log_collection.go b/providers/datadog/integration_aws_log_collection.go index d7a957c085..00f416b066 100644 --- a/providers/datadog/integration_aws_log_collection.go +++ b/providers/datadog/integration_aws_log_collection.go @@ -17,6 +17,7 @@ package datadog import ( "context" "fmt" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" diff --git a/providers/datadog/integration_azure.go b/providers/datadog/integration_azure.go index 8484898eaa..cf618709ae 100644 --- a/providers/datadog/integration_azure.go +++ b/providers/datadog/integration_azure.go @@ -17,6 +17,7 @@ package datadog import ( "context" "fmt" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -32,9 +33,9 @@ type IntegrationAzureGenerator struct { DatadogService } -func (g *IntegrationAzureGenerator) createResources(AzureAccounts []datadogV1.AzureAccount) []terraformutils.Resource { +func (g *IntegrationAzureGenerator) createResources(azureAccounts []datadogV1.AzureAccount) []terraformutils.Resource { resources := []terraformutils.Resource{} - for _, account := range AzureAccounts { + for _, account := range azureAccounts { resourceID := fmt.Sprintf("%s:%s", account.GetTenantName(), account.GetClientId()) resources = append(resources, g.createResource(resourceID)) } diff --git a/providers/datadog/integration_gcp.go b/providers/datadog/integration_gcp.go index 6eefc1973b..0697f8d6c3 100644 --- a/providers/datadog/integration_gcp.go +++ b/providers/datadog/integration_gcp.go @@ -17,6 +17,7 @@ package datadog import ( "context" "fmt" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -32,9 +33,9 @@ type IntegrationGCPGenerator struct { DatadogService } -func (g *IntegrationGCPGenerator) createResources(GCPAccounts []datadogV1.GCPAccount) []terraformutils.Resource { +func (g *IntegrationGCPGenerator) createResources(gcpAccounts []datadogV1.GCPAccount) []terraformutils.Resource { resources := []terraformutils.Resource{} - for _, account := range GCPAccounts { + for _, account := range gcpAccounts { resourceID := account.GetProjectId() resources = append(resources, g.createResource(resourceID)) } From d397eb63e31b5b139056449f81fea688f9b6e163 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 06:04:14 -0500 Subject: [PATCH 044/276] lint --- providers/datadog/logs_integration_pipeline.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/datadog/logs_integration_pipeline.go b/providers/datadog/logs_integration_pipeline.go index bdf982a04c..93244ad0a0 100644 --- a/providers/datadog/logs_integration_pipeline.go +++ b/providers/datadog/logs_integration_pipeline.go @@ -45,10 +45,10 @@ func (g *LogsIntegrationPipelineGenerator) createResources(logsIntegrationPipeli return resources } -func (g *LogsIntegrationPipelineGenerator) createResource(logsIntegrationPipelineID string, LogsIntegrationPipelineName string) terraformutils.Resource { +func (g *LogsIntegrationPipelineGenerator) createResource(logsIntegrationPipelineID string, logsIntegrationPipelineName string) terraformutils.Resource { return terraformutils.NewSimpleResource( logsIntegrationPipelineID, - LogsIntegrationPipelineName, + logsIntegrationPipelineName, "datadog_logs_integration_pipeline", "datadog", LogsIntegrationPipelineAllowEmptyValues, From 35863e6e2eff8309db7f3040f1b25e9d04fb3a37 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 06:08:30 -0500 Subject: [PATCH 045/276] bump datadog-api-client-go library version --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3e85f168a9..f90d00f742 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/Azure/azure-sdk-for-go v42.0.0+incompatible github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 - github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 + github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 diff --git a/go.sum b/go.sum index 86fb1ccff8..e0948ed565 100644 --- a/go.sum +++ b/go.sum @@ -107,6 +107,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 h1:TsOhRZ1r0WptlynSSBp8EuBT4vPRWNzYwbXrMGV0Eto= github.com/DataDog/datadog-api-client-go v1.0.0-beta.9/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= +github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9QpaFc/z2k0mcs7ZVnCRREeZU= +github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= github.com/DataDog/datadog-go v3.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 h1:CQEiiiSY2KD3U3WnBpYo6Bh6/VD6+LlL6+Hd3AH+utY= From 37ff992ac9bb7e1531160531dceef77f85a4cc0c Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 06:25:01 -0500 Subject: [PATCH 046/276] bump datadog-go client and introduce datadogv2 api client --- providers/datadog/datadog_provider.go | 49 +++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 2199e20bff..4218705a80 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -22,6 +22,7 @@ import ( "os" datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/zclconf/go-cty/cty" ) @@ -32,7 +33,9 @@ type DatadogProvider struct { //nolint appKey string apiURL string authV1 context.Context + authV2 context.Context datadogClientV1 *datadogV1.APIClient + datadogClientV2 *datadogV2.APIClient } // Init check env params and initialize API Client @@ -63,7 +66,7 @@ func (p *DatadogProvider) Init(args []string) error { p.apiURL = v } - // Initialize the Datadog API client + // Initialize the Datadog V1 API client authV1 := context.WithValue( context.Background(), datadogV1.ContextAPIKeys, @@ -91,11 +94,49 @@ func (p *DatadogProvider) Init(args []string) error { "protocol": parsedAPIURL.Scheme, }) } - p.authV1 = authV1 - configV1 := datadogV1.NewConfiguration() + + // Enable unstable operations + configV1.SetUnstableOperationEnabled("GetLogsIndex", true) + configV1.SetUnstableOperationEnabled("ListLogIndexes", true) + datadogClientV1 := datadogV1.NewAPIClient(configV1) + + // Initialize the Datadog V2 API client + authV2 := context.WithValue( + context.Background(), + datadogV2.ContextAPIKeys, + map[string]datadogV2.APIKey{ + "apiKeyAuth": { + Key: p.apiKey, + }, + "appKeyAuth": { + Key: p.appKey, + }, + }, + ) + if p.apiURL != "" { + parsedAPIURL, parseErr := url.Parse(p.apiURL) + if parseErr != nil { + return fmt.Errorf(`invalid API Url : %v`, parseErr) + } + if parsedAPIURL.Host == "" || parsedAPIURL.Scheme == "" { + return fmt.Errorf(`missing protocol or host : %v`, p.apiURL) + } + // If api url is passed, set and use the api name and protocol on ServerIndex{1} + authV2 = context.WithValue(authV2, datadogV2.ContextServerIndex, 1) + authV2 = context.WithValue(authV2, datadogV2.ContextServerVariables, map[string]string{ + "name": parsedAPIURL.Host, + "protocol": parsedAPIURL.Scheme, + }) + } + configV2 := datadogV2.NewConfiguration() + datadogClientV2 := datadogV2.NewAPIClient(configV2) + + p.authV1 = authV1 + p.authV2 = authV2 p.datadogClientV1 = datadogClientV1 + p.datadogClientV2 = datadogClientV2 return nil } @@ -129,7 +170,9 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { "app-key": p.appKey, "api-url": p.apiURL, "authV1": p.authV1, + "authV2": p.authV2, "datadogClientV1": p.datadogClientV1, + "datadogClientV2": p.datadogClientV2, }) return nil } From 32f3fc0958226f1dbc436a9d35db61291777a5c9 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 06:35:51 -0500 Subject: [PATCH 047/276] add datadog dashboard_list resource --- README.md | 2 + providers/datadog/dashboard_list.go | 70 +++++++++++++++++++++++++++ providers/datadog/datadog_provider.go | 15 +++--- 3 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 providers/datadog/dashboard_list.go diff --git a/README.md b/README.md index 8acd5fe220..d4275f5c42 100644 --- a/README.md +++ b/README.md @@ -1406,6 +1406,8 @@ List of supported Datadog services: * `dashboard` * `datadog_dashboard` +* `dashboard_list` + * `datadog_dashboard_list` * `downtime` * `datadog_downtime` * `monitor` diff --git a/providers/datadog/dashboard_list.go b/providers/datadog/dashboard_list.go new file mode 100644 index 0000000000..fc98015ac5 --- /dev/null +++ b/providers/datadog/dashboard_list.go @@ -0,0 +1,70 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + "strconv" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // DashboardListAllowEmptyValues ... + DashboardListAllowEmptyValues = []string{} +) + +// DashboardListGenerator ... +type DashboardListGenerator struct { + DatadogService +} + +func (g *DashboardListGenerator) createResources(dashboardLists []datadogV1.DashboardList) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, dashboardList := range dashboardLists { + resourceID := strconv.FormatInt(dashboardList.GetId(), 10) + resources = append(resources, g.createResource(resourceID)) + } + + return resources +} + +func (g *DashboardListGenerator) createResource(dashboardListID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + dashboardListID, + fmt.Sprintf("dashboard_list_%s", dashboardListID), + "datadog_dashboard_list", + "datadog", + DashboardListAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each dashboard_list create 1 TerraformResource. +// Need DashboardList ID as ID for terraform resource +func (g *DashboardListGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + dlResponse, _, err := datadogClientV1.DashboardListsApi.ListDashboardLists(authV1).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(dlResponse.GetDashboardLists()) + return nil +} diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 2199e20bff..57d59a50cd 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -137,13 +137,14 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { // GetSupportedService return map of support service for Datadog func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "dashboard": &DashboardGenerator{}, - "downtime": &DowntimeGenerator{}, - "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, - "synthetics": &SyntheticsGenerator{}, - "timeboard": &TimeboardGenerator{}, - "user": &UserGenerator{}, + "dashboard": &DashboardGenerator{}, + "dashboard_list": &DashboardListGenerator{}, + "downtime": &DowntimeGenerator{}, + "monitor": &MonitorGenerator{}, + "screenboard": &ScreenboardGenerator{}, + "synthetics": &SyntheticsGenerator{}, + "timeboard": &TimeboardGenerator{}, + "user": &UserGenerator{}, } } From 69de3b92f9c8044bf0f5b4882d21723f06aacc69 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 07:58:56 -0500 Subject: [PATCH 048/276] add datadog security resources --- README.md | 4 + providers/datadog/datadog_provider.go | 16 ++-- .../security_monitoring_default_rule.go | 72 +++++++++++++++++ providers/datadog/security_monitoring_rule.go | 77 +++++++++++++++++++ 4 files changed, 162 insertions(+), 7 deletions(-) create mode 100644 providers/datadog/security_monitoring_default_rule.go create mode 100644 providers/datadog/security_monitoring_rule.go diff --git a/README.md b/README.md index 8acd5fe220..c9480ed925 100644 --- a/README.md +++ b/README.md @@ -1412,6 +1412,10 @@ List of supported Datadog services: * `datadog_monitor` * `screenboard` * `datadog_screenboard` +* `security_monitoring_default_rule` + * `datadog_security_monitoring_default_rule` +* `security_monitoring_rule` + * `datadog_security_monitoring_rule` * `synthetics` * `datadog_synthetics_test` * `timeboard` diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 4218705a80..35ed943fe4 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -180,13 +180,15 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { // GetSupportedService return map of support service for Datadog func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "dashboard": &DashboardGenerator{}, - "downtime": &DowntimeGenerator{}, - "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, - "synthetics": &SyntheticsGenerator{}, - "timeboard": &TimeboardGenerator{}, - "user": &UserGenerator{}, + "dashboard": &DashboardGenerator{}, + "downtime": &DowntimeGenerator{}, + "monitor": &MonitorGenerator{}, + "screenboard": &ScreenboardGenerator{}, + "security_monitoring_default_rule": &SecurityMonitoringDefaultRuleGenerator{}, + "security_monitoring_rule": &SecurityMonitoringRuleGenerator{}, + "synthetics": &SyntheticsGenerator{}, + "timeboard": &TimeboardGenerator{}, + "user": &UserGenerator{}, } } diff --git a/providers/datadog/security_monitoring_default_rule.go b/providers/datadog/security_monitoring_default_rule.go new file mode 100644 index 0000000000..427abec75d --- /dev/null +++ b/providers/datadog/security_monitoring_default_rule.go @@ -0,0 +1,72 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // SecurityMonitoringDefaultRuleAllowEmptyValues ... + SecurityMonitoringDefaultRuleAllowEmptyValues = []string{"tags."} +) + +// SecurityMonitoringDefaultRuleGenerator ... +type SecurityMonitoringDefaultRuleGenerator struct { + DatadogService +} + +func (g *SecurityMonitoringDefaultRuleGenerator) createResources(rulesResponse []datadogV2.SecurityMonitoringRuleResponse) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, rule := range rulesResponse { + if rule.GetIsDefault() { + resourceName := rule.GetId() + resources = append(resources, g.createResource(resourceName)) + } + } + + return resources +} + +func (g *SecurityMonitoringDefaultRuleGenerator) createResource(ruleID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + ruleID, + fmt.Sprintf("security_monitoring_default_rule_%s", ruleID), + "datadog_security_monitoring_default_rule", + "datadog", + SecurityMonitoringDefaultRuleAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each SecurityMonitoringDefaultRule create 1 TerraformResource. +// Need SecurityMonitoringDefaultRule ID as ID for terraform resource +func (g *SecurityMonitoringDefaultRuleGenerator) InitResources() error { + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) + authV2 := g.Args["authV2"].(context.Context) + + pageSize := int64(999) + resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(resp.GetData()) + return nil +} diff --git a/providers/datadog/security_monitoring_rule.go b/providers/datadog/security_monitoring_rule.go new file mode 100644 index 0000000000..14f7d25525 --- /dev/null +++ b/providers/datadog/security_monitoring_rule.go @@ -0,0 +1,77 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + "strconv" + + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // SecurityMonitoringRuleAllowEmptyValues ... + SecurityMonitoringRuleAllowEmptyValues = []string{"tags."} +) + +// SecurityMonitoringRuleGenerator ... +type SecurityMonitoringRuleGenerator struct { + DatadogService +} + +func (g *SecurityMonitoringRuleGenerator) createResources(rulesResponse []datadogV2.SecurityMonitoringRuleResponse) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, rule := range rulesResponse { + if !rule.GetIsDefault() { + resourceName := rule.GetId() + resources = append(resources, g.createResource(resourceName, rule.GetIsEnabled())) + } + } + + return resources +} + +func (g *SecurityMonitoringRuleGenerator) createResource(ruleID string, ruleEnabled bool) terraformutils.Resource { + return terraformutils.NewResource( + ruleID, + fmt.Sprintf("security_monitoring_rule_%s", ruleID), + "datadog_security_monitoring_rule", + "datadog", + map[string]string{ + "enabled": strconv.FormatBool(ruleEnabled), + }, + SecurityMonitoringRuleAllowEmptyValues, + map[string]interface{}{}, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each SecurityMonitoringRule create 1 TerraformResource. +// Need SecurityMonitoringRule ID as ID for terraform resource +func (g *SecurityMonitoringRuleGenerator) InitResources() error { + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) + authV2 := g.Args["authV2"].(context.Context) + + pageSize := int64(1000) + resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(resp.GetData()) + return nil +} From b34ef63d71f10150286ddb24628f245bb64cda7b Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 10:18:35 -0500 Subject: [PATCH 049/276] add slo and synthetics resources support --- README.md | 9 ++ providers/datadog/datadog_provider.go | 17 ++-- providers/datadog/service_level_objective.go | 91 +++++++++++++++++++ .../datadog/synthetics_global_variable.go | 85 +++++++++++++++++ .../datadog/synthetics_private_location.go | 85 +++++++++++++++++ 5 files changed, 280 insertions(+), 7 deletions(-) create mode 100644 providers/datadog/service_level_objective.go create mode 100644 providers/datadog/synthetics_global_variable.go create mode 100644 providers/datadog/synthetics_private_location.go diff --git a/README.md b/README.md index 8acd5fe220..fb12445084 100644 --- a/README.md +++ b/README.md @@ -1412,8 +1412,17 @@ List of supported Datadog services: * `datadog_monitor` * `screenboard` * `datadog_screenboard` +* `service_level_objective` + * `datadog_service_level_objective` + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option * `synthetics` * `datadog_synthetics_test` +* `synthetics_global_variables` + * `datadog_synthetics_global_variables` + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option +* `synthetics_private_location` + * `datadog_synthetics_private_location` + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option * `timeboard` * `datadog_timeboard` * `user` diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 4218705a80..c3a3be9287 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -180,13 +180,16 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { // GetSupportedService return map of support service for Datadog func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "dashboard": &DashboardGenerator{}, - "downtime": &DowntimeGenerator{}, - "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, - "synthetics": &SyntheticsGenerator{}, - "timeboard": &TimeboardGenerator{}, - "user": &UserGenerator{}, + "dashboard": &DashboardGenerator{}, + "downtime": &DowntimeGenerator{}, + "monitor": &MonitorGenerator{}, + "screenboard": &ScreenboardGenerator{}, + "service_level_objective": &ServiceLevelObjectiveGenerator{}, + "synthetics": &SyntheticsGenerator{}, + "synthetics_global_variable": &SyntheticsGlobalVariableGenerator{}, + "synthetics_private_location": &SyntheticsPrivateLocationGenerator{}, + "timeboard": &TimeboardGenerator{}, + "user": &UserGenerator{}, } } diff --git a/providers/datadog/service_level_objective.go b/providers/datadog/service_level_objective.go new file mode 100644 index 0000000000..c49a73b05b --- /dev/null +++ b/providers/datadog/service_level_objective.go @@ -0,0 +1,91 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + "log" + "strings" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // ServiceLevelObjectiveAllowEmptyValues ... + ServiceLevelObjectiveAllowEmptyValues = []string{"tags."} +) + +// ServiceLevelObjectiveGenerator ... +type ServiceLevelObjectiveGenerator struct { + DatadogService +} + +func (g *ServiceLevelObjectiveGenerator) createResources(sloList []datadogV1.ServiceLevelObjective) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, slo := range sloList { + resourceID := slo.GetId() + resources = append(resources, g.createResource(resourceID)) + } + + return resources +} + +func (g *ServiceLevelObjectiveGenerator) createResource(sloID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + sloID, + fmt.Sprintf("service_level_objective_%s", sloID), + "datadog_service_level_objective", + "datadog", + ServiceLevelObjectiveAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each service_level_objective create 1 TerraformResource. +// Need ServiceLevelObjective ID as ID for terraform resource +func (g *ServiceLevelObjectiveGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + var sloIDs []string + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("service_level_objective") { + for _, v := range filter.AcceptableValues { + resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.GetSLO(authV1, v).Execute() + if err != nil { + log.Printf("error retrieving service level objective id:%s - %s", v, err) + continue + } + data := resp.GetData() + sloIDs = append(sloIDs, data.GetId()) + } + } + } + + if len(sloIDs) == 0 { + log.Print("Filter(SLO IDs) is required for importing datadog_service_level_objective resource") + return nil + } + + resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.ListSLOs(authV1).Ids(strings.Join(sloIDs, ",")).Execute() + if err != nil { + return err + } + g.Resources = g.createResources(resp.GetData()) + return nil +} diff --git a/providers/datadog/synthetics_global_variable.go b/providers/datadog/synthetics_global_variable.go new file mode 100644 index 0000000000..469e14f54b --- /dev/null +++ b/providers/datadog/synthetics_global_variable.go @@ -0,0 +1,85 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + "log" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // SyntheticsGlobalVariableAllowEmptyValues ... + SyntheticsGlobalVariableAllowEmptyValues = []string{"tags."} +) + +// SyntheticsGlobalVariableGenerator ... +type SyntheticsGlobalVariableGenerator struct { + DatadogService +} + +func (g *SyntheticsGlobalVariableGenerator) createResources(globalVariables []datadogV1.SyntheticsGlobalVariable) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, globalVariable := range globalVariables { + resourceID := globalVariable.GetId() + resources = append(resources, g.createResource(resourceID)) + } + + return resources +} + +func (g *SyntheticsGlobalVariableGenerator) createResource(globalVariableID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + globalVariableID, + fmt.Sprintf("synthetics_global_variable_%s", globalVariableID), + "datadog_synthetics_global_variable", + "datadog", + SyntheticsGlobalVariableAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each SyntheticsGlobalVariable create 1 TerraformResource. +// Need SyntheticsGlobalVariable ID as ID for terraform resource +func (g *SyntheticsGlobalVariableGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + var globalVariableIDs []datadogV1.SyntheticsGlobalVariable + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("synthetics_global_variable") { + for _, v := range filter.AcceptableValues { + resp, _, err := datadogClientV1.SyntheticsApi.GetGlobalVariable(authV1, v).Execute() + if err != nil { + log.Printf("error retrieving synthetics gloval variable with id:%s - %s", v, err) + continue + } + globalVariableIDs = append(globalVariableIDs, resp) + } + } + } + + if len(globalVariableIDs) == 0 { + log.Print("Filter(Synthetics Global Variable IDs) is required for importing datadog_synthetics_global_variable resource") + return nil + } + + g.Resources = g.createResources(globalVariableIDs) + return nil +} diff --git a/providers/datadog/synthetics_private_location.go b/providers/datadog/synthetics_private_location.go new file mode 100644 index 0000000000..49c60e06a7 --- /dev/null +++ b/providers/datadog/synthetics_private_location.go @@ -0,0 +1,85 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + "log" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // SyntheticsPrivateLocationAllowEmptyValues ... + SyntheticsPrivateLocationAllowEmptyValues = []string{"tags."} +) + +// SyntheticsPrivateLocationGenerator ... +type SyntheticsPrivateLocationGenerator struct { + DatadogService +} + +func (g *SyntheticsPrivateLocationGenerator) createResources(privateLocations []datadogV1.SyntheticsPrivateLocation) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, privateLocation := range privateLocations { + resourceName := privateLocation.GetId() + resources = append(resources, g.createResource(resourceName)) + } + + return resources +} + +func (g *SyntheticsPrivateLocationGenerator) createResource(plID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + plID, + fmt.Sprintf("synthetics_private_location_%s", plID), + "datadog_synthetics_private_location", + "datadog", + SyntheticsPrivateLocationAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each SyntheticsPrivateLocation create 1 TerraformResource. +// Need SyntheticsPrivateLocation ID as ID for terraform resource +func (g *SyntheticsPrivateLocationGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + var privateLocations []datadogV1.SyntheticsPrivateLocation + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("synthetics_private_location") { + for _, v := range filter.AcceptableValues { + resp, _, err := datadogClientV1.SyntheticsApi.GetPrivateLocation(authV1, v).Execute() + if err != nil { + log.Printf("error retrieving synthetics private location with id:%s - %s", v, err) + continue + } + privateLocations = append(privateLocations, resp) + } + } + } + + if len(privateLocations) == 0 { + log.Print("Filter(Synthetics Private Location IDs) is required for importing datadog_synthetics_private_location resource") + return nil + } + + g.Resources = g.createResources(privateLocations) + return nil +} From 95d5523292752d98574492c7dd5718d8e521a47b Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 14:05:33 -0500 Subject: [PATCH 050/276] don't throw an exception if no id is passed --- providers/datadog/metric_metadata.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/providers/datadog/metric_metadata.go b/providers/datadog/metric_metadata.go index c0ae4960ae..e2489a0479 100644 --- a/providers/datadog/metric_metadata.go +++ b/providers/datadog/metric_metadata.go @@ -15,8 +15,8 @@ package datadog import ( - "errors" "fmt" + "log" "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -61,7 +61,8 @@ func (g *MetricMetadataGenerator) InitResources() error { // Collecting all metrics_metadata can be an expensive task. // Hence, only allow collections of metrics passed via filter if len(resources) == 0 { - return errors.New("filtering is required for importing datadog_metric_metadata resource") + log.Print("Filter(metric names as IDs) is required for importing datadog_metric_metadata resource") + return nil } g.Resources = resources return nil From 7f03e76bafeea10fbb3625364af535bd080742b8 Mon Sep 17 00:00:00 2001 From: skarimo Date: Sun, 24 Jan 2021 20:57:04 -0500 Subject: [PATCH 051/276] handle nested ignored attributes properly and add tests --- terraformutils/providerwrapper/provider.go | 10 ++- .../providerwrapper/provider_test.go | 84 +++++++++++++++++++ 2 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 terraformutils/providerwrapper/provider_test.go diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index 2165e895fd..df397425cc 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -107,7 +107,11 @@ func (p *ProviderWrapper) GetReadOnlyAttributes(resourceTypes []string) (map[str func (p *ProviderWrapper) readObjBlocks(block map[string]*configschema.NestedBlock, readOnlyAttributes []string, parent string) []string { for k, v := range block { if len(v.BlockTypes) > 0 { - readOnlyAttributes = p.readObjBlocks(v.BlockTypes, readOnlyAttributes, k) + if parent == "-1" { + readOnlyAttributes = p.readObjBlocks(v.BlockTypes, readOnlyAttributes, k) + } else { + readOnlyAttributes = p.readObjBlocks(v.BlockTypes, readOnlyAttributes, parent+".[0-9]+."+k) + } } fieldCount := 0 for key, l := range v.Attributes { @@ -116,13 +120,13 @@ func (p *ProviderWrapper) readObjBlocks(block map[string]*configschema.NestedBlo switch v.Nesting { case configschema.NestingList: if parent == "-1" { - readOnlyAttributes = append(readOnlyAttributes, "^"+k+".[0-9]."+key+"($|\\.[0-9]|\\.#)") + readOnlyAttributes = append(readOnlyAttributes, "^"+k+".[0-9]+."+key+"($|\\.[0-9]+|\\.#)") } else { readOnlyAttributes = append(readOnlyAttributes, "^"+parent+".(.*)."+key+"$") } case configschema.NestingSet: if parent == "-1" { - readOnlyAttributes = append(readOnlyAttributes, "^"+k+".[0-9]."+key+"$") + readOnlyAttributes = append(readOnlyAttributes, "^"+k+".[0-9]+."+key+"$") } else { readOnlyAttributes = append(readOnlyAttributes, "^"+parent+".(.*)."+key+"($|\\.(.*))") } diff --git a/terraformutils/providerwrapper/provider_test.go b/terraformutils/providerwrapper/provider_test.go new file mode 100644 index 0000000000..d7d96508d0 --- /dev/null +++ b/terraformutils/providerwrapper/provider_test.go @@ -0,0 +1,84 @@ +package providerwrapper //nolint + +import ( + "regexp" + "testing" + + "github.com/hashicorp/terraform/configs/configschema" + "github.com/zclconf/go-cty/cty" +) + +func TestAuthenticationValidate(t *testing.T) { + attribute := map[string]*configschema.Attribute{ + "computed_attribute": { + Type: cty.Number, + Computed: true, + }, + "required_attribute": { + Type: cty.String, + Required: true, + }, + } + + testCases := map[string]struct { + block map[string]*configschema.NestedBlock + ignoredAttributes []string + notIgnoredAttributes []string + }{ + "nesting_set": {map[string]*configschema.NestedBlock{ + "attribute_one": { + Block: configschema.Block{ + Attributes: attribute, + }, + Nesting: configschema.NestingSet, + }, + }, []string{"nesting_set.attribute_one.computed_attribute"}, + []string{"nesting_set.attribute_one.required_attribute"}}, + "nesting_list": {map[string]*configschema.NestedBlock{ + "attribute_one": { + Block: configschema.Block{ + Attributes: map[string]*configschema.Attribute{}, + BlockTypes: map[string]*configschema.NestedBlock{ + "attribute_two_nested": { + Nesting: configschema.NestingList, + Block: configschema.Block{ + Attributes: attribute, + }, + }, + }, + }, + Nesting: configschema.NestingList, + }, + }, []string{"nesting_list.0.attribute_one.0.attribute_two_nested.computed_attribute"}, + []string{"nesting_list.0.attribute_one.0.attribute_two_nested.required_attribute"}}, + } + + for key, tc := range testCases { + t.Run(key, func(t *testing.T) { + provider := ProviderWrapper{} + readOnlyAttributes := provider.readObjBlocks(tc.block, []string{}, key) + for _, attr := range tc.ignoredAttributes { + if ignored := isAttributeIgnored(attr, readOnlyAttributes); !ignored { + t.Errorf("attribute \"%s\" was not ignored. Pattern list: %s", attr, readOnlyAttributes) + } + } + + for _, attr := range tc.notIgnoredAttributes { + if ignored := isAttributeIgnored(attr, readOnlyAttributes); ignored { + t.Errorf("attribute \"%s\" was ignored. Pattern list: %s", attr, readOnlyAttributes) + } + } + }) + } +} + +func isAttributeIgnored(name string, patterns []string) bool { + ignored := false + for _, pattern := range patterns { + if match, _ := regexp.MatchString(pattern, name); match { + ignored = true + break + } + } + return ignored +} From 98d90cfe2468cab435496cd645c7f3aca7c248fc Mon Sep 17 00:00:00 2001 From: skarimo Date: Sun, 24 Jan 2021 21:41:22 -0500 Subject: [PATCH 052/276] add support for terraform v14 plugin path --- terraformutils/providerwrapper/provider.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index 2165e895fd..2ba006d55d 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -241,9 +241,9 @@ func getProviderFileName(providerName string) (string, error) { if defaultDataDir == "" { defaultDataDir = DefaultDataDir } - providerFilePath, err := getProviderFileNameV13(defaultDataDir, providerName) + providerFilePath, err := getProviderFileNameV13andV14(defaultDataDir, providerName) if err != nil || providerFilePath == "" { - providerFilePath, err = getProviderFileNameV13(os.Getenv("HOME")+string(os.PathSeparator)+ + providerFilePath, err = getProviderFileNameV13andV14(os.Getenv("HOME")+string(os.PathSeparator)+ ".terraform.d", providerName) } if err != nil || providerFilePath == "" { @@ -252,13 +252,19 @@ func getProviderFileName(providerName string) (string, error) { return providerFilePath, nil } -func getProviderFileNameV13(prefix, providerName string) (string, error) { - - registryDir := prefix + string(os.PathSeparator) + "plugins" + string(os.PathSeparator) + +func getProviderFileNameV13andV14(prefix, providerName string) (string, error) { + // Read terraform v14 file path + registryDir := prefix + string(os.PathSeparator) + "providers" + string(os.PathSeparator) + "registry.terraform.io" providerDirs, err := ioutil.ReadDir(registryDir) if err != nil { - return "", err + // Read terraform v13 file path + registryDir = prefix + string(os.PathSeparator) + "plugins" + string(os.PathSeparator) + + "registry.terraform.io" + providerDirs, err = ioutil.ReadDir(registryDir) + if err != nil { + return "", err + } } providerFilePath := "" for _, providerDir := range providerDirs { From cda16ce36c9ba3adacf4a981da4adc69e65b54c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 06:32:13 +0000 Subject: [PATCH 053/276] Bump k8s.io/client-go from 0.20.1 to 0.20.2 Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.20.1 to 0.20.2. - [Release notes](https://github.com/kubernetes/client-go/releases) - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.20.1...v0.20.2) Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 40bbd784ec..766ddf289e 100644 --- a/go.mod +++ b/go.mod @@ -60,8 +60,8 @@ require ( google.golang.org/api v0.36.0 google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect - k8s.io/apimachinery v0.20.1 - k8s.io/client-go v0.20.1 + k8s.io/apimachinery v0.20.2 + k8s.io/client-go v0.20.2 ) replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5 diff --git a/go.sum b/go.sum index 890cd8675f..cf24660d56 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 h1:TsOhRZ1r0WptlynSSBp8EuBT4vPRWNzYwbXrMGV0Eto= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.9/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9QpaFc/z2k0mcs7ZVnCRREeZU= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= @@ -1393,12 +1391,12 @@ honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.20.1 h1:ud1c3W3YNzGd6ABJlbFfKXBKXO+1KdGfcgGGNgFR03E= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/apimachinery v0.20.1 h1:LAhz8pKbgR8tUwn7boK+b2HZdt7MiTu2mkYtFMUjTRQ= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/client-go v0.20.1 h1:Qquik0xNFbK9aUG92pxHYsyfea5/RPO9o9bSywNor+M= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= +k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= +k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= +k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= +k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/client-go v0.20.2 h1:uuf+iIAbfnCSw8IGAv/Rg0giM+2bOzHLOsbbrwrdhNQ= +k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= From 1b6ce62ed3644a426d43e6bdeefc9f2cd6c85a30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 10:57:13 +0000 Subject: [PATCH 054/276] Bump github.com/IBM/vpc-go-sdk from 0.3.1 to 0.4.1 Bumps [github.com/IBM/vpc-go-sdk](https://github.com/IBM/vpc-go-sdk) from 0.3.1 to 0.4.1. - [Release notes](https://github.com/IBM/vpc-go-sdk/releases) - [Changelog](https://github.com/IBM/vpc-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/IBM/vpc-go-sdk/compare/v0.3.1...v0.4.1) Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 18 ++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 40bbd784ec..f3e8489ecc 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/IBM/ibm-cos-sdk-go v1.5.0 github.com/IBM/keyprotect-go-client v0.5.2 github.com/IBM/networking-go-sdk v0.12.1 - github.com/IBM/vpc-go-sdk v0.3.1 + github.com/IBM/vpc-go-sdk v0.4.1 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible @@ -60,8 +60,8 @@ require ( google.golang.org/api v0.36.0 google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect - k8s.io/apimachinery v0.20.1 - k8s.io/client-go v0.20.1 + k8s.io/apimachinery v0.20.2 + k8s.io/client-go v0.20.2 ) replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5 diff --git a/go.sum b/go.sum index 890cd8675f..1e288ef81b 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.9 h1:TsOhRZ1r0WptlynSSBp8EuBT4vPRWNzYwbXrMGV0Eto= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.9/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9QpaFc/z2k0mcs7ZVnCRREeZU= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= @@ -126,8 +124,8 @@ github.com/IBM/keyprotect-go-client v0.5.2 h1:A4yp2Fc7mg4dtotZErZXwJb9XKpb3ONexn github.com/IBM/keyprotect-go-client v0.5.2/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI= github.com/IBM/networking-go-sdk v0.12.1 h1:GmzrRjvAyqKMfUPM8Y/R5dce0x5AXTqmseVZ3n7eZks= github.com/IBM/networking-go-sdk v0.12.1/go.mod h1:lzkGBnw5glMB7Nxawfgu19MH4Tjy3KRQ2SYMYl2ck7o= -github.com/IBM/vpc-go-sdk v0.3.1 h1:v7jSq+pkORQOTUxsb/114TzSXvVu1+EIM53Tu/hkJ5o= -github.com/IBM/vpc-go-sdk v0.3.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= +github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= +github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= @@ -1393,12 +1391,12 @@ honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.20.1 h1:ud1c3W3YNzGd6ABJlbFfKXBKXO+1KdGfcgGGNgFR03E= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/apimachinery v0.20.1 h1:LAhz8pKbgR8tUwn7boK+b2HZdt7MiTu2mkYtFMUjTRQ= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/client-go v0.20.1 h1:Qquik0xNFbK9aUG92pxHYsyfea5/RPO9o9bSywNor+M= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= +k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= +k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= +k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= +k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/client-go v0.20.2 h1:uuf+iIAbfnCSw8IGAv/Rg0giM+2bOzHLOsbbrwrdhNQ= +k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= From 54e1111f9e76dd460f6c461b066070f7dc45dc93 Mon Sep 17 00:00:00 2001 From: skarimo Date: Mon, 25 Jan 2021 09:43:49 -0500 Subject: [PATCH 055/276] remove unneccessary api call --- providers/datadog/service_level_objective.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/providers/datadog/service_level_objective.go b/providers/datadog/service_level_objective.go index c49a73b05b..7eb65b3d22 100644 --- a/providers/datadog/service_level_objective.go +++ b/providers/datadog/service_level_objective.go @@ -17,10 +17,8 @@ package datadog import ( "context" "fmt" - "log" - "strings" - datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + "log" "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -62,7 +60,7 @@ func (g *ServiceLevelObjectiveGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - var sloIDs []string + var slos []datadogV1.ServiceLevelObjective for _, filter := range g.Filter { if filter.FieldPath == "id" && filter.IsApplicable("service_level_objective") { for _, v := range filter.AcceptableValues { @@ -72,20 +70,16 @@ func (g *ServiceLevelObjectiveGenerator) InitResources() error { continue } data := resp.GetData() - sloIDs = append(sloIDs, data.GetId()) + slos = append(slos, data) } } } - if len(sloIDs) == 0 { + if len(slos) == 0 { log.Print("Filter(SLO IDs) is required for importing datadog_service_level_objective resource") return nil } - resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.ListSLOs(authV1).Ids(strings.Join(sloIDs, ",")).Execute() - if err != nil { - return err - } - g.Resources = g.createResources(resp.GetData()) + g.Resources = g.createResources(slos) return nil } From 448108f95cbd76fa84c8fe3110591940e3a26c06 Mon Sep 17 00:00:00 2001 From: skarimo Date: Mon, 25 Jan 2021 10:52:09 -0500 Subject: [PATCH 056/276] lint --- providers/datadog/service_level_objective.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/datadog/service_level_objective.go b/providers/datadog/service_level_objective.go index 7eb65b3d22..d405c26848 100644 --- a/providers/datadog/service_level_objective.go +++ b/providers/datadog/service_level_objective.go @@ -17,9 +17,10 @@ package datadog import ( "context" "fmt" - datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" "log" + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) From 90f015318a43efd94961fc48a67ba6fd78db647c Mon Sep 17 00:00:00 2001 From: skarimo Date: Mon, 25 Jan 2021 11:39:57 -0500 Subject: [PATCH 057/276] use listlocations endpoint to collect all pl resources --- README.md | 1 - providers/datadog/service_level_objective.go | 3 +- .../datadog/synthetics_private_location.go | 36 +++++++------------ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index a464eb1b72..5a81f8f107 100644 --- a/README.md +++ b/README.md @@ -1456,7 +1456,6 @@ List of supported Datadog services: * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option * `synthetics_private_location` * `datadog_synthetics_private_location` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option * `timeboard` * `datadog_timeboard` * `user` diff --git a/providers/datadog/service_level_objective.go b/providers/datadog/service_level_objective.go index d405c26848..46308524b6 100644 --- a/providers/datadog/service_level_objective.go +++ b/providers/datadog/service_level_objective.go @@ -67,9 +67,10 @@ func (g *ServiceLevelObjectiveGenerator) InitResources() error { for _, v := range filter.AcceptableValues { resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.GetSLO(authV1, v).Execute() if err != nil { - log.Printf("error retrieving service level objective id:%s - %s", v, err) + log.Printf("error retrieving slo id:%s - %s", v, err) continue } + data := resp.GetData() slos = append(slos, data) } diff --git a/providers/datadog/synthetics_private_location.go b/providers/datadog/synthetics_private_location.go index 49c60e06a7..9bd8d72c0d 100644 --- a/providers/datadog/synthetics_private_location.go +++ b/providers/datadog/synthetics_private_location.go @@ -17,7 +17,7 @@ package datadog import ( "context" "fmt" - "log" + "regexp" datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" @@ -27,6 +27,7 @@ import ( var ( // SyntheticsPrivateLocationAllowEmptyValues ... SyntheticsPrivateLocationAllowEmptyValues = []string{"tags."} + plIDRegex = regexp.MustCompile("^pl:.*") ) // SyntheticsPrivateLocationGenerator ... @@ -34,13 +35,14 @@ type SyntheticsPrivateLocationGenerator struct { DatadogService } -func (g *SyntheticsPrivateLocationGenerator) createResources(privateLocations []datadogV1.SyntheticsPrivateLocation) []terraformutils.Resource { +func (g *SyntheticsPrivateLocationGenerator) createResources(locations []datadogV1.SyntheticsLocation) []terraformutils.Resource { resources := []terraformutils.Resource{} - for _, privateLocation := range privateLocations { - resourceName := privateLocation.GetId() - resources = append(resources, g.createResource(resourceName)) + for _, location := range locations { + locationID := location.GetId() + if plIDRegex.MatchString(locationID) { + resources = append(resources, g.createResource(locationID)) + } } - return resources } @@ -61,25 +63,11 @@ func (g *SyntheticsPrivateLocationGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - var privateLocations []datadogV1.SyntheticsPrivateLocation - for _, filter := range g.Filter { - if filter.FieldPath == "id" && filter.IsApplicable("synthetics_private_location") { - for _, v := range filter.AcceptableValues { - resp, _, err := datadogClientV1.SyntheticsApi.GetPrivateLocation(authV1, v).Execute() - if err != nil { - log.Printf("error retrieving synthetics private location with id:%s - %s", v, err) - continue - } - privateLocations = append(privateLocations, resp) - } - } - } - - if len(privateLocations) == 0 { - log.Print("Filter(Synthetics Private Location IDs) is required for importing datadog_synthetics_private_location resource") - return nil + data, _, err := datadogClientV1.SyntheticsApi.ListLocations(authV1).Execute() + if err != nil { + return err } - g.Resources = g.createResources(privateLocations) + g.Resources = g.createResources(data.GetLocations()) return nil } From 7deb96d1bd88ccbdf9cf68427a3ceb498947049c Mon Sep 17 00:00:00 2001 From: skarimo Date: Mon, 25 Jan 2021 12:36:52 -0500 Subject: [PATCH 058/276] update readme.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index debea5730b..03c8124bdb 100644 --- a/README.md +++ b/README.md @@ -1410,6 +1410,7 @@ List of supported Datadog services: * `datadog_downtime` * `metric_metadata` * `datadog_metric_metadata` + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option * `monitor` * `datadog_monitor` * `screenboard` From 3dbbd305f84591f946b36e2eba464d1fca7af710 Mon Sep 17 00:00:00 2001 From: skarimo Date: Mon, 25 Jan 2021 12:42:32 -0500 Subject: [PATCH 059/276] lint --- providers/datadog/synthetics_private_location.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/datadog/synthetics_private_location.go b/providers/datadog/synthetics_private_location.go index 9bd8d72c0d..693885b485 100644 --- a/providers/datadog/synthetics_private_location.go +++ b/providers/datadog/synthetics_private_location.go @@ -27,7 +27,7 @@ import ( var ( // SyntheticsPrivateLocationAllowEmptyValues ... SyntheticsPrivateLocationAllowEmptyValues = []string{"tags."} - plIDRegex = regexp.MustCompile("^pl:.*") + plIDRegex = regexp.MustCompile("^pl:.*") ) // SyntheticsPrivateLocationGenerator ... From bfddafcc46bd842f7d58e78eaad2fad04fbcf20d Mon Sep 17 00:00:00 2001 From: skarimo Date: Mon, 25 Jan 2021 12:47:31 -0500 Subject: [PATCH 060/276] go fmt --- terraformutils/providerwrapper/provider_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terraformutils/providerwrapper/provider_test.go b/terraformutils/providerwrapper/provider_test.go index d7d96508d0..8ec2e97350 100644 --- a/terraformutils/providerwrapper/provider_test.go +++ b/terraformutils/providerwrapper/provider_test.go @@ -21,8 +21,8 @@ func TestAuthenticationValidate(t *testing.T) { } testCases := map[string]struct { - block map[string]*configschema.NestedBlock - ignoredAttributes []string + block map[string]*configschema.NestedBlock + ignoredAttributes []string notIgnoredAttributes []string }{ "nesting_set": {map[string]*configschema.NestedBlock{ @@ -50,7 +50,7 @@ func TestAuthenticationValidate(t *testing.T) { Nesting: configschema.NestingList, }, }, []string{"nesting_list.0.attribute_one.0.attribute_two_nested.computed_attribute"}, - []string{"nesting_list.0.attribute_one.0.attribute_two_nested.required_attribute"}}, + []string{"nesting_list.0.attribute_one.0.attribute_two_nested.required_attribute"}}, } for key, tc := range testCases { From 74c0568c4ccf8b3e0577cc854dc7a6139b0e96f6 Mon Sep 17 00:00:00 2001 From: skarimo Date: Mon, 25 Jan 2021 12:53:03 -0500 Subject: [PATCH 061/276] lint --- terraformutils/providerwrapper/provider_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terraformutils/providerwrapper/provider_test.go b/terraformutils/providerwrapper/provider_test.go index 8ec2e97350..959bdd6e58 100644 --- a/terraformutils/providerwrapper/provider_test.go +++ b/terraformutils/providerwrapper/provider_test.go @@ -8,8 +8,8 @@ import ( "github.com/zclconf/go-cty/cty" ) -func TestAuthenticationValidate(t *testing.T) { - attribute := map[string]*configschema.Attribute{ +func TestIgnoredAttributes(t *testing.T) { + attributes := map[string]*configschema.Attribute{ "computed_attribute": { Type: cty.Number, Computed: true, @@ -28,7 +28,7 @@ func TestAuthenticationValidate(t *testing.T) { "nesting_set": {map[string]*configschema.NestedBlock{ "attribute_one": { Block: configschema.Block{ - Attributes: attribute, + Attributes: attributes, }, Nesting: configschema.NestingSet, }, @@ -42,7 +42,7 @@ func TestAuthenticationValidate(t *testing.T) { "attribute_two_nested": { Nesting: configschema.NestingList, Block: configschema.Block{ - Attributes: attribute, + Attributes: attributes, }, }, }, From f79d2f17c22016e55fb99aec0ca4e9c4288303c1 Mon Sep 17 00:00:00 2001 From: Anil Kumar Nagaraj Date: Wed, 27 Jan 2021 11:45:22 +0530 Subject: [PATCH 062/276] Add dependson parameter to IBM resources --- README.md | 47 ++- cmd/provider_cmd_ibm.go | 5 +- providers/ibm/cis.go | 358 ++++++++++++++++------ providers/ibm/cloud_functions.go | 253 +++++++++++++++ providers/ibm/container_cluster.go | 33 +- providers/ibm/cos.go | 15 +- providers/ibm/iam.go | 47 ++- providers/ibm/ibm_is_floating_ip.go | 92 ++++++ providers/ibm/ibm_is_flow_log.go | 92 ++++++ providers/ibm/ibm_is_ike_policy.go | 84 +++++ providers/ibm/ibm_is_image.go | 93 ++++++ providers/ibm/ibm_is_instance.go | 2 + providers/ibm/ibm_is_instance_template.go | 72 +++++ providers/ibm/ibm_is_ipsec_policy.go | 84 +++++ providers/ibm/ibm_is_lb.go | 221 +++++++++++++ providers/ibm/ibm_is_network_acl.go | 93 ++++++ providers/ibm/ibm_is_public_gateway.go | 92 ++++++ providers/ibm/ibm_is_security_group.go | 21 +- providers/ibm/ibm_is_ssh_key.go | 80 +++++ providers/ibm/ibm_is_subnet.go | 2 + providers/ibm/ibm_is_volume.go | 84 +++++ providers/ibm/ibm_is_vpc.go | 83 ++++- providers/ibm/ibm_is_vpn_gateway.go | 122 ++++++++ providers/ibm/ibm_kp.go | 21 +- providers/ibm/ibm_provider.go | 21 +- providers/ibm/instance_groups.go | 41 ++- providers/ibm/vpc_cluster.go | 17 +- 27 files changed, 1995 insertions(+), 180 deletions(-) create mode 100644 providers/ibm/cloud_functions.go create mode 100644 providers/ibm/ibm_is_floating_ip.go create mode 100644 providers/ibm/ibm_is_flow_log.go create mode 100644 providers/ibm/ibm_is_ike_policy.go create mode 100644 providers/ibm/ibm_is_image.go create mode 100644 providers/ibm/ibm_is_instance_template.go create mode 100644 providers/ibm/ibm_is_ipsec_policy.go create mode 100644 providers/ibm/ibm_is_lb.go create mode 100644 providers/ibm/ibm_is_network_acl.go create mode 100644 providers/ibm/ibm_is_public_gateway.go create mode 100644 providers/ibm/ibm_is_ssh_key.go create mode 100644 providers/ibm/ibm_is_volume.go create mode 100644 providers/ibm/ibm_is_vpn_gateway.go diff --git a/README.md b/README.md index eb866abe32..b3e0e91ad7 100644 --- a/README.md +++ b/README.md @@ -914,6 +914,7 @@ If you want to run Terraformer with the IBM Cloud provider plugin on your system export IC_API_KEY= export IC_REGION= terraformer import ibm --resources=ibm_is_vpc --resource_group=a0d5213d831a454ebace7ed38ca9c8ca + terraformer import ibm --resources=ibm_function --region=us-south ``` List of supported IBM Cloud resources: @@ -946,23 +947,49 @@ List of supported IBM Cloud resources: * `ibm_is_instance_group` * `ibm_is_instance_group_manager` * `ibm_is_instance_group_manager_policy` -* `ibm_is_vpc` - * `ibm_is_vpc` - * `ibm_is_vpc_address_prefix` - * `ibm_is_vpc_route` -* `ibm_is_subnet` -* `ibm_is_instance` -* `ibm_is_security_group` - * `ibm_is_security_group_rule` * `ibm_cis` * `ibm_cis` * `ibm_cis_dns_record` * `ibm_cis_firewall` * `ibm_cis_domain_settings` * `ibm_cis_global_load_balancer` - * `ibm_cis_origin_pool` + * `ibm_cis_edge_functions_action` + * `ibm_cis_edge_functions_trigger` * `ibm_cis_healthcheck` - * `ibm_cis_rate_limit` + * `ibm_cis_rate_limit` +* `ibm_is_vpc` + * `ibm_is_vpc` + * `ibm_is_vpc_address_prefix` + * `ibm_is_vpc_route` + * `ibm_is_vpc_routing_table` + * `ibm_is_vpc_routing_table_route` +* `ibm_is_subnet` +* `ibm_is_instance` +* `ibm_is_security_group` + * `ibm_is_security_group_rule` +* `ibm_is_network_acl` +* `ibm_is_public_gateway` +* `ibm_is_volume` +* `ibm_is_vpn_gateway` + * `ibm_is_vpn_gateway_connections` +* `ibm_is_lb` + * `ibm_is_lb_pool` + * `ibm_is_lb_pool_member` + * `ibm_is_lb_listener` + * `ibm_is_lb_listener_policy` + * `ibm_is_lb_listener_policy_rule` +* `ibm_is_floating_ip` +* `ibm_is_flow_log` +* `ibm_is_ike_policy` +* `ibm_is_image` +* `ibm_is_instance_template` +* `ibm_is_ipsec_policy` +* `ibm_is_ssh_key` +* `ibm_function` + * `ibm_function_package` + * `ibm_function_action` + * `ibm_function_rule` + * `ibm_function_trigger` ### Use with DigitalOcean diff --git a/cmd/provider_cmd_ibm.go b/cmd/provider_cmd_ibm.go index ee487143a1..fd9e6c6f99 100644 --- a/cmd/provider_cmd_ibm.go +++ b/cmd/provider_cmd_ibm.go @@ -22,13 +22,14 @@ import ( func newCmdIbmImporter(options ImportOptions) *cobra.Command { var resourceGroup string + var region string cmd := &cobra.Command{ Use: "ibm", Short: "Import current state to Terraform configuration from ibm", Long: "Import current state to Terraform configuration from ibm", RunE: func(cmd *cobra.Command, args []string) error { provider := newIbmProvider() - err := Import(provider, options, []string{resourceGroup}) + err := Import(provider, options, []string{resourceGroup, region}) if err != nil { return err } @@ -38,8 +39,8 @@ func newCmdIbmImporter(options ImportOptions) *cobra.Command { cmd.AddCommand(listCmd(newIbmProvider())) baseProviderFlags(cmd.PersistentFlags(), &options, "server", "ibm_server=name1:name2:name3") - // baseProviderFlags(cmd.PersistentFlags(), &options, "resource_group", "resource_group=name1:name2:name3") cmd.PersistentFlags().StringVarP(&resourceGroup, "resource_group", "", "", "resource_group=default") + cmd.PersistentFlags().StringVarP(®ion, "region", "R", "", "region=us-south") return cmd } diff --git a/providers/ibm/cis.go b/providers/ibm/cis.go index 3e0928e428..f553bdada4 100644 --- a/providers/ibm/cis.go +++ b/providers/ibm/cis.go @@ -26,9 +26,10 @@ import ( "github.com/IBM-Cloud/bluemix-go/session" "github.com/IBM/go-sdk-core/v3/core" "github.com/IBM/networking-go-sdk/dnsrecordsv1" + "github.com/IBM/networking-go-sdk/edgefunctionsapiv1" "github.com/IBM/networking-go-sdk/globalloadbalancermonitorv1" - "github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0" "github.com/IBM/networking-go-sdk/globalloadbalancerv1" + "github.com/IBM/networking-go-sdk/pageruleapiv1" "github.com/IBM/networking-go-sdk/zonelockdownv1" "github.com/IBM/networking-go-sdk/zoneratelimitsv1" "github.com/IBM/networking-go-sdk/zonesv1" @@ -39,69 +40,93 @@ type CISGenerator struct { IBMService } -func (g CISGenerator) loadInstances(crn, name string) terraformutils.Resource { +func (g CISGenerator) loadInstances(crn, name, resGrpID string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( crn, name, "ibm_cis", - g.ProviderName, - []string{}) + "ibm", + map[string]string{ + "resource_group_id": resGrpID, + }, + []string{}, + map[string]interface{}{}) return resources } -func (g CISGenerator) loadDomains(crn, domainID string) terraformutils.Resource { +func (g CISGenerator) loadDomains(crn, domainID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s:%s", domainID, crn), domainID, "ibm_cis_domain", - g.ProviderName, - []string{}) + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string) terraformutils.Resource { +func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", dnsRecordID, domainID, crn), dnsRecordID, "ibm_cis_dns_record", - g.ProviderName, - []string{}) + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g CISGenerator) loadFirewallLockdown(crn, domainID, fID, fType string) terraformutils.Resource { +func (g CISGenerator) loadFirewallLockdown(resourceName, crn, domainID, fID, fType string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s:%s:%s:%s", fType, fID, domainID, crn), - fID, + resourceName, "ibm_cis_firewall", - g.ProviderName, - []string{}) + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g CISGenerator) loadDomainSettings(crn, dID string) terraformutils.Resource { +func (g CISGenerator) loadDomainSettings(crn, dID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s:%s", dID, crn), dID, "ibm_cis_domain_settings", - g.ProviderName, - []string{}) + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string) terraformutils.Resource { +func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", gID, dID, crn), fmt.Sprintf("%s:%s:%s", gID, dID, crn), - dID, "ibm_cis_global_load_balancer", - g.ProviderName, - []string{}) + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } @@ -116,25 +141,102 @@ func (g CISGenerator) loadGlobalBalancerPool(crn, pID string) terraformutils.Res return resources } -func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID string) terraformutils.Resource { +func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s:%s", gblmID, crn), gblmID, "ibm_cis_healthcheck", - g.ProviderName, - []string{}) + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g CISGenerator) loadRateLimit(crn, dID, rID string) terraformutils.Resource { +func (g CISGenerator) loadRateLimit(resourceName, crn, dID, rID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", rID, dID, crn), - rID, + resourceName, "ibm_cis_rate_limit", - g.ProviderName, - []string{}) + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g CISGenerator) loadEdgeFunctionAction(crn, dID, actionID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", actionID, dID, crn), + actionID, + "ibm_cis_edge_functions_action", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g CISGenerator) loadEdgeFunctionTrigger(crn, dID, triggerID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", triggerID, dID, crn), + triggerID, + "ibm_cis_edge_functions_trigger", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g CISGenerator) loadWafRulePackage(crn, dID, pkgID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", pkgID, dID, crn), + pkgID, + "ibm_cis_waf_package", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{}) + return resources +} + +func (g CISGenerator) loadPageRule(crn, dID, ruleID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", ruleID, dID, crn), + ruleID, + "ibm_cis_page_rule", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{}) + return resources +} + +func (g CISGenerator) loadCustomPage(crn, dID, cpID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", cpID, dID, crn), + cpID, + "ibm_cis_custom_page", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{}) return resources } @@ -188,7 +290,11 @@ func (g *CISGenerator) InitResources() error { for _, c := range cisInstances { //Instance crn := c.Crn.String() - g.Resources = append(g.Resources, g.loadInstances(crn, c.Name)) + g.Resources = append(g.Resources, g.loadInstances(crn, c.Name, c.ResourceGroupID)) + + var cisDependsOn []string + cisDependsOn = append(cisDependsOn, + "ibm_cis."+terraformutils.TfSanitize(c.Name)) //Domain zoneOpts := &zonesv1.ZonesV1Options{ @@ -210,8 +316,31 @@ func (g *CISGenerator) InitResources() error { return err } + //Health Monitor + gblmOpts := &globalloadbalancermonitorv1.GlobalLoadBalancerMonitorV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, + Crn: &crn, + } + + gblmService, _ := globalloadbalancermonitorv1.NewGlobalLoadBalancerMonitorV1(gblmOpts) + gblmList, _, err := gblmService.ListAllLoadBalancerMonitors(&globalloadbalancermonitorv1.ListAllLoadBalancerMonitorsOptions{}) + if err != nil { + return err + } + + for _, gblm := range gblmList.Result { + g.Resources = append(g.Resources, g.loadGlobalBalancerMonitor(crn, *gblm.ID, cisDependsOn)) + } + for _, z := range zoneList.Result { - g.Resources = append(g.Resources, g.loadDomains(crn, *z.ID)) + var domainDependsOn []string + domainDependsOn = append(domainDependsOn, + "ibm_cis."+terraformutils.TfSanitize(c.Name)) + domainDependsOn = append(domainDependsOn, + "ibm_cis_domain."+terraformutils.TfSanitize(*z.ID)) + + g.Resources = append(g.Resources, g.loadDomains(crn, *z.ID, domainDependsOn)) //DNS Record zoneID := *z.ID @@ -224,6 +353,9 @@ func (g *CISGenerator) InitResources() error { ZoneIdentifier: &zoneID, } + //Domain Setting + g.Resources = append(g.Resources, g.loadDomainSettings(crn, *z.ID, domainDependsOn)) + dnsService, err := dnsrecordsv1.NewDnsRecordsV1(dnsOpts) if err != nil { return err @@ -235,35 +367,62 @@ func (g *CISGenerator) InitResources() error { return err } - for _, d := range dnsList.Result { - g.Resources = append(g.Resources, g.loadDNSRecords(crn, *z.ID, *d.ID)) - } - - //Domain Setting - g.Resources = append(g.Resources, g.loadDomainSettings(crn, *z.ID)) - - //Global Load Balancer - gblSetttingOpts := &globalloadbalancerv1.GlobalLoadBalancerV1Options{ + //IBM Network CIS WAF Package + // cisWAFPackageOpt := &wafrulepackagesapiv1.WafRulePackagesApiV1Options{ + // URL: DefaultCisURL, + // Authenticator: &core.BearerTokenAuthenticator{ + // BearerToken: bluemixToken, + // }, + // Crn: &crn, + // ZoneID: &zoneID, + // } + // cisWAFPackageClient, _ := wafrulepackagesapiv1.NewWafRulePackagesApiV1(cisWAFPackageOpt) + // wasPkgList, _, err := cisWAFPackageClient.ListWafPackages(&wafrulepackagesapiv1.ListWafPackagesOptions{}) + // if err != nil { + // return err + // } + + // for _, wafPkg := range wasPkgList.Result { + // fmt.Println("*wfpackge.ID ::", *wafPkg.Name) + // //g.Resources = append(g.Resources, g.loadWafRulePackage(crn, *z.ID, *wafPkg.ID, domainDependsOn)) + // } + + //IBM Network CIS Page Rules + cisPageRuleOpt := &pageruleapiv1.PageRuleApiV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ BearerToken: bluemixToken, }, - Crn: &crn, - ZoneIdentifier: &zoneID, + Crn: &crn, + ZoneID: &zoneID, } - - gblService, err := globalloadbalancerv1.NewGlobalLoadBalancerV1(gblSetttingOpts) + cisPageRuleClient, _ := pageruleapiv1.NewPageRuleApiV1(cisPageRuleOpt) + cisPgList, _, err := cisPageRuleClient.ListPageRules(&pageruleapiv1.ListPageRulesOptions{}) if err != nil { return err } - gblList, _, err := gblService.ListAllLoadBalancers(&globalloadbalancerv1.ListAllLoadBalancersOptions{}) + for _, pg := range cisPgList.Result { + g.Resources = append(g.Resources, g.loadPageRule(crn, *z.ID, *pg.ID, domainDependsOn)) + } + + //Rate Limit + rateLimitPoolOpts := &zoneratelimitsv1.ZoneRateLimitsV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + rateLimitService, _ := zoneratelimitsv1.NewZoneRateLimitsV1(rateLimitPoolOpts) + rateLimitList, _, err := rateLimitService.ListAllZoneRateLimits(&zoneratelimitsv1.ListAllZoneRateLimitsOptions{}) if err != nil { return err } - for _, gb := range gblList.Result { - g.Resources = append(g.Resources, g.loadGlobalBalancer(crn, *z.ID, *gb.ID)) + for _, rl := range rateLimitList.Result { + resourceName := fmt.Sprintf("%s:%s", "ibm_cis_rate_limit", *z.ID) + g.Resources = append(g.Resources, g.loadRateLimit(resourceName, crn, *z.ID, *rl.ID, domainDependsOn)) } //Firewall Lockdown @@ -286,63 +445,68 @@ func (g *CISGenerator) InitResources() error { return err } - for _, f := range firewallList.Result { - g.Resources = append(g.Resources, g.loadFirewallLockdown(crn, *z.ID, *f.ID, "lockdowns")) - } - - //Health Monitor - gblmOpts := &globalloadbalancermonitorv1.GlobalLoadBalancerMonitorV1Options{ - URL: DefaultCisURL, - Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, - Crn: &crn, - } - - gblmService, _ := globalloadbalancermonitorv1.NewGlobalLoadBalancerMonitorV1(gblmOpts) - gblmList, _, err := gblmService.ListAllLoadBalancerMonitors(&globalloadbalancermonitorv1.ListAllLoadBalancerMonitorsOptions{}) - if err != nil { - return err - } - - for _, gblm := range gblmList.Result { - g.Resources = append(g.Resources, g.loadGlobalBalancerMonitor(crn, *gblm.ID)) - } - - //GlobaloadBalancer Pool - gblPoolOpts := &globalloadbalancerpoolsv0.GlobalLoadBalancerPoolsV0Options{ - URL: DefaultCisURL, - Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, - Crn: &crn, + // IBM Network CIS Edge Function Triggers + cisEdgeFunctionOpt := &edgefunctionsapiv1.EdgeFunctionsApiV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, } - gblpService, _ := globalloadbalancerpoolsv0.NewGlobalLoadBalancerPoolsV0(gblPoolOpts) - gblpList, _, err := gblpService.ListAllLoadBalancerPools(&globalloadbalancerpoolsv0.ListAllLoadBalancerPoolsOptions{}) + cisEdgeFunctionClient, _ := edgefunctionsapiv1.NewEdgeFunctionsApiV1(cisEdgeFunctionOpt) + edgeTriggerList, _, err := cisEdgeFunctionClient.ListEdgeFunctionsTriggers(&edgefunctionsapiv1.ListEdgeFunctionsTriggersOptions{}) if err != nil { return err } - for _, gblp := range gblpList.Result { - g.Resources = append(g.Resources, g.loadGlobalBalancerPool(crn, *gblp.ID)) + actionName := "" + for _, el := range edgeTriggerList.Result { + actionName = *el.Script + g.Resources = append(g.Resources, g.loadEdgeFunctionTrigger(crn, *z.ID, *el.ID, domainDependsOn)) } - //Rate Limit - rateLimitPoolOpts := &zoneratelimitsv1.ZoneRateLimitsV1Options{ - URL: DefaultCisURL, - Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, - Crn: &crn, - ZoneIdentifier: &zoneID, + if actionName != "" { + g.Resources = append(g.Resources, g.loadEdgeFunctionAction(crn, *z.ID, actionName, domainDependsOn)) } - rateLimitService, _ := zoneratelimitsv1.NewZoneRateLimitsV1(rateLimitPoolOpts) - rateLimitList, _, err := rateLimitService.ListAllZoneRateLimits(&zoneratelimitsv1.ListAllZoneRateLimitsOptions{}) - if err != nil { - return err + for _, f := range firewallList.Result { + resourceName := fmt.Sprintf("%s:%s", "ibm_cis_firewall", *f.ID) + g.Resources = append(g.Resources, g.loadFirewallLockdown(resourceName, crn, *z.ID, *f.ID, "lockdowns", domainDependsOn)) } - for _, rl := range rateLimitList.Result { - g.Resources = append(g.Resources, g.loadRateLimit(crn, *z.ID, *rl.ID)) + for _, d := range dnsList.Result { + dnsDependsOn := append(domainDependsOn, + "ibm_cis_dns_record."+terraformutils.TfSanitize(*d.ID)) + + g.Resources = append(g.Resources, g.loadDNSRecords(crn, *z.ID, *d.ID, domainDependsOn)) + + //Global Load Balancer + gblSetttingOpts := &globalloadbalancerv1.GlobalLoadBalancerV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + gblService, err := globalloadbalancerv1.NewGlobalLoadBalancerV1(gblSetttingOpts) + if err != nil { + return err + } + + gblList, _, err := gblService.ListAllLoadBalancers(&globalloadbalancerv1.ListAllLoadBalancersOptions{}) + if err != nil { + return err + } + + for _, gb := range gblList.Result { + g.Resources = append(g.Resources, g.loadGlobalBalancer(crn, *z.ID, *gb.ID, dnsDependsOn)) + } } } - } return nil diff --git a/providers/ibm/cloud_functions.go b/providers/ibm/cloud_functions.go new file mode 100644 index 0000000000..40c8995a8c --- /dev/null +++ b/providers/ibm/cloud_functions.go @@ -0,0 +1,253 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "net/http" + "net/url" + "os" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + + ns "github.com/IBM-Cloud/bluemix-go/api/functions" + "github.com/IBM-Cloud/bluemix-go/session" + + "github.com/apache/openwhisk-client-go/whisk" +) + +// CloudFunctionGenerator .. +type CloudFunctionGenerator struct { + IBMService +} + +func (g CloudFunctionGenerator) loadPackages(namespace, pkgName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s", namespace, pkgName), + pkgName, + "ibm_function_package", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{}) + return resources +} + +func (g CloudFunctionGenerator) loadRules(namespace, ruleName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s", namespace, ruleName), + ruleName, + "ibm_function_rule", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{}) + return resources +} + +func (g CloudFunctionGenerator) loadTriggers(namespace, triggerName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s:%s", namespace, triggerName), + triggerName, + "ibm_function_trigger", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{}) + return resources +} + +/* + * + * Configure a HTTP client using the OpenWhisk properties (i.e. host, auth, iamtoken) + * Only cf-based namespaces needs auth key value. + * iam-based namespace don't have an auth key and needs only iam token for authorization. + * + */ +func setupOpenWhiskClientConfigIAM(response ns.NamespaceResponse, c *bluemix.Config, region string) (*whisk.Client, error) { + u, _ := url.Parse(fmt.Sprintf("https://%s.functions.cloud.ibm.com/api", region)) + wskClient, _ := whisk.NewClient(http.DefaultClient, &whisk.Config{ + Host: u.Host, + Version: "v1", + }) + + if os.Getenv("TF_LOG") != "" { + whisk.SetDebug(true) + } + + // Configure whisk properties to handle iam-based/iam-migrated namespaces. + if response.IsIamEnabled() { + additionalHeaders := make(http.Header) + additionalHeaders.Add("Authorization", c.IAMAccessToken) + additionalHeaders.Add("X-Namespace-Id", response.GetID()) + + wskClient.Config.Namespace = response.GetID() + wskClient.Config.AdditionalHeaders = additionalHeaders + return wskClient, nil + } + + return nil, fmt.Errorf("Failed to create whisk config object for IAM based namespace '%v'", response.GetName()) +} + +// InitResources .. +func (g *CloudFunctionGenerator) InitResources() error { + var region string + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + + rg := g.Args["region"] + if rg != "" { + region = rg.(string) + } else { + region = "us-south" + } + bmxConfig.Region = region + + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + err = authenticateAPIKey(sess) + if err != nil { + return err + } + + err = authenticateCF(sess) + if err != nil { + return err + } + + nsClient, err := ns.New(sess) + if err != nil { + return err + } + + nsList, err := nsClient.Namespaces().GetNamespaces() + if err != nil { + return nil + } + + for _, n := range nsList.Namespaces { + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_function_namespace."+terraformutils.TfSanitize(n.GetID())) + + //Namespace + if n.IsCf() { + continue + } + + //Build whisk object + wskClient, err := setupOpenWhiskClientConfigIAM(n, sess.Config, region) + if err != nil { + return err + } + + //Package + packageService := wskClient.Packages + pkgOptions := &whisk.PackageListOptions{ + Limit: 100, + Skip: 0, + } + pkgs, _, err := packageService.List(pkgOptions) + if err != nil { + return fmt.Errorf("Error retrieving IBM Cloud Function package: %s", err) + } + + for _, p := range pkgs { + g.Resources = append(g.Resources, g.loadPackages(n.GetName(), p.GetName())) + } + + //Action + actionService := wskClient.Actions + actionOptions := &whisk.ActionListOptions{ + Limit: 100, + Skip: 0, + } + actions, _, err := actionService.List("", actionOptions) + if err != nil { + return fmt.Errorf("Error retrieving IBM Cloud Function action: %s", err) + } + + for _, a := range actions { + actionID := "" + parts := strings.Split(a.Namespace, "/") + if len(parts) == 2 { + var pkgDependsOn []string + pkgDependsOn = append(pkgDependsOn, + "ibm_function_package."+terraformutils.TfSanitize(parts[1])) + actionID = fmt.Sprintf("%s/%s", parts[1], a.Name) + g.Resources = append(g.Resources, terraformutils.NewResource( + fmt.Sprintf("%s:%s", n.GetName(), actionID), + a.Name, + "ibm_function_action", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": pkgDependsOn, + })) + } else { + g.Resources = append(g.Resources, terraformutils.NewResource( + fmt.Sprintf("%s:%s", n.GetName(), a.Name), + a.Name, + "ibm_function_action", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{})) + } + } + + //Rule + ruleService := wskClient.Rules + ruleOptions := &whisk.RuleListOptions{ + Limit: 100, + Skip: 0, + } + rules, _, err := ruleService.List(ruleOptions) + if err != nil { + return fmt.Errorf("Error retrieving IBM Cloud Function rule: %s", err) + } + + for _, r := range rules { + g.Resources = append(g.Resources, g.loadRules(n.GetName(), r.Name)) + } + + //Triggers + triggerService := wskClient.Triggers + triggerOptions := &whisk.TriggerListOptions{ + Limit: 100, + Skip: 0, + } + triggers, _, err := triggerService.List(triggerOptions) + if err != nil { + return fmt.Errorf("Error retrieving IBM Cloud Function trigger: %s", err) + } + + for _, t := range triggers { + g.Resources = append(g.Resources, g.loadTriggers(n.GetName(), t.Name)) + } + } + + return nil +} diff --git a/providers/ibm/container_cluster.go b/providers/ibm/container_cluster.go index 4a91f98289..a6c69f3800 100644 --- a/providers/ibm/container_cluster.go +++ b/providers/ibm/container_cluster.go @@ -39,25 +39,33 @@ func (g ContainerClusterGenerator) loadcluster(clustersID, clusterName string) t return resources } -func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID, PoolName string) terraformutils.Resource { +func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", clustersID, poolID), - PoolName, + poolID, "ibm_container_worker_pool", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g ContainerClusterGenerator) loadWorkerPoolZones(clustersID, poolID, zoneID string) terraformutils.Resource { +func (g ContainerClusterGenerator) loadWorkerPoolZones(clustersID, poolID, zoneID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", clustersID, poolID, zoneID), fmt.Sprintf("%s/%s/%s", clustersID, poolID, zoneID), - zoneID, "ibm_container_worker_pool_zone_attachment", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } @@ -87,11 +95,16 @@ func (g *ContainerClusterGenerator) InitResources() error { } for _, pool := range workerPools { if pool.Name != "default" { - g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, pool.Name)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_container_cluster."+terraformutils.TfSanitize(cs.Name)) + g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, dependsOn)) + dependsOn = append(dependsOn, + "ibm_container_worker_pool."+terraformutils.TfSanitize(pool.ID)) zones := pool.Zones for _, zone := range zones { - g.Resources = append(g.Resources, g.loadWorkerPoolZones(cs.ID, pool.ID, zone.ID)) + g.Resources = append(g.Resources, g.loadWorkerPoolZones(cs.ID, pool.ID, zone.ID, dependsOn)) } } } diff --git a/providers/ibm/cos.go b/providers/ibm/cos.go index 3b7b6c19ea..1fc3449b38 100644 --- a/providers/ibm/cos.go +++ b/providers/ibm/cos.go @@ -47,14 +47,18 @@ func (g COSGenerator) loadCOS(cosID string, cosName string) terraformutils.Resou return resources } -func (g COSGenerator) loadCOSBuckets(bucketID, bucketName string) terraformutils.Resource { +func (g COSGenerator) loadCOSBuckets(bucketID, bucketName string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( bucketID, bucketName, "ibm_cos_bucket", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } @@ -99,6 +103,9 @@ func (g *COSGenerator) InitResources() error { crossRegionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{4,8}$") d, _ := s3Client.ListBucketsExtended(&coss3.ListBucketsExtendedInput{}) for _, b := range d.Buckets { + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_resource_instance."+terraformutils.TfSanitize(cs.Name)) var apiType, location string bLocationConstraint := *b.LocationConstraint if singleSiteLocationRegex.MatchString(bLocationConstraint) { @@ -114,7 +121,7 @@ func (g *COSGenerator) InitResources() error { location = strings.Split(bLocationConstraint, "-")[0] } bucketID := fmt.Sprintf("%s:%s:%s:meta:%s:%s", strings.Replace(cs.ID, "::", "", -1), "bucket", *b.Name, apiType, location) - g.Resources = append(g.Resources, g.loadCOSBuckets(bucketID, *b.Name)) + g.Resources = append(g.Resources, g.loadCOSBuckets(bucketID, *b.Name, dependsOn)) } } diff --git a/providers/ibm/iam.go b/providers/ibm/iam.go index fe1862adb8..000e2409da 100644 --- a/providers/ibm/iam.go +++ b/providers/ibm/iam.go @@ -42,47 +42,59 @@ func (g IAMGenerator) loadUserPolicies(policyID string, user string) terraformut return resources } -func (g IAMGenerator) loadAccessGroups(grpID, grpName string) terraformutils.Resource { +func (g IAMGenerator) loadAccessGroups(grpID string) terraformutils.Resource { var resources terraformutils.Resource resources = terraformutils.NewSimpleResource( - fmt.Sprintf("%s/%s", grpID, grpName), - grpName, + grpID, + grpID, "ibm_iam_access_group", "ibm", []string{}) return resources } -func (g IAMGenerator) loadAccessGroupMembers(grpID string) terraformutils.Resource { +func (g IAMGenerator) loadAccessGroupMembers(grpID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, grpID), grpID, "ibm_iam_access_group_members", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g IAMGenerator) loadAccessGroupPolicies(grpID, policyID string) terraformutils.Resource { +func (g IAMGenerator) loadAccessGroupPolicies(grpID, policyID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, policyID), policyID, "ibm_iam_access_group_policy", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g IAMGenerator) loadAccessGroupDynamicPolicies(grpID, ruleID string) terraformutils.Resource { +func (g IAMGenerator) loadAccessGroupDynamicPolicies(grpID, ruleID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, ruleID), ruleID, "ibm_iam_access_group_dynamic_rule", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } @@ -148,8 +160,11 @@ func (g *IAMGenerator) InitResources() error { return err } for _, group := range agrps { - g.Resources = append(g.Resources, g.loadAccessGroups(group.ID, group.Name)) - g.Resources = append(g.Resources, g.loadAccessGroupMembers(group.ID)) + g.Resources = append(g.Resources, g.loadAccessGroups(group.ID)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_iam_access_group."+terraformutils.TfSanitize(group.ID)) + g.Resources = append(g.Resources, g.loadAccessGroupMembers(group.ID, dependsOn)) policies, err := iampap.V1Policy().List(iampapv1.SearchParams{ AccountID: accountID, @@ -160,7 +175,7 @@ func (g *IAMGenerator) InitResources() error { return fmt.Errorf("Error retrieving access group policy: %s", err) } for _, p := range policies { - g.Resources = append(g.Resources, g.loadAccessGroupPolicies(group.ID, p.ID)) + g.Resources = append(g.Resources, g.loadAccessGroupPolicies(group.ID, p.ID, dependsOn)) } dynamicPolicies, err := iamuumClient.DynamicRule().List(group.ID) @@ -168,7 +183,7 @@ func (g *IAMGenerator) InitResources() error { return err } for _, d := range dynamicPolicies { - g.Resources = append(g.Resources, g.loadAccessGroupDynamicPolicies(group.ID, d.RuleID)) + g.Resources = append(g.Resources, g.loadAccessGroupDynamicPolicies(group.ID, d.RuleID, dependsOn)) } } diff --git a/providers/ibm/ibm_is_floating_ip.go b/providers/ibm/ibm_is_floating_ip.go new file mode 100644 index 0000000000..495db7cec5 --- /dev/null +++ b/providers/ibm/ibm_is_floating_ip.go @@ -0,0 +1,92 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// FloatingIPGenerator ... +type FloatingIPGenerator struct { + IBMService +} + +func (g FloatingIPGenerator) createFloatingIPResources(fipID, fipName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + fipID, + fipName, + "ibm_is_floating_ip", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *FloatingIPGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.FloatingIP{} + for { + options := &vpcv1.ListFloatingIpsOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + fips, response, err := vpcclient.ListFloatingIps(options) + if err != nil { + return fmt.Errorf("Error Fetching Floating IPs %s\n%s", err, response) + } + start = GetNext(fips.Next) + allrecs = append(allrecs, fips.FloatingIps...) + if start == "" { + break + } + } + + for _, fip := range allrecs { + g.Resources = append(g.Resources, g.createFloatingIPResources(*fip.ID, *fip.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_flow_log.go b/providers/ibm/ibm_is_flow_log.go new file mode 100644 index 0000000000..e62e92383c --- /dev/null +++ b/providers/ibm/ibm_is_flow_log.go @@ -0,0 +1,92 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// FlowLogGenerator ... +type FlowLogGenerator struct { + IBMService +} + +func (g FlowLogGenerator) createFlowLogResources(flogID, flogName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + flogID, + flogName, + "ibm_is_flow_log", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *FlowLogGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.FlowLogCollector{} + for { + options := &vpcv1.ListFlowLogCollectorsOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + flogs, response, err := vpcclient.ListFlowLogCollectors(options) + if err != nil { + return fmt.Errorf("Error Fetching Flow Logs %s\n%s", err, response) + } + start = GetNext(flogs.Next) + allrecs = append(allrecs, flogs.FlowLogCollectors...) + if start == "" { + break + } + } + + for _, flog := range allrecs { + g.Resources = append(g.Resources, g.createFlowLogResources(*flog.ID, *flog.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_ike_policy.go b/providers/ibm/ibm_is_ike_policy.go new file mode 100644 index 0000000000..e054e7ff74 --- /dev/null +++ b/providers/ibm/ibm_is_ike_policy.go @@ -0,0 +1,84 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// IkeGenerator ... +type IkeGenerator struct { + IBMService +} + +func (g IkeGenerator) createIkeResources(ikeID, ikeName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + ikeID, + ikeName, + "ibm_is_ike_policy", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *IkeGenerator) InitResources() error { + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.IkePolicy{} + for { + options := &vpcv1.ListIkePoliciesOptions{} + if start != "" { + options.Start = &start + } + policies, response, err := vpcclient.ListIkePolicies(options) + if err != nil { + return fmt.Errorf("Error Fetching IKE Policies %s\n%s", err, response) + } + start = GetNext(policies.Next) + allrecs = append(allrecs, policies.IkePolicies...) + if start == "" { + break + } + } + + for _, policy := range allrecs { + g.Resources = append(g.Resources, g.createIkeResources(*policy.ID, *policy.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_image.go b/providers/ibm/ibm_is_image.go new file mode 100644 index 0000000000..b481bda68a --- /dev/null +++ b/providers/ibm/ibm_is_image.go @@ -0,0 +1,93 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// ImageGenerator ... +type ImageGenerator struct { + IBMService +} + +func (g ImageGenerator) createImageResources(imageID, imageName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + imageID, + imageName, + "ibm_is_image", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *ImageGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.Image{} + for { + options := &vpcv1.ListImagesOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + images, response, err := vpcclient.ListImages(options) + if err != nil { + return fmt.Errorf("Error Fetching Images %s\n%s", err, response) + } + start = GetNext(images.Next) + allrecs = append(allrecs, images.Images...) + if start == "" { + break + } + } + + for _, image := range allrecs { + g.Resources = append(g.Resources, g.createImageResources(*image.ID, *image.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_instance.go b/providers/ibm/ibm_is_instance.go index 141cd5a7cb..0f1284d608 100644 --- a/providers/ibm/ibm_is_instance.go +++ b/providers/ibm/ibm_is_instance.go @@ -23,6 +23,7 @@ import ( "github.com/IBM/vpc-go-sdk/vpcv1" ) +// InstanceGenerator ... type InstanceGenerator struct { IBMService } @@ -38,6 +39,7 @@ func (g InstanceGenerator) createInstanceResources(instanceID, instanceName stri return resources } +// InitResources ... func (g *InstanceGenerator) InitResources() error { var resoureGroup string region := envFallBack([]string{"IC_REGION"}, "us-south") diff --git a/providers/ibm/ibm_is_instance_template.go b/providers/ibm/ibm_is_instance_template.go new file mode 100644 index 0000000000..d54d776257 --- /dev/null +++ b/providers/ibm/ibm_is_instance_template.go @@ -0,0 +1,72 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// InstanceTemplateGenerator ... +type InstanceTemplateGenerator struct { + IBMService +} + +func (g InstanceTemplateGenerator) createInstanceTemplateResources(templateID, templateName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + templateID, + templateName, + "ibm_is_instance_template", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *InstanceTemplateGenerator) InitResources() error { + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + return fmt.Errorf("No API key set") + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + options := &vpcv1.ListInstanceTemplatesOptions{} + templates, response, err := vpcclient.ListInstanceTemplates(options) + if err != nil { + return fmt.Errorf("Error Fetching Instance Templates %s\n%s", err, response) + } + + for _, template := range templates.Templates { + instemp := template.(*vpcv1.InstanceTemplate) + g.Resources = append(g.Resources, g.createInstanceTemplateResources(*instemp.ID, *instemp.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_ipsec_policy.go b/providers/ibm/ibm_is_ipsec_policy.go new file mode 100644 index 0000000000..c2eb44530a --- /dev/null +++ b/providers/ibm/ibm_is_ipsec_policy.go @@ -0,0 +1,84 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// IpsecGenerator ... +type IpsecGenerator struct { + IBMService +} + +func (g IpsecGenerator) createIpsecResources(ipsecID, ipsecName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + ipsecID, + ipsecName, + "ibm_is_ipsec_policy", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *IpsecGenerator) InitResources() error { + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.IPsecPolicy{} + for { + options := &vpcv1.ListIpsecPoliciesOptions{} + if start != "" { + options.Start = &start + } + policies, response, err := vpcclient.ListIpsecPolicies(options) + if err != nil { + return fmt.Errorf("Error Fetching IPSEC Policies %s\n%s", err, response) + } + start = GetNext(policies.Next) + allrecs = append(allrecs, policies.IpsecPolicies...) + if start == "" { + break + } + } + + for _, policy := range allrecs { + g.Resources = append(g.Resources, g.createIpsecResources(*policy.ID, *policy.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_lb.go b/providers/ibm/ibm_is_lb.go new file mode 100644 index 0000000000..308fc9b730 --- /dev/null +++ b/providers/ibm/ibm_is_lb.go @@ -0,0 +1,221 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// LBGenerator ... +type LBGenerator struct { + IBMService +} + +func (g LBGenerator) createLBResources(lbID, lbName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + lbID, + lbName, + "ibm_is_lb", + "ibm", + []string{}) + return resources +} + +func (g LBGenerator) createLBPoolResources(lbID, lbPoolID, lbPoolName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s", lbID, lbPoolID), + lbPoolName, + "ibm_is_lb_pool", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g LBGenerator) createLBPoolMemberResources(lbID, lbPoolID, lbPoolMemberID, lbPoolMemberName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", lbID, lbPoolID, lbPoolMemberID), + lbPoolMemberName, + "ibm_is_lb_pool_member", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g LBGenerator) createLBListenerResources(lbID, lbListenerID, lbListenerName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s", lbID, lbListenerID), + lbListenerName, + "ibm_is_lb_listener", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g LBGenerator) createLBListenerPolicyResources(lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", lbID, lbListenerID, lbListenerPolicyID), + lbListenerPolicyName, + "ibm_is_lb_listener_policy", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g LBGenerator) createLBListenerPolicyRuleResources(lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyRuleID, lbListenerPolicyName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s/%s", lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyRuleID), + lbListenerPolicyName, + "ibm_is_lb_listener_policy_rule", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// InitResources ... +func (g *LBGenerator) InitResources() error { + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + return fmt.Errorf("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + _ = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + allrecs := []vpcv1.LoadBalancer{} + + listLoadBalancersOptions := &vpcv1.ListLoadBalancersOptions{} + lbs, response, err := vpcclient.ListLoadBalancers(listLoadBalancersOptions) + if err != nil { + return fmt.Errorf("Error Fetching vpcs %s\n%s", err, response) + } + allrecs = append(allrecs, lbs.LoadBalancers...) + + for _, lb := range allrecs { + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_is_lb."+terraformutils.TfSanitize(*lb.Name)) + g.Resources = append(g.Resources, g.createLBResources(*lb.ID, *lb.Name)) + listLoadBalancerPoolsOptions := &vpcv1.ListLoadBalancerPoolsOptions{ + LoadBalancerID: lb.ID, + } + lbPools, response, err := vpcclient.ListLoadBalancerPools(listLoadBalancerPoolsOptions) + if err != nil { + return fmt.Errorf("Error Fetching Load Balancer Pools %s\n%s", err, response) + } + for _, lbPool := range lbPools.Pools { + g.Resources = append(g.Resources, g.createLBPoolResources(*lb.ID, *lbPool.ID, *lbPool.Name, dependsOn)) + var dependsOn1 []string + dependsOn1 = append(dependsOn, + "ibm_is_lb_pool."+terraformutils.TfSanitize(*lbPool.Name)) + listLoadBalancerPoolMembersOptions := &vpcv1.ListLoadBalancerPoolMembersOptions{ + LoadBalancerID: lb.ID, + PoolID: lbPool.ID, + } + lbPoolMembers, response, err := vpcclient.ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions) + if err != nil { + return fmt.Errorf("Error Fetching Load Balancer Pool Members %s\n%s", err, response) + } + for _, lbPoolMember := range lbPoolMembers.Members { + g.Resources = append(g.Resources, g.createLBPoolMemberResources(*lb.ID, *lbPool.ID, *lbPoolMember.ID, *lbPool.Name, dependsOn1)) + } + } + + listLoadBalancerListenersOptions := &vpcv1.ListLoadBalancerListenersOptions{ + LoadBalancerID: lb.ID, + } + lbListeners, response, err := vpcclient.ListLoadBalancerListeners(listLoadBalancerListenersOptions) + if err != nil { + return fmt.Errorf("Error Fetching Load Balancer Listeners %s\n%s", err, response) + } + for _, lbListener := range lbListeners.Listeners { + g.Resources = append(g.Resources, g.createLBListenerResources(*lb.ID, *lbListener.ID, *lbListener.ID, dependsOn)) + var dependsOn2 []string + dependsOn2 = append(dependsOn, + "ibm_is_lb_listener."+terraformutils.TfSanitize(*lbListener.ID)) + listLoadBalancerListenerPoliciesOptions := &vpcv1.ListLoadBalancerListenerPoliciesOptions{ + LoadBalancerID: lb.ID, + ListenerID: lbListener.ID, + } + lbListenerPolicies, response, err := vpcclient.ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions) + if err != nil { + return fmt.Errorf("Error Fetching Load Balancer Listener Policies %s\n%s", err, response) + } + for _, lbListenerPolicy := range lbListenerPolicies.Policies { + g.Resources = append(g.Resources, g.createLBListenerPolicyResources(*lb.ID, *lbListener.ID, *lbListenerPolicy.ID, *lbListenerPolicy.Name, dependsOn2)) + dependsOn2 = append(dependsOn2, + "ibm_is_lb_listener_policy."+terraformutils.TfSanitize(*lbListenerPolicy.Name)) + listLoadBalancerListenerPolicyRulesOptions := &vpcv1.ListLoadBalancerListenerPolicyRulesOptions{ + LoadBalancerID: lb.ID, + ListenerID: lbListener.ID, + PolicyID: lbListenerPolicy.ID, + } + lbListenerPolicyRules, response, err := vpcclient.ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions) + if err != nil { + return fmt.Errorf("Error Fetching Load Balancer Listener Policy Rules %s\n%s", err, response) + } + for _, lbListenerPolicyRule := range lbListenerPolicyRules.Rules { + g.Resources = append(g.Resources, g.createLBListenerPolicyRuleResources(*lb.ID, *lbListener.ID, *lbListenerPolicy.ID, *lbListenerPolicyRule.ID, *lbListenerPolicyRule.ID, dependsOn2)) + + } + } + } + } + return nil +} diff --git a/providers/ibm/ibm_is_network_acl.go b/providers/ibm/ibm_is_network_acl.go new file mode 100644 index 0000000000..bd6fd3afe9 --- /dev/null +++ b/providers/ibm/ibm_is_network_acl.go @@ -0,0 +1,93 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// NetworkACLGenerator ... +type NetworkACLGenerator struct { + IBMService +} + +func (g NetworkACLGenerator) createNetworkACLResources(nwaclID, nwaclName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + nwaclID, + nwaclName, + "ibm_is_network_acl", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *NetworkACLGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.NetworkACL{} + for { + options := &vpcv1.ListNetworkAclsOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + nwacls, response, err := vpcclient.ListNetworkAcls(options) + if err != nil { + return fmt.Errorf("Error Fetching Network ACLs %s\n%s", err, response) + } + start = GetNext(nwacls.Next) + allrecs = append(allrecs, nwacls.NetworkAcls...) + if start == "" { + break + } + } + + for _, nwacl := range allrecs { + g.Resources = append(g.Resources, g.createNetworkACLResources(*nwacl.ID, *nwacl.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_public_gateway.go b/providers/ibm/ibm_is_public_gateway.go new file mode 100644 index 0000000000..7c3ab0392c --- /dev/null +++ b/providers/ibm/ibm_is_public_gateway.go @@ -0,0 +1,92 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// PublicGatewayGenerator ... +type PublicGatewayGenerator struct { + IBMService +} + +func (g PublicGatewayGenerator) createPublicGatewayResources(publicGatewayID, publicGatewayName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + publicGatewayID, + publicGatewayName, + "ibm_is_public_gateway", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *PublicGatewayGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.PublicGateway{} + for { + options := &vpcv1.ListPublicGatewaysOptions{} + if start != "" { + options.Start = &start + } + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + pgs, response, err := vpcclient.ListPublicGateways(options) + if err != nil { + return fmt.Errorf("Error Fetching Public Gateways %s\n%s", err, response) + } + start = GetNext(pgs.Next) + allrecs = append(allrecs, pgs.PublicGateways...) + if start == "" { + break + } + } + + for _, pg := range allrecs { + g.Resources = append(g.Resources, g.createPublicGatewayResources(*pg.ID, *pg.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_security_group.go b/providers/ibm/ibm_is_security_group.go index dbd0247f13..8a9e5e98c1 100644 --- a/providers/ibm/ibm_is_security_group.go +++ b/providers/ibm/ibm_is_security_group.go @@ -24,6 +24,7 @@ import ( "github.com/IBM/vpc-go-sdk/vpcv1" ) +// SecurityGroupGenerator ... type SecurityGroupGenerator struct { IBMService } @@ -39,17 +40,22 @@ func (g SecurityGroupGenerator) createSecurityGroupResources(sgID, sgName string return resources } -func (g SecurityGroupGenerator) createSecurityGroupRuleResources(sgID, sgRuleID string) terraformutils.Resource { +func (g SecurityGroupGenerator) createSecurityGroupRuleResources(sgID, sgRuleID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s.%s", sgID, sgRuleID), sgRuleID, "ibm_is_security_group_rule", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } +// InitResources ... func (g *SecurityGroupGenerator) InitResources() error { var resoureGroup string region := envFallBack([]string{"IC_REGION"}, "us-south") @@ -96,6 +102,9 @@ func (g *SecurityGroupGenerator) InitResources() error { } for _, group := range allrecs { + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_is_security_group"+terraformutils.TfSanitize(*group.Name)) g.Resources = append(g.Resources, g.createSecurityGroupResources(*group.ID, *group.Name)) listSecurityGroupRulesOptions := &vpcv1.ListSecurityGroupRulesOptions{ SecurityGroupID: group.ID, @@ -109,19 +118,19 @@ func (g *SecurityGroupGenerator) InitResources() error { case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp": { rule := sgrule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp) - g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID)) + g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID, dependsOn)) } case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll": { rule := sgrule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll) - g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID)) + g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID, dependsOn)) } case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp": { rule := sgrule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID)) + g.Resources = append(g.Resources, g.createSecurityGroupRuleResources(*group.ID, *rule.ID, dependsOn)) } } } diff --git a/providers/ibm/ibm_is_ssh_key.go b/providers/ibm/ibm_is_ssh_key.go new file mode 100644 index 0000000000..ba470072df --- /dev/null +++ b/providers/ibm/ibm_is_ssh_key.go @@ -0,0 +1,80 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// SSHKeyGenerator ... +type SSHKeyGenerator struct { + IBMService +} + +func (g SSHKeyGenerator) createSSHKeyResources(sshKeyID, sshKeyName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + sshKeyID, + sshKeyName, + "ibm_is_ssh_key", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *SSHKeyGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + options := &vpcv1.ListKeysOptions{} + if resoureGroup != "" { + options.ResourceGroupID = &resoureGroup + } + keys, response, err := vpcclient.ListKeys(options) + if err != nil { + return fmt.Errorf("Error Fetching SSH Keys %s\n%s", err, response) + } + + for _, key := range keys.Keys { + g.Resources = append(g.Resources, g.createSSHKeyResources(*key.ID, *key.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_subnet.go b/providers/ibm/ibm_is_subnet.go index 8a0deafc0b..0e20c39188 100644 --- a/providers/ibm/ibm_is_subnet.go +++ b/providers/ibm/ibm_is_subnet.go @@ -23,6 +23,7 @@ import ( "github.com/IBM/vpc-go-sdk/vpcv1" ) +// SubnetGenerator ... type SubnetGenerator struct { IBMService } @@ -38,6 +39,7 @@ func (g SubnetGenerator) createSubnetResources(subnetID, subnetName string) terr return resources } +// InitResources ... func (g *SubnetGenerator) InitResources() error { var resoureGroup string region := envFallBack([]string{"IC_REGION"}, "us-south") diff --git a/providers/ibm/ibm_is_volume.go b/providers/ibm/ibm_is_volume.go new file mode 100644 index 0000000000..0db7aca184 --- /dev/null +++ b/providers/ibm/ibm_is_volume.go @@ -0,0 +1,84 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "log" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// VolumeGenerator ... +type VolumeGenerator struct { + IBMService +} + +func (g VolumeGenerator) createVolumeResources(volID, volName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + volID, + volName, + "ibm_is_volume", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *VolumeGenerator) InitResources() error { + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + log.Fatal("No API key set") + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.Volume{} + for { + options := &vpcv1.ListVolumesOptions{} + if start != "" { + options.Start = &start + } + volumes, response, err := vpcclient.ListVolumes(options) + if err != nil { + return fmt.Errorf("Error Fetching Volumes %s\n%s", err, response) + } + start = GetNext(volumes.Next) + allrecs = append(allrecs, volumes.Volumes...) + if start == "" { + break + } + } + + for _, volume := range allrecs { + g.Resources = append(g.Resources, g.createVolumeResources(*volume.ID, *volume.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_is_vpc.go b/providers/ibm/ibm_is_vpc.go index df1bb8bf02..abfba7e027 100644 --- a/providers/ibm/ibm_is_vpc.go +++ b/providers/ibm/ibm_is_vpc.go @@ -23,6 +23,7 @@ import ( "github.com/IBM/vpc-go-sdk/vpcv1" ) +// VPCGenerator ... type VPCGenerator struct { IBMService } @@ -38,28 +39,67 @@ func (g VPCGenerator) createVPCResources(vpcID, vpcName string) terraformutils.R return resources } -func (g VPCGenerator) createVPCAddressPrefixResources(vpcID, addPrefixID, addPrefixName string) terraformutils.Resource { +func (g VPCGenerator) createVPCAddressPrefixResources(vpcID, addPrefixID, addPrefixName string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, addPrefixID), addPrefixName, "ibm_is_vpc_address_prefix", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g VPCGenerator) createVPCRouteResources(vpcID, routeID, routeName string) terraformutils.Resource { +func (g VPCGenerator) createVPCRouteResources(vpcID, routeID, routeName string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, routeID), routeName, "ibm_is_vpc_route", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g VPCGenerator) createVPCRouteTableResources(vpcID, routeTableID, routeTableName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s", vpcID, routeTableID), + routeTableName, + "ibm_is_vpc_routing_table", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g VPCGenerator) createVPCRouteTableRouteResources(vpcID, routeTableID, routeTableRouteID, routeTableRouteName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", vpcID, routeTableID, routeTableRouteID), + routeTableRouteName, + "ibm_is_vpc_routing_table_route", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } +// InitResources ... func (g *VPCGenerator) InitResources() error { var resoureGroup string region := envFallBack([]string{"IC_REGION"}, "us-south") @@ -106,6 +146,9 @@ func (g *VPCGenerator) InitResources() error { } for _, vpc := range allrecs { + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_is_vpc."+terraformutils.TfSanitize(*vpc.Name)) g.Resources = append(g.Resources, g.createVPCResources(*vpc.ID, *vpc.Name)) listVPCAddressPrefixesOptions := &vpcv1.ListVPCAddressPrefixesOptions{ VPCID: vpc.ID, @@ -115,8 +158,9 @@ func (g *VPCGenerator) InitResources() error { return fmt.Errorf("Error Fetching vpc address prefixes %s\n%s", err, response) } for _, addprefix := range addprefixes.AddressPrefixes { - g.Resources = append(g.Resources, g.createVPCAddressPrefixResources(*vpc.ID, *addprefix.ID, *addprefix.Name)) + g.Resources = append(g.Resources, g.createVPCAddressPrefixResources(*vpc.ID, *addprefix.ID, *addprefix.Name, dependsOn)) } + listVPCRoutesOptions := &vpcv1.ListVPCRoutesOptions{ VPCID: vpc.ID, } @@ -125,9 +169,32 @@ func (g *VPCGenerator) InitResources() error { return fmt.Errorf("Error Fetching vpc routes %s\n%s", err, response) } for _, route := range routes.Routes { - g.Resources = append(g.Resources, g.createVPCRouteResources(*vpc.ID, *route.ID, *route.Name)) + g.Resources = append(g.Resources, g.createVPCRouteResources(*vpc.ID, *route.ID, *route.Name, dependsOn)) } + listVPCRoutingTablesOptions := &vpcv1.ListVPCRoutingTablesOptions{ + VPCID: vpc.ID, + } + tables, response, err := vpcclient.ListVPCRoutingTables(listVPCRoutingTablesOptions) + if err != nil { + return fmt.Errorf("Error Fetching vpc routing tables %s\n%s", err, response) + } + for _, table := range tables.RoutingTables { + g.Resources = append(g.Resources, g.createVPCRouteTableResources(*vpc.ID, *table.ID, *table.Name, dependsOn)) + dependsOn = append(dependsOn, + "ibm_is_vpc_routing_table."+terraformutils.TfSanitize(*table.Name)) + listVPCRoutingTableRoutesOptions := &vpcv1.ListVPCRoutingTableRoutesOptions{ + VPCID: vpc.ID, + RoutingTableID: table.ID, + } + tableroutes, response, err := vpcclient.ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptions) + if err != nil { + return fmt.Errorf("Error Fetching vpc route table routes %s\n%s", err, response) + } + for _, tableroute := range tableroutes.Routes { + g.Resources = append(g.Resources, g.createVPCRouteTableRouteResources(*vpc.ID, *table.ID, *tableroute.ID, *tableroute.Name, dependsOn)) + } + } } return nil } diff --git a/providers/ibm/ibm_is_vpn_gateway.go b/providers/ibm/ibm_is_vpn_gateway.go new file mode 100644 index 0000000000..915963ab5f --- /dev/null +++ b/providers/ibm/ibm_is_vpn_gateway.go @@ -0,0 +1,122 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// VPNGatewayGenerator ... +type VPNGatewayGenerator struct { + IBMService +} + +func (g VPNGatewayGenerator) createVPNGatewayResources(vpngwID, vpngwName string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewSimpleResource( + vpngwID, + vpngwName, + "ibm_is_vpn_gateway", + "ibm", + []string{}) + return resources +} + +func (g VPNGatewayGenerator) createVPNGatewayConnectionResources(vpngwID, vpngwConnectionID, vpngwConnectionName string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s", vpngwID, vpngwConnectionID), + vpngwConnectionName, + "ibm_is_vpn_gateway_connections", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// InitResources ... +func (g *VPNGatewayGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + return fmt.Errorf("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + start := "" + allrecs := []vpcv1.VPNGatewayIntf{} + for { + listVPNGatewaysOptions := &vpcv1.ListVPNGatewaysOptions{} + if start != "" { + listVPNGatewaysOptions.Start = &start + } + if resoureGroup != "" { + listVPNGatewaysOptions.ResourceGroupID = &resoureGroup + } + vpngws, response, err := vpcclient.ListVPNGateways(listVPNGatewaysOptions) + if err != nil { + return fmt.Errorf("Error Fetching VPN Gateways %s\n%s", err, response) + } + start = GetNext(vpngws.Next) + allrecs = append(allrecs, vpngws.VPNGateways...) + if start == "" { + break + } + } + + for _, gw := range allrecs { + vpngw := gw.(*vpcv1.VPNGateway) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_is_vpn_gateway."+terraformutils.TfSanitize(*vpngw.Name)) + g.Resources = append(g.Resources, g.createVPNGatewayResources(*vpngw.ID, *vpngw.Name)) + listVPNGatewayConnectionsOptions := &vpcv1.ListVPNGatewayConnectionsOptions{ + VPNGatewayID: vpngw.ID, + } + vpngwConnections, response, err := vpcclient.ListVPNGatewayConnections(listVPNGatewayConnectionsOptions) + if err != nil { + return fmt.Errorf("Error Fetching VPN Gateway Connections %s\n%s", err, response) + } + for _, connection := range vpngwConnections.Connections { + vpngwConnection := connection.(*vpcv1.VPNGatewayConnection) + g.Resources = append(g.Resources, g.createVPNGatewayConnectionResources(*vpngw.ID, *vpngwConnection.ID, *vpngwConnection.Name, dependsOn)) + } + } + return nil +} diff --git a/providers/ibm/ibm_kp.go b/providers/ibm/ibm_kp.go index a621707652..1c20f0d7b4 100644 --- a/providers/ibm/ibm_kp.go +++ b/providers/ibm/ibm_kp.go @@ -31,25 +31,29 @@ type KPGenerator struct { IBMService } -func (g KPGenerator) loadKP(kpID, kpName string) terraformutils.Resource { +func (g KPGenerator) loadKP(kpID, kpGuid string) terraformutils.Resource { var resources terraformutils.Resource resources = terraformutils.NewSimpleResource( kpID, - kpID, + kpGuid, "ibm_resource_instance", "ibm", []string{}) return resources } -func (g KPGenerator) loadkPKeys(kpKeyCRN, kpKeyID string) terraformutils.Resource { +func (g KPGenerator) loadkPKeys(kpKeyCRN, kpKeyID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( kpKeyCRN, kpKeyID, "ibm_kms_key", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } @@ -96,7 +100,7 @@ func (g *KPGenerator) InitResources() error { return err } for _, kp := range kpInstances { - g.Resources = append(g.Resources, g.loadKP(kp.ID, kp.Name)) + g.Resources = append(g.Resources, g.loadKP(kp.ID, kp.Guid)) client.Config.InstanceID = kp.Guid output, err := client.GetKeys(context.Background(), 100, 0) @@ -104,7 +108,10 @@ func (g *KPGenerator) InitResources() error { return err } for _, key := range output.Keys { - g.Resources = append(g.Resources, g.loadkPKeys(key.CRN, key.ID)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_resource_instance."+terraformutils.TfSanitize(kp.Guid)) + g.Resources = append(g.Resources, g.loadkPKeys(key.CRN, key.ID, dependsOn)) } } diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index 60029eeaa7..75feb26daa 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -23,12 +23,13 @@ import ( type IBMProvider struct { terraformutils.Provider ResourceGroup string + Region string } func (p *IBMProvider) Init(args []string) error { - if args[0] != "" { - p.ResourceGroup = args[0] - } + p.ResourceGroup = args[0] + p.Region = args[1] + return nil } @@ -67,6 +68,19 @@ func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGen "ibm_is_instance": &InstanceGenerator{}, "ibm_is_security_group": &SecurityGroupGenerator{}, "ibm_cis": &CISGenerator{}, + "ibm_is_network_acl": &NetworkACLGenerator{}, + "ibm_is_public_gateway": &PublicGatewayGenerator{}, + "ibm_is_volume": &VolumeGenerator{}, + "ibm_is_vpn_gateway": &VPNGatewayGenerator{}, + "ibm_is_lb": &LBGenerator{}, + "ibm_is_ssh_key": &SSHKeyGenerator{}, + "ibm_is_floating_ip": &FloatingIPGenerator{}, + "ibm_is_image": &ImageGenerator{}, + "ibm_is_ipsec_policy": &IpsecGenerator{}, + "ibm_is_ike_policy": &IkeGenerator{}, + "ibm_is_flow_log": &FlowLogGenerator{}, + "ibm_is_instance_template": &InstanceTemplateGenerator{}, + "ibm_function": &CloudFunctionGenerator{}, } } @@ -82,6 +96,7 @@ func (p *IBMProvider) InitService(serviceName string, verbose bool) error { p.Service.SetArgs(map[string]interface{}{ "resource_group": p.ResourceGroup, + "region": p.Region, }) return nil } diff --git a/providers/ibm/instance_groups.go b/providers/ibm/instance_groups.go index 0d32b75f6f..a1d8b9edaa 100644 --- a/providers/ibm/instance_groups.go +++ b/providers/ibm/instance_groups.go @@ -25,6 +25,7 @@ import ( "github.com/IBM/vpc-go-sdk/vpcv1" ) +// InstanceGroupGenerator ... type InstanceGroupGenerator struct { IBMService fatalErrors chan error @@ -41,35 +42,43 @@ func (g *InstanceGroupGenerator) loadInstanceGroup(instanceGroupID, instanceGrou return resources } -func (g *InstanceGroupGenerator) loadInstanceGroupManger(instanceGroupID, instanceGroupManagerID, managerName string) terraformutils.Resource { +func (g *InstanceGroupGenerator) loadInstanceGroupManger(instanceGroupID, instanceGroupManagerID, managerName string, dependsOn []string) terraformutils.Resource { if managerName == "" { managerName = fmt.Sprintf("manager-%d-%d", rand.Intn(100), rand.Intn(50)) } var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", instanceGroupID, instanceGroupManagerID), managerName, "ibm_is_instance_group_manager", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g *InstanceGroupGenerator) loadInstanceGroupMangerPolicy(instanceGroupID, instanceGroupManagerID, PolicyID, policyName string) terraformutils.Resource { +func (g *InstanceGroupGenerator) loadInstanceGroupMangerPolicy(instanceGroupID, instanceGroupManagerID, PolicyID, policyName string, dependsOn []string) terraformutils.Resource { if policyName == "" { policyName = fmt.Sprintf("manager-%d-%d", rand.Intn(100), rand.Intn(50)) } var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", instanceGroupID, instanceGroupManagerID, PolicyID), policyName, "ibm_is_instance_group_manager_policy", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } -func (g *InstanceGroupGenerator) handlePolicies(sess *vpcv1.VpcV1, instanceGroupID, instanceGroupManagerID string, policies []string, waitGroup *sync.WaitGroup) { +func (g *InstanceGroupGenerator) handlePolicies(sess *vpcv1.VpcV1, instanceGroupID, instanceGroupManagerID string, policies, dependsOn []string, waitGroup *sync.WaitGroup) { defer waitGroup.Done() for _, instanceGroupManagerPolicyID := range policies { getInstanceGroupManagerPolicyOptions := vpcv1.GetInstanceGroupManagerPolicyOptions{ @@ -85,11 +94,12 @@ func (g *InstanceGroupGenerator) handlePolicies(sess *vpcv1.VpcV1, instanceGroup g.Resources = append(g.Resources, g.loadInstanceGroupMangerPolicy(instanceGroupID, instanceGroupManagerID, instanceGroupManagerPolicyID, - *instanceGroupManagerPolicy.Name)) + *instanceGroupManagerPolicy.Name, + dependsOn)) } } -func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroupID string, managers []string, waitGroup *sync.WaitGroup) { +func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroupID string, managers, dependsOn []string, waitGroup *sync.WaitGroup) { defer waitGroup.Done() var policiesWG sync.WaitGroup for _, instanceGroupManagerID := range managers { @@ -101,7 +111,7 @@ func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroup if err != nil { g.fatalErrors <- fmt.Errorf("Error Getting InstanceGroup Manager: %s\n%s", err, response) } - g.Resources = append(g.Resources, g.loadInstanceGroupManger(instanceGroupID, instanceGroupManagerID, *instanceGroupManager.Name)) + g.Resources = append(g.Resources, g.loadInstanceGroupManger(instanceGroupID, instanceGroupManagerID, *instanceGroupManager.Name, dependsOn)) policies := make([]string, 0) @@ -109,7 +119,10 @@ func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroup policies = append(policies, string(*(instanceGroupManager.Policies[i].ID))) } policiesWG.Add(1) - go g.handlePolicies(sess, instanceGroupID, instanceGroupManagerID, policies, &policiesWG) + var dependsOn1 []string + dependsOn1 = append(dependsOn, + "ibm_is_instance_group_manger."+terraformutils.TfSanitize(*instanceGroupManager.Name)) + go g.handlePolicies(sess, instanceGroupID, instanceGroupManagerID, policies, dependsOn1, &policiesWG) } policiesWG.Wait() } @@ -138,6 +151,9 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1, waitGro var managersWG sync.WaitGroup for _, instanceGroup := range allrecs { + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_is_instance_group."+terraformutils.TfSanitize(*instanceGroup.Name)) instanceGoupID := *instanceGroup.ID g.Resources = append(g.Resources, g.loadInstanceGroup(instanceGoupID, *instanceGroup.Name)) managers := make([]string, 0) @@ -145,11 +161,12 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1, waitGro managers = append(managers, string(*(instanceGroup.Managers[i].ID))) } managersWG.Add(1) - go g.handleManagers(sess, instanceGoupID, managers, &managersWG) + go g.handleManagers(sess, instanceGoupID, managers, dependsOn, &managersWG) } managersWG.Wait() } +// InitResources ... func (g *InstanceGroupGenerator) InitResources() error { apiKey := os.Getenv("IBMCLOUD_API_KEY") if apiKey == "" { diff --git a/providers/ibm/vpc_cluster.go b/providers/ibm/vpc_cluster.go index 1014abe599..0802ba5f2f 100644 --- a/providers/ibm/vpc_cluster.go +++ b/providers/ibm/vpc_cluster.go @@ -39,14 +39,18 @@ func (g VPCClusterGenerator) loadcluster(clustersID, clusterName string) terrafo return resources } -func (g VPCClusterGenerator) loadWorkerPools(clustersID, poolID, PoolName string) terraformutils.Resource { +func (g VPCClusterGenerator) loadWorkerPools(clustersID, poolID string, dependsOn []string) terraformutils.Resource { var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources = terraformutils.NewResource( fmt.Sprintf("%s/%s", clustersID, poolID), - PoolName, + poolID, "ibm_container_vpc_worker_pool", "ibm", - []string{}) + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) return resources } @@ -77,7 +81,10 @@ func (g *VPCClusterGenerator) InitResources() error { for _, pool := range workerPools { if pool.PoolName != "default" { - g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, pool.PoolName)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_container_vpc_cluster."+terraformutils.TfSanitize(cs.Name)) + g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, dependsOn)) } } From 30c8c78a17f7fa1268c5f908f9d4a4b1b9e50cd3 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 28 Jan 2021 11:28:15 -0500 Subject: [PATCH 063/276] update users resource to utilize v2 api endpoint --- providers/datadog/datadog_provider.go | 4 +-- providers/datadog/user.go | 44 ++++++++++----------------- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 92e4063b26..e8dfa70412 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -183,7 +183,7 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "dashboard_list": &DashboardListGenerator{}, "dashboard": &DashboardGenerator{}, "downtime": &DowntimeGenerator{}, - "logs_archive": &LogsArchiveGenerator{}, + "logs_archive": &LogsArchiveGenerator{}, "logs_archive_order": &LogsArchiveOrderGenerator{}, "logs_custom_pipeline": &LogsCustomPipelineGenerator{}, "logs_index": &LogsIndexGenerator{}, @@ -197,7 +197,7 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "integration_gcp": &IntegrationGCPGenerator{}, "monitor": &MonitorGenerator{}, "screenboard": &ScreenboardGenerator{}, - "security_monitoring_default_rule": &SecurityMonitoringDefaultRuleGenerator{}, + "security_monitoring_default_rule": &SecurityMonitoringDefaultRuleGenerator{}, "security_monitoring_rule": &SecurityMonitoringRuleGenerator{}, "synthetics": &SyntheticsGenerator{}, "timeboard": &TimeboardGenerator{}, diff --git a/providers/datadog/user.go b/providers/datadog/user.go index 62ac939a47..8593f1c442 100644 --- a/providers/datadog/user.go +++ b/providers/datadog/user.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -33,13 +33,20 @@ type UserGenerator struct { DatadogService } -func (g *UserGenerator) createResources(users []datadogV1.User) []terraformutils.Resource { +func (g *UserGenerator) createResources(users []datadogV2.User) []terraformutils.Resource { resources := []terraformutils.Resource{} for _, user := range users { - resourceName := user.GetHandle() - resources = append(resources, g.createResource(resourceName)) - } + relations := user.GetRelationships() + roles := relations.GetRoles() + // If not roles are present, we can assume user was created via V1 API + if len(roles.GetData()) == 0 { + attr := user.GetAttributes() + resources = append(resources, g.createResource(attr.GetHandle())) + continue + } + resources = append(resources, g.createResource(user.GetId())) + } return resources } @@ -57,32 +64,13 @@ func (g *UserGenerator) createResource(userID string) terraformutils.Resource { // from each user create 1 TerraformResource. // Need User ID as ID for terraform resource func (g *UserGenerator) InitResources() error { - datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) - authV1 := g.Args["authV1"].(context.Context) - - resources := []terraformutils.Resource{} - for _, filter := range g.Filter { - if filter.FieldPath == "id" && filter.IsApplicable("user") { - for _, value := range filter.AcceptableValues { - user, _, err := datadogClientV1.UsersApi.GetUser(authV1, value).Execute() - if err != nil { - return err - } - - resources = append(resources, g.createResource(user.User.GetHandle())) - } - } - } - - if len(resources) > 0 { - g.Resources = resources - return nil - } + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) + authV2 := g.Args["authV2"].(context.Context) - users, _, err := datadogClientV1.UsersApi.ListUsers(authV1).Execute() + resp, _, err := datadogClientV2.UsersApi.ListUsers(authV2).PageSize(int64(1000)).Execute() if err != nil { return err } - g.Resources = g.createResources(users.GetUsers()) + g.Resources = g.createResources(resp.GetData()) return nil } From 66b6582aff3a62acbe50fa3977b6acfb843a064f Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 28 Jan 2021 15:09:30 -0500 Subject: [PATCH 064/276] support paginated responses --- providers/datadog/user.go | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/providers/datadog/user.go b/providers/datadog/user.go index 8593f1c442..4943b6579c 100644 --- a/providers/datadog/user.go +++ b/providers/datadog/user.go @@ -17,9 +17,7 @@ package datadog import ( "context" "fmt" - datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -38,7 +36,8 @@ func (g *UserGenerator) createResources(users []datadogV2.User) []terraformutils for _, user := range users { relations := user.GetRelationships() roles := relations.GetRoles() - // If not roles are present, we can assume user was created via V1 API + // If no roles are present, we can assume user was created via the V1 API + // Hence, import the user via their handle if len(roles.GetData()) == 0 { attr := user.GetAttributes() resources = append(resources, g.createResource(attr.GetHandle())) @@ -64,13 +63,26 @@ func (g *UserGenerator) createResource(userID string) terraformutils.Resource { // from each user create 1 TerraformResource. // Need User ID as ID for terraform resource func (g *UserGenerator) InitResources() error { + var users []datadogV2.User + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) authV2 := g.Args["authV2"].(context.Context) - resp, _, err := datadogClientV2.UsersApi.ListUsers(authV2).PageSize(int64(1000)).Execute() - if err != nil { - return err + pageSize := int64(1000) + pageNumber := int64(1) + remaining := int64(1) + + for remaining > int64(0) { + resp, _, err := datadogClientV2.UsersApi.ListUsers(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + if err != nil { + return err + } + users = append(users, resp.GetData()...) + + remaining = resp.Meta.Page.GetTotalCount() - pageSize*pageNumber + pageNumber++ } - g.Resources = g.createResources(resp.GetData()) + + g.Resources = g.createResources(users) return nil } From 3c7601efc88104b7d5d2531014a503d2f315d657 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 28 Jan 2021 15:11:13 -0500 Subject: [PATCH 065/276] lint --- providers/datadog/user.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/providers/datadog/user.go b/providers/datadog/user.go index 4943b6579c..9adc912e2d 100644 --- a/providers/datadog/user.go +++ b/providers/datadog/user.go @@ -17,7 +17,9 @@ package datadog import ( "context" "fmt" + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) From b92b76ce396a2ba8ddbe0045509346455132dcbc Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 28 Jan 2021 16:02:45 -0500 Subject: [PATCH 066/276] pageNumber fix --- providers/datadog/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/datadog/user.go b/providers/datadog/user.go index 9adc912e2d..6c954b96b4 100644 --- a/providers/datadog/user.go +++ b/providers/datadog/user.go @@ -71,7 +71,7 @@ func (g *UserGenerator) InitResources() error { authV2 := g.Args["authV2"].(context.Context) pageSize := int64(1000) - pageNumber := int64(1) + pageNumber := int64(0) remaining := int64(1) for remaining > int64(0) { From 733a1e5c4db50ac752ab3720d2e08b14234426c7 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 28 Jan 2021 16:04:04 -0500 Subject: [PATCH 067/276] add paginated endpoint support --- .../security_monitoring_default_rule.go | 22 ++++++++++++++----- providers/datadog/security_monitoring_rule.go | 20 +++++++++++++---- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/providers/datadog/security_monitoring_default_rule.go b/providers/datadog/security_monitoring_default_rule.go index 427abec75d..dc2b46e939 100644 --- a/providers/datadog/security_monitoring_default_rule.go +++ b/providers/datadog/security_monitoring_default_rule.go @@ -59,14 +59,26 @@ func (g *SecurityMonitoringDefaultRuleGenerator) createResource(ruleID string) t // from each SecurityMonitoringDefaultRule create 1 TerraformResource. // Need SecurityMonitoringDefaultRule ID as ID for terraform resource func (g *SecurityMonitoringDefaultRuleGenerator) InitResources() error { + var securityMonitoringRuleResponses []datadogV2.SecurityMonitoringRuleResponse + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) authV2 := g.Args["authV2"].(context.Context) - pageSize := int64(999) - resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).Execute() - if err != nil { - return err + pageSize := int64(1000) + pageNumber := int64(0) + remaining := int64(1) + + for remaining > int64(0) { + resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + if err != nil { + return err + } + securityMonitoringRuleResponses = append(securityMonitoringRuleResponses, resp.GetData()...) + + remaining = resp.Meta.Page.GetTotalCount() - pageSize*pageNumber + pageNumber++ } - g.Resources = g.createResources(resp.GetData()) + + g.Resources = g.createResources(securityMonitoringRuleResponses) return nil } diff --git a/providers/datadog/security_monitoring_rule.go b/providers/datadog/security_monitoring_rule.go index 14f7d25525..d4ee746f2b 100644 --- a/providers/datadog/security_monitoring_rule.go +++ b/providers/datadog/security_monitoring_rule.go @@ -64,14 +64,26 @@ func (g *SecurityMonitoringRuleGenerator) createResource(ruleID string, ruleEnab // from each SecurityMonitoringRule create 1 TerraformResource. // Need SecurityMonitoringRule ID as ID for terraform resource func (g *SecurityMonitoringRuleGenerator) InitResources() error { + var securityMonitoringRuleResponses []datadogV2.SecurityMonitoringRuleResponse + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) authV2 := g.Args["authV2"].(context.Context) pageSize := int64(1000) - resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).Execute() - if err != nil { - return err + pageNumber := int64(0) + remaining := int64(1) + + for remaining > int64(0) { + resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + if err != nil { + return err + } + securityMonitoringRuleResponses = append(securityMonitoringRuleResponses, resp.GetData()...) + + remaining = resp.Meta.Page.GetTotalCount() - pageSize*pageNumber + pageNumber++ } - g.Resources = g.createResources(resp.GetData()) + + g.Resources = g.createResources(securityMonitoringRuleResponses) return nil } From f9545b60a1361c28a6dd9149e7851be43406a66c Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 28 Jan 2021 16:37:39 -0500 Subject: [PATCH 068/276] lint --- providers/datadog/security_monitoring_default_rule.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/datadog/security_monitoring_default_rule.go b/providers/datadog/security_monitoring_default_rule.go index dc2b46e939..54c3734a35 100644 --- a/providers/datadog/security_monitoring_default_rule.go +++ b/providers/datadog/security_monitoring_default_rule.go @@ -73,7 +73,7 @@ func (g *SecurityMonitoringDefaultRuleGenerator) InitResources() error { if err != nil { return err } - securityMonitoringRuleResponses = append(securityMonitoringRuleResponses, resp.GetData()...) + securityMonitoringRuleResponses = append(securityMonitoringRuleResponses, resp.GetData()...) remaining = resp.Meta.Page.GetTotalCount() - pageSize*pageNumber pageNumber++ From dfad51adeb1aaddcb8f321d7330cc68cb22e2d5f Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 29 Jan 2021 02:42:22 -0500 Subject: [PATCH 069/276] start at pageCount 1 when calculating remaining --- providers/datadog/user.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/providers/datadog/user.go b/providers/datadog/user.go index 6c954b96b4..ebf6746008 100644 --- a/providers/datadog/user.go +++ b/providers/datadog/user.go @@ -17,7 +17,6 @@ package datadog import ( "context" "fmt" - datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -81,7 +80,7 @@ func (g *UserGenerator) InitResources() error { } users = append(users, resp.GetData()...) - remaining = resp.Meta.Page.GetTotalCount() - pageSize*pageNumber + remaining = resp.Meta.Page.GetTotalCount() - pageSize*(pageNumber+1) pageNumber++ } From a8971ef395bf17ecc81cf8d64d3564452bb0b72e Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 29 Jan 2021 02:46:55 -0500 Subject: [PATCH 070/276] start at pageNumber 1 when calculating remaining --- providers/datadog/security_monitoring_default_rule.go | 2 +- providers/datadog/security_monitoring_rule.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/datadog/security_monitoring_default_rule.go b/providers/datadog/security_monitoring_default_rule.go index 54c3734a35..0ddea3bc1e 100644 --- a/providers/datadog/security_monitoring_default_rule.go +++ b/providers/datadog/security_monitoring_default_rule.go @@ -75,7 +75,7 @@ func (g *SecurityMonitoringDefaultRuleGenerator) InitResources() error { } securityMonitoringRuleResponses = append(securityMonitoringRuleResponses, resp.GetData()...) - remaining = resp.Meta.Page.GetTotalCount() - pageSize*pageNumber + remaining = resp.Meta.Page.GetTotalCount() - pageSize*(pageNumber+1) pageNumber++ } diff --git a/providers/datadog/security_monitoring_rule.go b/providers/datadog/security_monitoring_rule.go index d4ee746f2b..b6322b6809 100644 --- a/providers/datadog/security_monitoring_rule.go +++ b/providers/datadog/security_monitoring_rule.go @@ -80,7 +80,7 @@ func (g *SecurityMonitoringRuleGenerator) InitResources() error { } securityMonitoringRuleResponses = append(securityMonitoringRuleResponses, resp.GetData()...) - remaining = resp.Meta.Page.GetTotalCount() - pageSize*pageNumber + remaining = resp.Meta.Page.GetTotalCount() - pageSize*(pageNumber+1) pageNumber++ } From 78eee1e1c16c1833826c98b5372a4ec46346918b Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sat, 30 Jan 2021 18:43:06 +0900 Subject: [PATCH 071/276] style: fix typo --- terraformutils/hcl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraformutils/hcl.go b/terraformutils/hcl.go index 46ef4a05f0..1c5128afba 100644 --- a/terraformutils/hcl.go +++ b/terraformutils/hcl.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/hcl/hcl/ast" hclPrinter "github.com/hashicorp/hcl/hcl/printer" - hclParcer "github.com/hashicorp/hcl/json/parser" + hclParser "github.com/hashicorp/hcl/json/parser" ) // Copy code from https://github.com/kubernetes/kops project with few changes for support many provider and heredoc @@ -136,7 +136,7 @@ func hclPrint(data interface{}, mapsObjects map[string]struct{}) ([]byte, error) return dataBytesJSON, err } dataJSON := string(dataBytesJSON) - nodes, err := hclParcer.Parse([]byte(dataJSON)) + nodes, err := hclParser.Parse([]byte(dataJSON)) if err != nil { log.Println(dataJSON) return []byte{}, fmt.Errorf("error parsing terraform json: %v", err) From 7ff2dfe6a304ddd1e376badca45abb6bb999cd15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 30 Jan 2021 10:13:16 +0000 Subject: [PATCH 072/276] Bump github.com/hashicorp/go-hclog from 0.14.1 to 0.15.0 Bumps [github.com/hashicorp/go-hclog](https://github.com/hashicorp/go-hclog) from 0.14.1 to 0.15.0. - [Release notes](https://github.com/hashicorp/go-hclog/releases) - [Commits](https://github.com/hashicorp/go-hclog/compare/v0.14.1...v0.15.0) Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 766ddf289e..1dc0c964c9 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/IBM/ibm-cos-sdk-go v1.5.0 github.com/IBM/keyprotect-go-client v0.5.2 github.com/IBM/networking-go-sdk v0.12.1 - github.com/IBM/vpc-go-sdk v0.3.1 + github.com/IBM/vpc-go-sdk v0.4.1 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible @@ -33,7 +33,7 @@ require ( github.com/google/go-github/v25 v25.1.3 github.com/gophercloud/gophercloud v0.13.0 github.com/hashicorp/go-azure-helpers v0.10.0 - github.com/hashicorp/go-hclog v0.14.1 + github.com/hashicorp/go-hclog v0.15.0 github.com/hashicorp/go-plugin v1.4.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.29 diff --git a/go.sum b/go.sum index cf24660d56..5008d815f5 100644 --- a/go.sum +++ b/go.sum @@ -124,8 +124,8 @@ github.com/IBM/keyprotect-go-client v0.5.2 h1:A4yp2Fc7mg4dtotZErZXwJb9XKpb3ONexn github.com/IBM/keyprotect-go-client v0.5.2/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI= github.com/IBM/networking-go-sdk v0.12.1 h1:GmzrRjvAyqKMfUPM8Y/R5dce0x5AXTqmseVZ3n7eZks= github.com/IBM/networking-go-sdk v0.12.1/go.mod h1:lzkGBnw5glMB7Nxawfgu19MH4Tjy3KRQ2SYMYl2ck7o= -github.com/IBM/vpc-go-sdk v0.3.1 h1:v7jSq+pkORQOTUxsb/114TzSXvVu1+EIM53Tu/hkJ5o= -github.com/IBM/vpc-go-sdk v0.3.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= +github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= +github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= @@ -490,6 +490,8 @@ github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+a github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= +github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= From c59dc4663ba9cc114dfb6477e7d6a517f4077a02 Mon Sep 17 00:00:00 2001 From: rotemavni Date: Wed, 3 Feb 2021 11:12:11 +0200 Subject: [PATCH 073/276] Fixed `RefreshResources` function - increase channel size to avoid getting stuck --- terraformutils/utils.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/terraformutils/utils.go b/terraformutils/utils.go index 4da9420b64..684a9f7e09 100644 --- a/terraformutils/utils.go +++ b/terraformutils/utils.go @@ -67,33 +67,34 @@ func PrintTfState(resources []Resource) ([]byte, error) { func RefreshResources(resources []*Resource, provider *providerwrapper.ProviderWrapper, slowProcessingResources [][]*Resource) ([]*Resource, error) { refreshedResources := []*Resource{} - input := make(chan *Resource, 100) + input := make(chan *Resource, len(resources)) var wg sync.WaitGroup poolSize := 15 - - for i := 0; i < poolSize; i++ { - go RefreshResourceWorker(input, &wg, provider) - } for i := range resources { wg.Add(1) input <- resources[i] } + close(input) + + for i := 0; i < poolSize; i++ { + go RefreshResourceWorker(input, &wg, provider) + } spInputs := []chan *Resource{} for i, resourceGroup := range slowProcessingResources { - spInputs = append(spInputs, make(chan *Resource, 100)) + spInputs = append(spInputs, make(chan *Resource, len(resourceGroup))) for j := range resourceGroup { spInputs[i] <- resourceGroup[j] } + close(spInputs[i]) } for i := 0; i < len(spInputs); i++ { - go RefreshResourceWorker(spInputs[i], &wg, provider) wg.Add(len(slowProcessingResources[i])) + go RefreshResourceWorker(spInputs[i], &wg, provider) } wg.Wait() - close(input) for _, r := range resources { if r.InstanceState != nil && r.InstanceState.ID != "" { refreshedResources = append(refreshedResources, r) From 9bd9081a21bca14c052c144d77eddaeba9be7e2b Mon Sep 17 00:00:00 2001 From: rotemavni Date: Wed, 3 Feb 2021 11:58:33 +0200 Subject: [PATCH 074/276] allow to pass multiple options to NewProviderWrapper --- cmd/import.go | 2 +- terraformutils/providerwrapper/provider.go | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cmd/import.go b/cmd/import.go index ad16e66f48..6fdc3e6189 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -136,7 +136,7 @@ func initOptionsAndWrapper(provider terraformutils.ProviderGenerator, options Im options.Resources = localSlice } - providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose, options.RetryCount, options.RetrySleepMs) + providerWrapper, err := providerwrapper.NewProviderWrapper(provider.GetName(), provider.GetConfig(), options.Verbose, map[string]int{"retryCount": options.RetryCount, "retrySleepMs": options.RetrySleepMs}) if err != nil { return nil, options, err } diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index 30fb5efb1f..e6cf3f5ee5 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -60,17 +60,20 @@ type ProviderWrapper struct { retrySleepMs int } -func NewProviderWrapper(providerName string, providerConfig cty.Value, verbose bool, retryOptions ...int) (*ProviderWrapper, error) { - p := &ProviderWrapper{} +func NewProviderWrapper(providerName string, providerConfig cty.Value, verbose bool, options ...map[string]int) (*ProviderWrapper, error) { + p := &ProviderWrapper{retryCount: 5, retrySleepMs: 300} p.providerName = providerName p.config = providerConfig - if len(retryOptions) == 2 { - p.retryCount = retryOptions[0] - p.retrySleepMs = retryOptions[1] - } else { - p.retryCount = 5 - p.retrySleepMs = 300 + if len(options) > 0 { + retryCount, hasOption := options[0]["retryCount"] + if hasOption { + p.retryCount = retryCount + } + retrySleepMs, hasOption := options[0]["retrySleepMs"] + if hasOption { + p.retrySleepMs = retrySleepMs + } } err := p.initProvider(verbose) From 08e3753f9f2b85e0f4f8e7765c3eb983d6bdf0e7 Mon Sep 17 00:00:00 2001 From: rotemavni Date: Wed, 3 Feb 2021 13:27:28 +0200 Subject: [PATCH 075/276] Run resource initialization sequentially --- cmd/import.go | 24 +++++++++++------------- terraformutils/providers_mapping.go | 4 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/cmd/import.go b/cmd/import.go index 6fdc3e6189..f3331a14e5 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -149,7 +149,7 @@ func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, var wg sync.WaitGroup wg.Add(numOfResources) - failedServices := make(chan string, numOfResources) + failedServices := []string{} for _, service := range options.Resources { serviceProvider := providersMapping.AddServiceToProvider(service) @@ -157,10 +157,11 @@ func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, if err != nil { return err } - go initServiceResourcesWorker(service, serviceProvider, options, providerWrapper, &wg, failedServices) + err = initServiceResources(service, serviceProvider, options, providerWrapper) + if err != nil { + failedServices = append(failedServices, service) + } } - wg.Wait() - close(failedServices) // remove providers that failed to init their service providersMapping.RemoveServices(failedServices) @@ -190,29 +191,26 @@ func importFromPlan(providerMapping *terraformutils.ProvidersMapping, options Im return ImportFromPlan(providerMapping.GetBaseProvider(), plan) } -func initServiceResourcesWorker(service string, provider terraformutils.ProviderGenerator, - options ImportOptions, providerWrapper *providerwrapper.ProviderWrapper, wg *sync.WaitGroup, failedServices chan string) { +func initServiceResources(service string, provider terraformutils.ProviderGenerator, + options ImportOptions, providerWrapper *providerwrapper.ProviderWrapper) error { log.Println(provider.GetName() + " importing... " + service) err := provider.InitService(service, options.Verbose) if err != nil { - failedServices <- service log.Printf("%s error importing %s, err: %s\n", provider.GetName(), service, err) - wg.Done() - return + return err } provider.GetService().ParseFilters(options.Filter) err = provider.GetService().InitResources() if err != nil { - failedServices <- service log.Printf("%s error initializing resources in service %s, err: %s\n", provider.GetName(), service, err) - wg.Done() - return + return err } provider.GetService().PopulateIgnoreKeys(providerWrapper) provider.GetService().InitialCleanup() log.Println(provider.GetName() + " done importing " + service) - wg.Done() + + return nil } func ImportFromPlan(provider terraformutils.ProviderGenerator, plan *ImportPlan) error { diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go index 13d8f686fb..ce9fd3dd3d 100644 --- a/terraformutils/providers_mapping.go +++ b/terraformutils/providers_mapping.go @@ -60,8 +60,8 @@ func (p *ProvidersMapping) GetServices() []string { return services } -func (p *ProvidersMapping) RemoveServices(services chan string) { - for service := range services { +func (p *ProvidersMapping) RemoveServices(services []string) { + for _, service := range services { delete(p.Services, service) matchingProvider := p.serviceToProvider[service] From d8bc38f5dcc437de8adf984535819daf2842ee7a Mon Sep 17 00:00:00 2001 From: Anil Kumar Nagaraj Date: Wed, 3 Feb 2021 18:10:53 +0530 Subject: [PATCH 076/276] Add pdns support --- README.md | 9 + providers/ibm/ibm_private_dns.go | 303 +++++++++++++++++++++++++++++++ providers/ibm/ibm_provider.go | 1 + 3 files changed, 313 insertions(+) create mode 100644 providers/ibm/ibm_private_dns.go diff --git a/README.md b/README.md index d549b96755..dd497812bb 100644 --- a/README.md +++ b/README.md @@ -990,6 +990,15 @@ List of supported IBM Cloud resources: * `ibm_function_action` * `ibm_function_rule` * `ibm_function_trigger` +* `ibm_private_dns` + * `ibm_resource_instance` + * `ibm_dns_zone` + * `ibm_dns_resource_record` + * `ibm_dns_permitted_network` + * `ibm_dns_glb_monitor` + * `ibm_dns_glb_pool` + * `ibm_dns_glb` + ### Use with DigitalOcean diff --git a/providers/ibm/ibm_private_dns.go b/providers/ibm/ibm_private_dns.go new file mode 100644 index 0000000000..5d97b34ebf --- /dev/null +++ b/providers/ibm/ibm_private_dns.go @@ -0,0 +1,303 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" + "github.com/IBM/go-sdk-core/v3/core" + dns "github.com/IBM/networking-go-sdk/dnssvcsv1" +) + +//privateDNSTemplateGenerator ... +type privateDNSTemplateGenerator struct { + IBMService +} + +// loadPrivateDNS ... +func (g privateDNSTemplateGenerator) loadPrivateDNS(pDNSID string, pDNSName string, resGrpID string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + pDNSID, + pDNSName, + "ibm_resource_instance", + "ibm", + map[string]string{ + "resource_group_id": resGrpID, + }, + []string{}, + map[string]interface{}{}) + return resources +} + +// loadPrivateDNSZone ... +func (g privateDNSTemplateGenerator) loadPrivateDNSZone(pDNSGuid string, zoneID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s", pDNSGuid, zoneID), + zoneID, + "ibm_dns_zone", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// loadPrivateDNSPermittedNetwork ... +func (g privateDNSTemplateGenerator) loadPrivateDNSPermittedNetwork(pDNSGuid string, zoneID string, permittedNetworkID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, permittedNetworkID), + permittedNetworkID, + "ibm_dns_permitted_network", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// loadPrivateDNSResourceRecord ... +func (g privateDNSTemplateGenerator) loadPrivateDNSResourceRecord(pDNSGuid string, zoneID string, recordID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, recordID), + recordID, + "ibm_dns_resource_record", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// loadPrivateDNSGLBMonitor ... +func (g privateDNSTemplateGenerator) loadPrivateDNSGLBMonitor(pDNSGuid string, monitorID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s", pDNSGuid, monitorID), + monitorID, + "ibm_dns_glb_monitor", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// loadPrivateDNSGLBPool ... +func (g privateDNSTemplateGenerator) loadPrivateDNSGLBPool(pDNSGuid string, poolID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s", pDNSGuid, poolID), + poolID, + "ibm_dns_glb_pool", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// loadPrivateDNSGLB ... +func (g privateDNSTemplateGenerator) loadPrivateDNSGLB(pDNSGuid string, zoneID string, lbID string, dependsOn []string) terraformutils.Resource { + var resources terraformutils.Resource + resources = terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, lbID), + lbID, + "ibm_dns_glb", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +//InitResources ... +func (g *privateDNSTemplateGenerator) InitResources() error { + + region := os.Getenv("IC_REGION") + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + Region: region, + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + defaultDNSURL := "https://api.dns-svcs.cloud.ibm.com/v1" + + err = authenticateAPIKey(sess) + if err != nil { + return err + } + + bluemixToken := "" + if strings.HasPrefix(sess.Config.IAMAccessToken, "Bearer") { + bluemixToken = sess.Config.IAMAccessToken[7:len(sess.Config.IAMAccessToken)] + } else { + bluemixToken = sess.Config.IAMAccessToken + } + + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + serviceID, err := catalogClient.ResourceCatalog().FindByName("dns-svcs", true) + if err != nil { + return err + } + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + pDNSInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + + for _, instance := range pDNSInstances { + instanceID := instance.ID + instanceGUID := instance.Guid + // Instance + g.Resources = append(g.Resources, g.loadPrivateDNS(instanceID, instance.Name, instance.ResourceGroupID)) + var pDNSDependsOn []string + pDNSDependsOn = append(pDNSDependsOn, + "ibm_resource_instance."+terraformutils.TfSanitize(instance.Name)) + + // Zones + zoneOpts := &dns.DnsSvcsV1Options{ + URL: defaultDNSURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + } + + zService, err := dns.NewDnsSvcsV1(zoneOpts) + if err != nil { + return err + } + zoneOpt := dns.ListDnszonesOptions{ + InstanceID: &instanceGUID, + } + zoneList, _, err := zService.ListDnszones(&zoneOpt) + if err != nil { + return fmt.Errorf("Error Listing Zones %s", err) + } + for _, zone := range zoneList.Dnszones { + zoneID := *zone.ID + g.Resources = append(g.Resources, g.loadPrivateDNSZone(instanceGUID, zoneID, pDNSDependsOn)) + + var domainDependsOn []string + domainDependsOn = append(pDNSDependsOn, + "ibm_dns_zone."+terraformutils.TfSanitize(zoneID)) + + // Permitted Network Records + permittedNetworkOpt := dns.ListPermittedNetworksOptions{ + InstanceID: &instanceGUID, + DnszoneID: &zoneID, + } + permittedNetworkList, _, err := zService.ListPermittedNetworks(&permittedNetworkOpt) + if err != nil { + return fmt.Errorf("Error Listing Permitted Networks %s", err) + } + for _, permittedNetwork := range permittedNetworkList.PermittedNetworks { + permittedNetworkID := *permittedNetwork.ID + g.Resources = append(g.Resources, g.loadPrivateDNSPermittedNetwork(instanceGUID, zoneID, permittedNetworkID, domainDependsOn)) + } + + // Resource Records + dnsRecordOpt := dns.ListResourceRecordsOptions{ + InstanceID: &instanceGUID, + DnszoneID: &zoneID, + } + resourceRecordList, _, err := zService.ListResourceRecords(&dnsRecordOpt) + if err != nil { + return fmt.Errorf("Error Listing Resource Records %s", err) + } + for _, record := range resourceRecordList.ResourceRecords { + recordID := *record.ID + g.Resources = append(g.Resources, g.loadPrivateDNSResourceRecord(instanceGUID, zoneID, recordID, domainDependsOn)) + } + + // GLB Records + glbOpt := dns.ListLoadBalancersOptions{ + InstanceID: &instanceGUID, + DnszoneID: &zoneID, + } + glbOptList, _, err := zService.ListLoadBalancers(&glbOpt) + if err != nil { + return fmt.Errorf("Error Listing GLBs %s", err) + } + for _, lb := range glbOptList.LoadBalancers { + lbID := *lb.ID + g.Resources = append(g.Resources, g.loadPrivateDNSGLB(instanceGUID, zoneID, lbID, domainDependsOn)) + } + } + // Monitor Records + monitorOpt := dns.ListMonitorsOptions{ + InstanceID: &instanceGUID, + } + glbMonitorList, _, err := zService.ListMonitors(&monitorOpt) + if err != nil { + return fmt.Errorf("Error Listing GLB Monitor %s", err) + } + for _, monitor := range glbMonitorList.Monitors { + monitorID := *monitor.ID + g.Resources = append(g.Resources, g.loadPrivateDNSGLBMonitor(instanceGUID, monitorID, pDNSDependsOn)) + } + + // Pool Records + glbPoolOpt := dns.ListPoolsOptions{ + InstanceID: &instanceGUID, + } + glbPoolOptList, _, err := zService.ListPools(&glbPoolOpt) + if err != nil { + return fmt.Errorf("Error Listing GLB Pools %s", err) + } + for _, pool := range glbPoolOptList.Pools { + poolID := *pool.ID + g.Resources = append(g.Resources, g.loadPrivateDNSGLBPool(instanceGUID, poolID, pDNSDependsOn)) + } + + } + + return nil +} diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index 75feb26daa..f2c1940d60 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -81,6 +81,7 @@ func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGen "ibm_is_flow_log": &FlowLogGenerator{}, "ibm_is_instance_template": &InstanceTemplateGenerator{}, "ibm_function": &CloudFunctionGenerator{}, + "ibm_private_dns": &privateDNSTemplateGenerator{}, } } From 6898558a50699d8e48f27325ee682bfdda236ce8 Mon Sep 17 00:00:00 2001 From: oliverpei Date: Tue, 9 Feb 2021 15:19:58 +0800 Subject: [PATCH 077/276] support TencentCloud provider --- README.md | 58 ++++++ cmd/provider_cmd_tencentcloud.go | 53 +++++ cmd/root.go | 2 + go.mod | 7 +- go.sum | 42 +++- providers/tencentcloud/as.go | 141 ++++++++++++++ providers/tencentcloud/cbs.go | 72 +++++++ providers/tencentcloud/cdn.go | 72 +++++++ providers/tencentcloud/cfs.go | 57 ++++++ providers/tencentcloud/clb.go | 71 +++++++ providers/tencentcloud/cos.go | 66 +++++++ providers/tencentcloud/cvm.go | 76 ++++++++ providers/tencentcloud/elasticsearch.go | 72 +++++++ providers/tencentcloud/gaap.go | 123 ++++++++++++ providers/tencentcloud/key_pair.go | 72 +++++++ providers/tencentcloud/mongodb.go | 72 +++++++ providers/tencentcloud/mysql.go | 149 ++++++++++++++ providers/tencentcloud/redis.go | 72 +++++++ providers/tencentcloud/scf.go | 72 +++++++ providers/tencentcloud/security_group.go | 76 ++++++++ providers/tencentcloud/ssl.go | 72 +++++++ providers/tencentcloud/subnet.go | 75 +++++++ providers/tencentcloud/tcaplus.go | 77 ++++++++ .../tencentcloud/tencentcloud_provider.go | 184 ++++++++++++++++++ .../tencentcloud/tencentcloud_service.go | 21 ++ providers/tencentcloud/vpc.go | 75 +++++++ providers/tencentcloud/vpn.go | 72 +++++++ 27 files changed, 1998 insertions(+), 3 deletions(-) create mode 100755 cmd/provider_cmd_tencentcloud.go create mode 100755 providers/tencentcloud/as.go create mode 100755 providers/tencentcloud/cbs.go create mode 100755 providers/tencentcloud/cdn.go create mode 100755 providers/tencentcloud/cfs.go create mode 100755 providers/tencentcloud/clb.go create mode 100755 providers/tencentcloud/cos.go create mode 100755 providers/tencentcloud/cvm.go create mode 100755 providers/tencentcloud/elasticsearch.go create mode 100755 providers/tencentcloud/gaap.go create mode 100755 providers/tencentcloud/key_pair.go create mode 100755 providers/tencentcloud/mongodb.go create mode 100755 providers/tencentcloud/mysql.go create mode 100755 providers/tencentcloud/redis.go create mode 100755 providers/tencentcloud/scf.go create mode 100755 providers/tencentcloud/security_group.go create mode 100755 providers/tencentcloud/ssl.go create mode 100755 providers/tencentcloud/subnet.go create mode 100755 providers/tencentcloud/tcaplus.go create mode 100755 providers/tencentcloud/tencentcloud_provider.go create mode 100755 providers/tencentcloud/tencentcloud_service.go create mode 100755 providers/tencentcloud/vpc.go create mode 100755 providers/tencentcloud/vpn.go diff --git a/README.md b/README.md index d549b96755..c9651af501 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [Linode](#use-with-linode) * [NS1](#use-with-ns1) * [OpenStack](#use-with-openstack) + * [TencentCloud](#use-with-tencentcloud) * [Vultr](#use-with-vultr) * [Yandex.Cloud](#use-with-yandex) * Infrastructure Software @@ -219,6 +220,7 @@ Links to download Terraform Providers: * Linode provider >1.8.0 - [here](https://releases.hashicorp.com/terraform-provider-linode/) * NS1 provider >1.8.3 - [here](https://releases.hashicorp.com/terraform-provider-ns1/) * OpenStack provider >1.21.1 - [here](https://releases.hashicorp.com/terraform-provider-openstack/) + * TencentCloud provider >1.50.0 - [here](https://releases.hashicorp.com/terraform-provider-tencentcloud/) * Vultr provider >1.0.5 - [here](https://releases.hashicorp.com/terraform-provider-vultr/) * Yandex provider >0.42.0 - [here](https://releases.hashicorp.com/terraform-provider-yandex/) * Infrastructure Software @@ -1176,6 +1178,62 @@ List of supported OpenStack services: * `openstack_networking_secgroup_v2` * `openstack_networking_secgroup_rule_v2` +### Use with TencentCloud + +Example: + +``` +$ export TENCENTCLOUD_SECRET_ID= +$ export TENCENTCLOUD_SECRET_KEY= +$ terraformer import tencentcloud --resources=cvm,cbs --regions=ap-guangzhou +``` + +List of supported TencentCloud services: + +* `as` + * `tencentcloud_as_scaling_group` + * `tencentcloud_as_scaling_config` +* `cbs` + * `tencentcloud_cbs_storage` +* `cdn` + * `tencentcloud_cdn_domain` +* `cfs` + * `tencentcloud_cfs_file_system` +* `clb` + * `tencentcloud_clb_instance` +* `cos` + * `tencentcloud_cos_bucket` +* `cvm` + * `tencentcloud_instance` +* `elasticsearch` + * `tencentcloud_elasticsearch_instance` +* `gaap` + * `tencentcloud_gaap_proxy` + * `tencentcloud_gaap_realserver` +* `key_pair` + * `tencentcloud_key_pair` +* `mongodb` + * `tencentcloud_mongodb_instance` +* `mysql` + * `tencentcloud_mysql_instance` + * `tencentcloud_mysql_readonly_instance` +* `redis` + * `tencentcloud_redis_instance` +* `scf` + * `tencentcloud_scf_function` +* `security_group` + * `tencentcloud_security_group` +* `ssl` + * `tencentcloud_ssl_certificate` +* `subnet` + * `tencentcloud_subnet` +* `tcaplus` + * `tencentcloud_tcaplus_cluster` +* `vpc` + * `tencentcloud_vpc` +* `vpc` + * `tencentcloud_vpn_gateway` + ### Use with Vultr Example: diff --git a/cmd/provider_cmd_tencentcloud.go b/cmd/provider_cmd_tencentcloud.go new file mode 100755 index 0000000000..21c0e7c1d6 --- /dev/null +++ b/cmd/provider_cmd_tencentcloud.go @@ -0,0 +1,53 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "log" + + tencentcloud_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/tencentcloud" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdTencentCloudImporter(options ImportOptions) *cobra.Command { + cmd := &cobra.Command{ + Use: "tencentcloud", + Short: "Import current state to Terraform configuration from Tencent Cloud", + Long: "Import current state to Terraform configuration from Tencent Cloud", + RunE: func(cmd *cobra.Command, args []string) error { + originalPathPattern := options.PathPattern + for _, region := range options.Regions { + provider := newTencentCloudProvider() + options.PathPattern = originalPathPattern + options.PathPattern += region + "/" + log.Println(provider.GetName() + " importing region " + region) + err := Import(provider, options, []string{region}) + if err != nil { + return err + } + } + return nil + }, + } + cmd.AddCommand(listCmd(newTencentCloudProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "cvm,vpc,cdn", "tencentcloud_vpc=id1:id2:id3") + cmd.PersistentFlags().StringSliceVarP(&options.Regions, "regions", "", []string{}, "ap-guangzhou") + return cmd +} + +func newTencentCloudProvider() terraformutils.ProviderGenerator { + return &tencentcloud_terraforming.TencentCloudProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index af080c38bf..c22ad4bc0d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -51,6 +51,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdLinodeImporter, newCmdNs1Importer, newCmdOpenStackImporter, + newCmdTencentCloudImporter, newCmdVultrImporter, newCmdYandexImporter, // Infrastructure Software @@ -89,6 +90,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { newLinodeProvider, newNs1Provider, newOpenStackProvider, + newTencentCloudProvider, newVultrProvider, // Infrastructure Software newKubernetesProvider, diff --git a/go.mod b/go.mod index f3e8489ecc..466c93eb1b 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 - github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 + github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 github.com/IBM/ibm-cos-sdk-go v1.5.0 @@ -20,10 +20,12 @@ require ( github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible + github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 github.com/aws/aws-sdk-go v1.36.19 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 + github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible @@ -38,6 +40,7 @@ require ( github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.29 github.com/heroku/heroku-go/v5 v5.1.0 + github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 @@ -49,6 +52,8 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 + github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible + github.com/tencentyun/cos-go-sdk-v5 v0.7.19 github.com/vultr/govultr v0.5.0 github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 diff --git a/go.sum b/go.sum index 1e288ef81b..07db826208 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9Qp github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= github.com/DataDog/datadog-go v3.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 h1:CQEiiiSY2KD3U3WnBpYo6Bh6/VD6+LlL6+Hd3AH+utY= -github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0= +github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 h1:sUpBb2/GC8L6UOKDnbEZLRTxQB2RQgMv1mxbnOHOQW4= +github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY= github.com/IBM/go-sdk-core/v3 v3.3.1 h1:DoXjP1+Wm8Yd4XJsvBMRcYLvQwSLFnzKlMjSrg3Rzpw= @@ -155,6 +155,8 @@ github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDM github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= +github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= +github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -174,6 +176,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -212,6 +216,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= +github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuijfIjZyjZaHq9xDUh0tNitwXshJpbLkqMOJv4H3do= +github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -300,6 +306,8 @@ github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= @@ -309,6 +317,8 @@ github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.10 h1:FEv6Pt/V4wLwP4vOCZbWlpfmi8kj4UiRip34IDE6SGw= github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= +github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= +github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= @@ -559,6 +569,8 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1 github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/heroku/heroku-go/v5 v5.1.0 h1:3Qx1MxjzczSakhAZN4yRsvCI7kP0ldijK1XvfoYa4DE= github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZOdlm26Sr73U= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= @@ -699,6 +711,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -711,6 +725,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 h1:TLDEP4t/KAbbIBVqMQlmf0MaLBm0eMAGHKtrOFNGHUM= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409/go.mod h1:q1krA85sGCNuxTOIcH9WSFf4nEO7he+IDDf5SW+xs1s= @@ -719,6 +734,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -741,6 +757,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -748,6 +766,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -757,6 +777,7 @@ github.com/paultyng/go-newrelic/v4 v4.10.0/go.mod h1:RmSnSvZnV267IBAqv2/2RACv1YV github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= @@ -845,8 +866,13 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= +github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible h1:5Td2b0yfaOvw9M9nZ5Oav6Li9bxUNxt4DgxMfIPpsa0= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= +github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible h1:q+D/Y9jla3afgsIihtyhwyl0c2W+eRWNM9ohVwPiiPw= +github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= +github.com/tencentyun/cos-go-sdk-v5 v0.7.19 h1:janAfTO4MglOrUFuKGTQJBuMc66+F7TgtEIt1wPsJ+k= +github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -901,6 +927,8 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= +go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1035,6 +1063,8 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/Lt golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1120,6 +1150,8 @@ golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091 h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1209,6 +1241,8 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfS golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2 h1:vEtypaVub6UvKkiXZ2xx9QIvp9TL7sI7xp7vdi2kezA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -1378,8 +1412,12 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/providers/tencentcloud/as.go b/providers/tencentcloud/as.go new file mode 100755 index 0000000000..21999612d2 --- /dev/null +++ b/providers/tencentcloud/as.go @@ -0,0 +1,141 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + as "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" +) + +type AsGenerator struct { + TencentCloudService +} + +func (g *AsGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := as.NewClient(&credential, region, profile) + if err != nil { + return err + } + + if err := g.loadScalingGroups(client); err != nil { + return err + } + if err := g.loadScalingConfigs(client); err != nil { + return err + } + + return nil +} + +func (g *AsGenerator) loadScalingGroups(client *as.Client) error { + request := as.NewDescribeAutoScalingGroupsRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*as.AutoScalingGroup, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeAutoScalingGroups(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.AutoScalingGroupSet...) + if len(response.Response.AutoScalingGroupSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.AutoScalingGroupId, + *instance.AutoScalingGroupName+"_"+*instance.AutoScalingGroupId, + "tencentcloud_as_scaling_group", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} + +func (g *AsGenerator) loadScalingConfigs(client *as.Client) error { + request := as.NewDescribeLaunchConfigurationsRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*as.LaunchConfiguration, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeLaunchConfigurations(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.LaunchConfigurationSet...) + if len(response.Response.LaunchConfigurationSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.LaunchConfigurationId, + *instance.LaunchConfigurationName+"_"+*instance.LaunchConfigurationId, + "tencentcloud_as_scaling_config", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} + +func (g *AsGenerator) PostConvertHook() error { + for i, resource := range g.Resources { + if resource.InstanceInfo.Type != "tencentcloud_as_scaling_group" { + continue + } + if configID, exist := resource.InstanceState.Attributes["configuration_id"]; exist { + for _, r := range g.Resources { + if r.InstanceInfo.Type != "tencentcloud_as_scaling_config" { + continue + } + if configID == r.InstanceState.Attributes["id"] { + g.Resources[i].Item["configuration_id"] = "${tencentcloud_as_scaling_config." + r.ResourceName + ".id}" + } + } + } + } + + return nil +} diff --git a/providers/tencentcloud/cbs.go b/providers/tencentcloud/cbs.go new file mode 100755 index 0000000000..6694c79d41 --- /dev/null +++ b/providers/tencentcloud/cbs.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + cbs "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs/v20170312" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" +) + +type CbsGenerator struct { + TencentCloudService +} + +func (g *CbsGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := cbs.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := cbs.NewDescribeDisksRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*cbs.Disk, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeDisks(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.DiskSet...) + if len(response.Response.DiskSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.DiskId, + *instance.DiskId, + "tencentcloud_cbs_storage", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/cdn.go b/providers/tencentcloud/cdn.go new file mode 100755 index 0000000000..7ba70093fb --- /dev/null +++ b/providers/tencentcloud/cdn.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + cdn "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn/v20180606" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" +) + +type CdnGenerator struct { + TencentCloudService +} + +func (g *CdnGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := cdn.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := cdn.NewDescribeDomainsConfigRequest() + + var offset int64 = 0 + var pageSize int64 = 50 + allInstances := make([]*cdn.DetailDomain, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeDomainsConfig(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.Domains...) + if len(response.Response.Domains) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.Domain, + *instance.Domain, + "tencentcloud_cdn_domain", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/cfs.go b/providers/tencentcloud/cfs.go new file mode 100755 index 0000000000..8353665091 --- /dev/null +++ b/providers/tencentcloud/cfs.go @@ -0,0 +1,57 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + cfs "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs/v20190719" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" +) + +type CfsGenerator struct { + TencentCloudService +} + +func (g *CfsGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := cfs.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := cfs.NewDescribeCfsFileSystemsRequest() + response, err := client.DescribeCfsFileSystems(request) + if err != nil { + return err + } + + for _, instance := range response.Response.FileSystems { + resource := terraformutils.NewResource( + *instance.FileSystemId, + *instance.FsName+"_"+*instance.FileSystemId, + "tencentcloud_cfs_file_system", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/clb.go b/providers/tencentcloud/clb.go new file mode 100755 index 0000000000..fb19bc4ea4 --- /dev/null +++ b/providers/tencentcloud/clb.go @@ -0,0 +1,71 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + clb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" +) + +type ClbGenerator struct { + TencentCloudService +} + +func (g *ClbGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := clb.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := clb.NewDescribeLoadBalancersRequest() + var offset int64 = 0 + var pageSize int64 = 50 + allInstances := make([]*clb.LoadBalancer, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeLoadBalancers(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.LoadBalancerSet...) + if len(response.Response.LoadBalancerSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.LoadBalancerId, + *instance.LoadBalancerName+"_"+*instance.LoadBalancerId, + "tencentcloud_clb_instance", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/cos.go b/providers/tencentcloud/cos.go new file mode 100755 index 0000000000..aa5ac038aa --- /dev/null +++ b/providers/tencentcloud/cos.go @@ -0,0 +1,66 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + "github.com/tencentyun/cos-go-sdk-v5" +) + +type CosGenerator struct { + TencentCloudService +} + +func (g *CosGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + requestURL := fmt.Sprintf("https://cos.%s.myqcloud.com", region) + u, _ := url.Parse(requestURL) + uri := &cos.BaseURL{ServiceURL: u} + client := cos.NewClient(uri, &http.Client{ + Transport: &cos.AuthorizationTransport{ + SecretID: credential.SecretId, + SecretKey: credential.SecretKey, + SessionToken: credential.Token, + }, + }) + + result, _, err := client.Service.Get(context.Background()) + if err != nil { + return err + } + + for _, bucket := range result.Buckets { + resource := terraformutils.NewResource( + bucket.Name, + bucket.Name, + "tencentcloud_cos_bucket", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/cvm.go b/providers/tencentcloud/cvm.go new file mode 100755 index 0000000000..4b58105003 --- /dev/null +++ b/providers/tencentcloud/cvm.go @@ -0,0 +1,76 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312" +) + +type CvmGenerator struct { + TencentCloudService +} + +func (g *CvmGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := cvm.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := cvm.NewDescribeInstancesRequest() + + var offset int64 = 0 + var pageSize int64 = 50 + allInstances := make([]*cvm.Instance, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeInstances(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.InstanceSet...) + if len(response.Response.InstanceSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.InstanceId, + *instance.InstanceName+"_"+*instance.InstanceId, + "tencentcloud_instance", + "tencentcloud", + map[string]string{ + "disable_monitor_service": "false", + "disable_security_service": "false", + "force_delete": "false", + }, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/elasticsearch.go b/providers/tencentcloud/elasticsearch.go new file mode 100755 index 0000000000..34ba27ee9f --- /dev/null +++ b/providers/tencentcloud/elasticsearch.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + es "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es/v20180416" +) + +type EsGenerator struct { + TencentCloudService +} + +func (g *EsGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := es.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := es.NewDescribeInstancesRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*es.InstanceInfo, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeInstances(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.InstanceList...) + if len(response.Response.InstanceList) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.InstanceId, + *instance.InstanceName+"_"+*instance.InstanceId, + "tencentcloud_elasticsearch_instance", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/gaap.go b/providers/tencentcloud/gaap.go new file mode 100755 index 0000000000..017a24d766 --- /dev/null +++ b/providers/tencentcloud/gaap.go @@ -0,0 +1,123 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + gaap "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap/v20180529" +) + +type GaapGenerator struct { + TencentCloudService +} + +func (g *GaapGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := gaap.NewClient(&credential, region, profile) + if err != nil { + return err + } + + if err := g.loadProxy(client); err != nil { + return err + } + if err := g.loadRealServer(client); err != nil { + return err + } + + return nil +} + +func (g *GaapGenerator) loadProxy(client *gaap.Client) error { + request := gaap.NewDescribeProxiesRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*gaap.ProxyInfo, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeProxies(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.ProxySet...) + if len(response.Response.ProxySet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.ProxyId, + *instance.ProxyName+"_"+*instance.ProxyId, + "tencentcloud_gaap_proxy", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} + +func (g *GaapGenerator) loadRealServer(client *gaap.Client) error { + request := gaap.NewDescribeRealServersRequest() + var projectID int64 = -1 + request.ProjectId = &projectID + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*gaap.BindRealServerInfo, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeRealServers(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.RealServerSet...) + if len(response.Response.RealServerSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.RealServerId, + *instance.RealServerName+"_"+*instance.RealServerId, + "tencentcloud_gaap_realserver", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/key_pair.go b/providers/tencentcloud/key_pair.go new file mode 100755 index 0000000000..a244554476 --- /dev/null +++ b/providers/tencentcloud/key_pair.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312" +) + +type KeyPairGenerator struct { + TencentCloudService +} + +func (g *KeyPairGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := cvm.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := cvm.NewDescribeKeyPairsRequest() + + var offset int64 = 0 + var pageSize int64 = 50 + allInstances := make([]*cvm.KeyPair, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeKeyPairs(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.KeyPairSet...) + if len(response.Response.KeyPairSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.KeyId, + *instance.KeyName+"_"+*instance.KeyId, + "tencentcloud_key_pair", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/mongodb.go b/providers/tencentcloud/mongodb.go new file mode 100755 index 0000000000..cdabfd6c9c --- /dev/null +++ b/providers/tencentcloud/mongodb.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + mongodb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mongodb/v20180408" +) + +type MongodbGenerator struct { + TencentCloudService +} + +func (g *MongodbGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := mongodb.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := mongodb.NewDescribeDBInstancesRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*mongodb.MongoDBInstanceDetail, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeDBInstances(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.InstanceDetails...) + if len(response.Response.InstanceDetails) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.InstanceId, + *instance.InstanceName+"_"+*instance.InstanceId, + "tencentcloud_mongodb_instance", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/mysql.go b/providers/tencentcloud/mysql.go new file mode 100755 index 0000000000..0389998c93 --- /dev/null +++ b/providers/tencentcloud/mysql.go @@ -0,0 +1,149 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + cdb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb/v20170320" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" +) + +type MysqlGenerator struct { + TencentCloudService +} + +func (g *MysqlGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := cdb.NewClient(&credential, region, profile) + if err != nil { + return err + } + + if err := g.loadMysqlMaster(client); err != nil { + return err + } + if err := g.loadMysqlReadOnly(client); err != nil { + return err + } + + return nil +} + +func (g *MysqlGenerator) loadMysqlMaster(client *cdb.Client) error { + request := cdb.NewDescribeDBInstancesRequest() + var instanceTypeMaster uint64 = 1 + request.InstanceTypes = []*uint64{&instanceTypeMaster} + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*cdb.InstanceInfo, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeDBInstances(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.Items...) + if len(response.Response.Items) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.InstanceId, + *instance.InstanceName+"_"+*instance.InstanceId, + "tencentcloud_mysql_instance", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} + +func (g *MysqlGenerator) loadMysqlReadOnly(client *cdb.Client) error { + request := cdb.NewDescribeDBInstancesRequest() + var instanceTypeMaster uint64 = 3 + request.InstanceTypes = []*uint64{&instanceTypeMaster} + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*cdb.InstanceInfo, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeDBInstances(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.Items...) + if len(response.Response.Items) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.InstanceId, + *instance.InstanceName+"_"+*instance.InstanceId, + "tencentcloud_mysql_readonly_instance", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} + +func (g *MysqlGenerator) PostConvertHook() error { + for i, resource := range g.Resources { + if resource.InstanceInfo.Type == "tencentcloud_mysql_instance" { + delete(resource.Item, "pay_type") + delete(resource.Item, "period") + } + + if resource.InstanceInfo.Type != "tencentcloud_mysql_readonly_instance" { + if masterID, exist := resource.InstanceState.Attributes["master_instance_id"]; exist { + for _, r := range g.Resources { + if r.InstanceInfo.Type != "tencentcloud_mysql_instance" { + continue + } + if masterID == r.InstanceState.Attributes["id"] { + g.Resources[i].Item["master_instance_id"] = "${tencentcloud_mysql_instance." + r.ResourceName + ".id}" + } + } + } + } + } + + return nil +} diff --git a/providers/tencentcloud/redis.go b/providers/tencentcloud/redis.go new file mode 100755 index 0000000000..73e1550e0f --- /dev/null +++ b/providers/tencentcloud/redis.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + redis "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis/v20180412" +) + +type RedisGenerator struct { + TencentCloudService +} + +func (g *RedisGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := redis.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := redis.NewDescribeInstancesRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*redis.InstanceSet, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeInstances(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.InstanceSet...) + if len(response.Response.InstanceSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.InstanceId, + *instance.InstanceName+"_"+*instance.InstanceId, + "tencentcloud_redis_instance", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/scf.go b/providers/tencentcloud/scf.go new file mode 100755 index 0000000000..09b4b42351 --- /dev/null +++ b/providers/tencentcloud/scf.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + scf "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416" +) + +type ScfGenerator struct { + TencentCloudService +} + +func (g *ScfGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := scf.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := scf.NewListFunctionsRequest() + + var offset int64 = 0 + var pageSize int64 = 50 + allInstances := make([]*scf.Function, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.ListFunctions(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.Functions...) + if len(response.Response.Functions) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.Namespace+"+"+*instance.FunctionName, + *instance.Namespace+"_"+*instance.FunctionName, + "tencentcloud_scf_function", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/security_group.go b/providers/tencentcloud/security_group.go new file mode 100755 index 0000000000..4707535249 --- /dev/null +++ b/providers/tencentcloud/security_group.go @@ -0,0 +1,76 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312" +) + +type SecurityGroupGenerator struct { + TencentCloudService +} + +func (g *SecurityGroupGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := vpc.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := vpc.NewDescribeSecurityGroupsRequest() + + var offset int64 = 0 + var pageSize int64 = 50 + allInstances := make([]*vpc.SecurityGroup, 0) + + for { + offsetString := fmt.Sprintf("%d", offset) + limitString := fmt.Sprintf("%d", pageSize) + request.Offset = &offsetString + request.Limit = &limitString + response, err := client.DescribeSecurityGroups(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.SecurityGroupSet...) + if len(response.Response.SecurityGroupSet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.SecurityGroupId, + *instance.SecurityGroupName+"_"+*instance.SecurityGroupId, + "tencentcloud_security_group", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/ssl.go b/providers/tencentcloud/ssl.go new file mode 100755 index 0000000000..6741989eff --- /dev/null +++ b/providers/tencentcloud/ssl.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + ssl "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205" +) + +type SslGenerator struct { + TencentCloudService +} + +func (g *SslGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := ssl.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := ssl.NewDescribeCertificatesRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*ssl.Certificates, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeCertificates(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.Certificates...) + if len(response.Response.Certificates) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.CertificateId, + *instance.CertificateId, + "tencentcloud_ssl_certificate", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/subnet.go b/providers/tencentcloud/subnet.go new file mode 100755 index 0000000000..2ba9437172 --- /dev/null +++ b/providers/tencentcloud/subnet.go @@ -0,0 +1,75 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "strconv" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312" +) + +type SubnetGenerator struct { + TencentCloudService +} + +func (g *SubnetGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := vpc.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := vpc.NewDescribeSubnetsRequest() + offset := 0 + pageSize := 50 + allSubnets := make([]*vpc.Subnet, 0) + + for { + offsetString := strconv.Itoa(offset) + limitString := strconv.Itoa(pageSize) + request.Offset = &offsetString + request.Limit = &limitString + response, err := client.DescribeSubnets(request) + if err != nil { + return err + } + + allSubnets = append(allSubnets, response.Response.SubnetSet...) + if len(response.Response.SubnetSet) < pageSize { + break + } + offset += pageSize + } + + for _, subnet := range allSubnets { + resource := terraformutils.NewResource( + *subnet.SubnetId, + *subnet.SubnetName+"_"+*subnet.SubnetId, + "tencentcloud_subnet", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/tcaplus.go b/providers/tencentcloud/tcaplus.go new file mode 100755 index 0000000000..407cbfa571 --- /dev/null +++ b/providers/tencentcloud/tcaplus.go @@ -0,0 +1,77 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + tcaplus "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcaplusdb/v20190823" +) + +type TcaplusGenerator struct { + TencentCloudService +} + +func (g *TcaplusGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := tcaplus.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := tcaplus.NewDescribeClustersRequest() + + var offset int64 = 0 + var pageSize int64 = 50 + allInstances := make([]*tcaplus.ClusterInfo, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeClusters(request) + if err != nil { + sdkErr, ok := err.(*errors.TencentCloudSDKError) + if ok && sdkErr.Code == "UnsupportedRegion" { + return nil + } + return err + } + + allInstances = append(allInstances, response.Response.Clusters...) + if len(response.Response.Clusters) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.ClusterId, + *instance.ClusterName+"_"+*instance.ClusterId, + "tencentcloud_tcaplus_cluster", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/tencentcloud_provider.go b/providers/tencentcloud/tencentcloud_provider.go new file mode 100755 index 0000000000..e799bf213c --- /dev/null +++ b/providers/tencentcloud/tencentcloud_provider.go @@ -0,0 +1,184 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "errors" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" +) + +type TencentCloudProvider struct { + terraformutils.Provider + region string + credential common.Credential +} + +func (p *TencentCloudProvider) getCredential() error { + secretID := os.Getenv("TENCENTCLOUD_SECRET_ID") + if secretID == "" { + return errors.New("TENCENTCLOUD_SECRET_ID must be set") + } + secretKey := os.Getenv("TENCENTCLOUD_SECRET_KEY") + if secretKey == "" { + return errors.New("TENCENTCLOUD_SECRET_KEY must be set") + } + token := os.Getenv("TENCENTCLOUD_SECURITY_TOKEN") + + p.credential = common.Credential{ + SecretId: secretID, + SecretKey: secretKey, + Token: token, + } + return nil +} + +func (p *TencentCloudProvider) GetName() string { + return "tencentcloud" +} + +func (p *TencentCloudProvider) Init(args []string) error { + err := p.getCredential() + if err != nil { + return err + } + p.region = args[0] + return nil +} + +func (p *TencentCloudProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New("tencentcloud: " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "region": p.region, + "credential": p.credential, + }) + return nil +} + +func (p *TencentCloudProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "cvm": &CvmGenerator{}, + "vpc": &VpcGenerator{}, + "subnet": &SubnetGenerator{}, + "cdn": &CdnGenerator{}, + "as": &AsGenerator{}, + "clb": &ClbGenerator{}, + "cos": &CosGenerator{}, + "key_pair": &KeyPairGenerator{}, + "security_group": &SecurityGroupGenerator{}, + "cbs": &CbsGenerator{}, + "cfs": &CfsGenerator{}, + "elasticsearch": &EsGenerator{}, + "gaap": &GaapGenerator{}, + "mongodb": &MongodbGenerator{}, + "mysql": &MysqlGenerator{}, + "redis": &RedisGenerator{}, + "ssl": &SslGenerator{}, + "scf": &ScfGenerator{}, + "tcaplus": &TcaplusGenerator{}, + "vpn": &VpnGenerator{}, + } +} + +func (p *TencentCloudProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{ + "cvm": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + "security_group": []string{"security_groups", "id"}, + "key_pair": []string{"key_name", "id"}, + }, + "subnet": { + "vpc": []string{"vpc_id", "id"}, + }, + "as": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_ids", "id"}, + "clb": []string{"forward_balancer_ids", "id"}, + }, + "clb": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + "security_group": []string{"security_groups", "id"}, + }, + "cfs": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + }, + "elasticsearch": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + }, + "mongodb": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + }, + "mysql": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + "security_group": []string{"security_groups", "id"}, + }, + "redis": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + }, + "scf": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + "cos": []string{"cos_bucket_name", "id"}, + }, + "tcaplus": { + "vpc": []string{"vpc_id", "id"}, + "subnet": []string{"subnet_id", "id"}, + }, + "vpn": { + "vpc": []string{"vpc_id", "id"}, + }, + } +} + +func (p *TencentCloudProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{ + "provider": map[string]interface{}{ + p.GetName(): map[string]interface{}{ + "version": providerwrapper.GetProviderVersion(p.GetName()), + }, + }, + } +} + +func NewTencentCloudClientProfile() *profile.ClientProfile { + cpf := profile.NewClientProfile() + + // all request use method POST + cpf.HttpProfile.ReqMethod = "POST" + // request timeout + cpf.HttpProfile.ReqTimeout = 300 + // default language + cpf.Language = "en-US" + + return cpf +} diff --git a/providers/tencentcloud/tencentcloud_service.go b/providers/tencentcloud/tencentcloud_service.go new file mode 100755 index 0000000000..0a47a4dd59 --- /dev/null +++ b/providers/tencentcloud/tencentcloud_service.go @@ -0,0 +1,21 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import "github.com/GoogleCloudPlatform/terraformer/terraformutils" + +type TencentCloudService struct { + terraformutils.Service +} diff --git a/providers/tencentcloud/vpc.go b/providers/tencentcloud/vpc.go new file mode 100755 index 0000000000..da036e5d66 --- /dev/null +++ b/providers/tencentcloud/vpc.go @@ -0,0 +1,75 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "strconv" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312" +) + +type VpcGenerator struct { + TencentCloudService +} + +func (g *VpcGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := vpc.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := vpc.NewDescribeVpcsRequest() + offset := 0 + pageSize := 50 + allVpcs := make([]*vpc.Vpc, 0) + + for { + offsetString := strconv.Itoa(offset) + limitString := strconv.Itoa(pageSize) + request.Offset = &offsetString + request.Limit = &limitString + response, err := client.DescribeVpcs(request) + if err != nil { + return err + } + + allVpcs = append(allVpcs, response.Response.VpcSet...) + if len(response.Response.VpcSet) < pageSize { + break + } + offset += pageSize + } + + for _, vpcInstance := range allVpcs { + resource := terraformutils.NewResource( + *vpcInstance.VpcId, + *vpcInstance.VpcName+"_"+*vpcInstance.VpcId, + "tencentcloud_vpc", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/tencentcloud/vpn.go b/providers/tencentcloud/vpn.go new file mode 100755 index 0000000000..33d4c5175e --- /dev/null +++ b/providers/tencentcloud/vpn.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tencentcloud + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312" +) + +type VpnGenerator struct { + TencentCloudService +} + +func (g *VpnGenerator) InitResources() error { + args := g.GetArgs() + region := args["region"].(string) + credential := args["credential"].(common.Credential) + profile := NewTencentCloudClientProfile() + client, err := vpc.NewClient(&credential, region, profile) + if err != nil { + return err + } + + request := vpc.NewDescribeVpnGatewaysRequest() + + var offset uint64 = 0 + var pageSize uint64 = 50 + allInstances := make([]*vpc.VpnGateway, 0) + + for { + request.Offset = &offset + request.Limit = &pageSize + response, err := client.DescribeVpnGateways(request) + if err != nil { + return err + } + + allInstances = append(allInstances, response.Response.VpnGatewaySet...) + if len(response.Response.VpnGatewaySet) < int(pageSize) { + break + } + offset += pageSize + } + + for _, instance := range allInstances { + resource := terraformutils.NewResource( + *instance.VpnGatewayId, + *instance.VpnGatewayName+"_"+*instance.VpnGatewayId, + "tencentcloud_vpn_gateway", + "tencentcloud", + map[string]string{}, + []string{}, + map[string]interface{}{}, + ) + g.Resources = append(g.Resources, resource) + } + + return nil +} From 62b0de5efcdb1d1084f53e27e6212cce84d84fe7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:19:08 +0000 Subject: [PATCH 078/276] Bump github.com/digitalocean/godo from 1.35.1 to 1.57.0 Bumps [github.com/digitalocean/godo](https://github.com/digitalocean/godo) from 1.35.1 to 1.57.0. - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalocean/godo/compare/v1.35.1...v1.57.0) Signed-off-by: dependabot[bot] --- go.mod | 9 ++++++--- go.sum | 42 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index f3e8489ecc..72eef6aa49 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 - github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 + github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 github.com/IBM/ibm-cos-sdk-go v1.5.0 @@ -20,24 +20,27 @@ require ( github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible + github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 github.com/aws/aws-sdk-go v1.36.19 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 + github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/digitalocean/godo v1.35.1 + github.com/digitalocean/godo v1.57.0 github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/fastly/go-fastly v1.18.0 github.com/google/go-github/v25 v25.1.3 github.com/gophercloud/gophercloud v0.13.0 github.com/hashicorp/go-azure-helpers v0.10.0 - github.com/hashicorp/go-hclog v0.14.1 + github.com/hashicorp/go-hclog v0.15.0 github.com/hashicorp/go-plugin v1.4.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.29 github.com/heroku/heroku-go/v5 v5.1.0 + github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 diff --git a/go.sum b/go.sum index 1e288ef81b..5530aa8c03 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9Qp github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= github.com/DataDog/datadog-go v3.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 h1:CQEiiiSY2KD3U3WnBpYo6Bh6/VD6+LlL6+Hd3AH+utY= -github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0= +github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 h1:sUpBb2/GC8L6UOKDnbEZLRTxQB2RQgMv1mxbnOHOQW4= +github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY= github.com/IBM/go-sdk-core/v3 v3.3.1 h1:DoXjP1+Wm8Yd4XJsvBMRcYLvQwSLFnzKlMjSrg3Rzpw= @@ -155,6 +155,8 @@ github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDM github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= +github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= +github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -174,6 +176,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -212,6 +216,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= +github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuijfIjZyjZaHq9xDUh0tNitwXshJpbLkqMOJv4H3do= +github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -245,8 +251,8 @@ github.com/dghubble/sling v1.1.0/go.mod h1:ZcPRuLm0qrcULW2gOrjXrAWgf76sahqSyxXyV github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.35.1 h1:3P5timR4LTqcCafzrCgV2j83ck4aWb937ybFC7YQVFw= -github.com/digitalocean/godo v1.35.1/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= +github.com/digitalocean/godo v1.57.0 h1:uCpe0sRIZ/sJWxWDsJyBPBjUfSvxop+WHkHiSf+tjjM= +github.com/digitalocean/godo v1.57.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= @@ -300,6 +306,8 @@ github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= @@ -309,6 +317,8 @@ github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.10 h1:FEv6Pt/V4wLwP4vOCZbWlpfmi8kj4UiRip34IDE6SGw= github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= +github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= +github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= @@ -490,6 +500,8 @@ github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+a github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= +github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= @@ -559,6 +571,8 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1 github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/heroku/heroku-go/v5 v5.1.0 h1:3Qx1MxjzczSakhAZN4yRsvCI7kP0ldijK1XvfoYa4DE= github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZOdlm26Sr73U= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= @@ -699,6 +713,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -719,6 +735,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -741,6 +758,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -748,6 +767,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -757,6 +778,7 @@ github.com/paultyng/go-newrelic/v4 v4.10.0/go.mod h1:RmSnSvZnV267IBAqv2/2RACv1YV github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= @@ -901,6 +923,8 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= +go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1035,6 +1059,8 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/Lt golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1120,6 +1146,8 @@ golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091 h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1209,6 +1237,8 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfS golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2 h1:vEtypaVub6UvKkiXZ2xx9QIvp9TL7sI7xp7vdi2kezA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -1378,8 +1408,12 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From b5d22a25b79d1c1de310f1d26220c277f8a8e286 Mon Sep 17 00:00:00 2001 From: oliverpei Date: Wed, 10 Feb 2021 09:59:36 +0800 Subject: [PATCH 079/276] fix lint issue --- providers/tencentcloud/tencentcloud_provider.go | 2 +- providers/tencentcloud/tencentcloud_service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/tencentcloud/tencentcloud_provider.go b/providers/tencentcloud/tencentcloud_provider.go index e799bf213c..e67c14b00c 100755 --- a/providers/tencentcloud/tencentcloud_provider.go +++ b/providers/tencentcloud/tencentcloud_provider.go @@ -24,7 +24,7 @@ import ( "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" ) -type TencentCloudProvider struct { +type TencentCloudProvider struct { //nolint terraformutils.Provider region string credential common.Credential diff --git a/providers/tencentcloud/tencentcloud_service.go b/providers/tencentcloud/tencentcloud_service.go index 0a47a4dd59..0ee08c22a0 100755 --- a/providers/tencentcloud/tencentcloud_service.go +++ b/providers/tencentcloud/tencentcloud_service.go @@ -16,6 +16,6 @@ package tencentcloud import "github.com/GoogleCloudPlatform/terraformer/terraformutils" -type TencentCloudService struct { +type TencentCloudService struct { //nolint terraformutils.Service } From b82b05d3fb304c4bca5e4f09ef04dd449df89731 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Feb 2021 07:19:13 +0000 Subject: [PATCH 080/276] Bump github.com/zclconf/go-cty from 1.7.0 to 1.7.1 Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.7.0 to 1.7.1. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.7.0...v1.7.1) Signed-off-by: dependabot[bot] --- go.mod | 11 ++++++++--- go.sum | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 1dc0c964c9..b30078ec53 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 - github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 + github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 github.com/IBM/ibm-cos-sdk-go v1.5.0 @@ -20,14 +20,16 @@ require ( github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible + github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 github.com/aws/aws-sdk-go v1.36.19 github.com/aws/aws-sdk-go-v2 v0.24.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 + github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/digitalocean/godo v1.35.1 + github.com/digitalocean/godo v1.57.0 github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/fastly/go-fastly v1.18.0 github.com/google/go-github/v25 v25.1.3 @@ -38,6 +40,7 @@ require ( github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.29 github.com/heroku/heroku-go/v5 v5.1.0 + github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 @@ -49,10 +52,12 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 + github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible + github.com/tencentyun/cos-go-sdk-v5 v0.7.19 github.com/vultr/govultr v0.5.0 github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 - github.com/zclconf/go-cty v1.7.0 + github.com/zclconf/go-cty v1.7.1 github.com/zorkian/go-datadog-api v2.30.0+incompatible golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 golang.org/x/text v0.3.4 diff --git a/go.sum b/go.sum index 5008d815f5..bb7ce3b79e 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9Qp github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= github.com/DataDog/datadog-go v3.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9 h1:CQEiiiSY2KD3U3WnBpYo6Bh6/VD6+LlL6+Hd3AH+utY= -github.com/IBM-Cloud/bluemix-go v0.0.0-20201210085054-cdf09378fdd9/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0= +github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 h1:sUpBb2/GC8L6UOKDnbEZLRTxQB2RQgMv1mxbnOHOQW4= +github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY= github.com/IBM/go-sdk-core/v3 v3.3.1 h1:DoXjP1+Wm8Yd4XJsvBMRcYLvQwSLFnzKlMjSrg3Rzpw= @@ -155,6 +155,8 @@ github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDM github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= +github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= +github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -174,6 +176,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -212,6 +216,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= +github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuijfIjZyjZaHq9xDUh0tNitwXshJpbLkqMOJv4H3do= +github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -245,8 +251,8 @@ github.com/dghubble/sling v1.1.0/go.mod h1:ZcPRuLm0qrcULW2gOrjXrAWgf76sahqSyxXyV github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.35.1 h1:3P5timR4LTqcCafzrCgV2j83ck4aWb937ybFC7YQVFw= -github.com/digitalocean/godo v1.35.1/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= +github.com/digitalocean/godo v1.57.0 h1:uCpe0sRIZ/sJWxWDsJyBPBjUfSvxop+WHkHiSf+tjjM= +github.com/digitalocean/godo v1.57.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= @@ -300,6 +306,8 @@ github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= @@ -309,6 +317,8 @@ github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.10 h1:FEv6Pt/V4wLwP4vOCZbWlpfmi8kj4UiRip34IDE6SGw= github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= +github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= +github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= @@ -561,6 +571,8 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1 github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/heroku/heroku-go/v5 v5.1.0 h1:3Qx1MxjzczSakhAZN4yRsvCI7kP0ldijK1XvfoYa4DE= github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZOdlm26Sr73U= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= @@ -701,6 +713,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -713,6 +727,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 h1:TLDEP4t/KAbbIBVqMQlmf0MaLBm0eMAGHKtrOFNGHUM= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409/go.mod h1:q1krA85sGCNuxTOIcH9WSFf4nEO7he+IDDf5SW+xs1s= @@ -721,6 +736,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -743,6 +759,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -750,6 +768,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -759,6 +779,7 @@ github.com/paultyng/go-newrelic/v4 v4.10.0/go.mod h1:RmSnSvZnV267IBAqv2/2RACv1YV github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= @@ -847,8 +868,13 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= +github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible h1:5Td2b0yfaOvw9M9nZ5Oav6Li9bxUNxt4DgxMfIPpsa0= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= +github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible h1:q+D/Y9jla3afgsIihtyhwyl0c2W+eRWNM9ohVwPiiPw= +github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= +github.com/tencentyun/cos-go-sdk-v5 v0.7.19 h1:janAfTO4MglOrUFuKGTQJBuMc66+F7TgtEIt1wPsJ+k= +github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -892,8 +918,8 @@ github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.7.0 h1:yMqLinUwNCYkmiHjEH+luio1yGl35cjqVzjvdRg2WlY= -github.com/zclconf/go-cty v1.7.0/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= +github.com/zclconf/go-cty v1.7.1 h1:AvsC01GMhMLFL8CgEYdHGM+yLnnDOwhPAYcgTkeF0Gw= +github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a/go.mod h1:ofmGw6LrMypycsiWcyug6516EXpIxSbZ+uI9ppGypfY= @@ -903,6 +929,8 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= +go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1037,6 +1065,8 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/Lt golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1122,6 +1152,8 @@ golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091 h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1211,6 +1243,8 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfS golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2 h1:vEtypaVub6UvKkiXZ2xx9QIvp9TL7sI7xp7vdi2kezA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -1380,8 +1414,12 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From b4d76df83f7b978baf5db25d6064b75af146e0c8 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Fri, 12 Feb 2021 00:03:51 +0800 Subject: [PATCH 081/276] #756 added support for a field only filtering --- README.md | 12 ++++++++++++ go.sum | 32 ++++++++++++++++++++++++++++++++ terraformutils/resource.go | 7 +++++++ terraformutils/service.go | 10 +++++++--- terraformutils/service_test.go | 28 ++++++++++++++++++++++++++++ terraformutils/walk.go | 29 +++++++++++++++++++---------- terraformutils/walk_test.go | 20 ++++++++++++++++++++ 7 files changed, 125 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 79782aa891..7ccd59bd8a 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,18 @@ terraformer import aws --resources=vpc,subnet --filter=vpc=myvpcid --regions=eu- ``` Will only import the vpc with id `myvpcid`. This form of filters can help when it's necessary to select resources by its identifiers. +##### Field name only + +It is possible to filter by specific field name only. It can be used e.g. when you want to retrieve resources only with a specific tag key. + +Example usage: + +``` +terraformer import aws --resources=s3 --filter="Name=tags.Abc" --regions=eu-west-1 +``` +Will only import the s3 resources that have tag `Abc`. This form of filters can help when the field values are not important from filtering perspective. + + #### Planning The `plan` command generates a planfile that contains all the resources set to be imported. By modifying the planfile before running the `import` command, you can rename or filter the resources you'd like to import. diff --git a/go.sum b/go.sum index a1a7fc6d5f..51c4db56b0 100644 --- a/go.sum +++ b/go.sum @@ -100,10 +100,12 @@ github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VY github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9QpaFc/z2k0mcs7ZVnCRREeZU= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= @@ -133,6 +135,7 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -150,6 +153,7 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 h1:oUQYOKpPm4h7shYEdPJ0T8EzVpu7Zz34qTof9XaMDxY= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295/go.mod h1:mNZkuqaeM5UCiAdkV4r+lrheu8Q5fe/487bRFrGYZ8A= +github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70 h1:FrF4uxA24DF3ARNXVbUin3wa5fDLaB1Cy8mKks/LRz4= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= @@ -168,6 +172,7 @@ github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbj github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -211,6 +216,7 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -223,9 +229,11 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -262,6 +270,7 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 h1:Od9CDqwkw5F3vjN8Lp8CQhkMOEjC70eTW+AJlTepE6g= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884/go.mod h1:SB2lZXXkyipTEoPLxR3A5YglkZ7QwoXSsyI9h6yUeFc= +github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -466,6 +475,7 @@ github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3i github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.13.0 h1:1XkslZZRm6Ks0bLup+hBNth+KQf+0JA1UeoB7YKw9E8= github.com/gophercloud/gophercloud v0.13.0/go.mod h1:VX0Ibx85B60B5XOrZr6kaNwrmPUzcmMpwxvQ1WQIIWM= +github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01 h1:OgCNGSnEalfkRpn//WGJHhpo7fkP+LhTpvEITZ7CkK4= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -478,8 +488,11 @@ github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/hashicorp/aws-sdk-go-base v0.4.0 h1:zH9hNUdsS+2G0zJaU85ul8D59BGnZBaKM+KMNPAHGwk= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= +github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089 h1:1eDpXAxTh0iPv+1kc9/gfSI2pxRERDsTk/lNGolwHn8= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= +github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -519,13 +532,16 @@ github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6 github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-slug v0.4.1 h1:/jAo8dNuLgSImoLXaX7Od7QB4TfYCVPam+OpAt5bZqc= github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-tfe v0.8.1 h1:J6ulpLaKPHrcnwudRjxvlMYIGzqQFlnPhg3SVFh5N4E= github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnOn8E8stHc= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= @@ -604,6 +620,7 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= github.com/jonboydell/logzio_client v1.2.0/go.mod h1:ZXJYF4M9/chuG+4fQDS9BN6CqXqokUjtQOjdMqzGC/Y= github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7/go.mod h1:t4Tr0tn92eq5ISef4cS5plFAMYAqZlAXtgUcKE6y8nw= +github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 h1:kie3qOosvRKqwij2HGzXWffwpXvcqfPPXRUw8I4F/mg= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -618,6 +635,7 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -649,16 +667,19 @@ github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= +github.com/likexian/gokit v0.20.15 h1:DgtIqqTRFqtbiLJFzuRESwVrxWxfs8OlY6hnPYBa3BM= github.com/likexian/gokit v0.20.15/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= github.com/linode/linodego v0.24.1 h1:3s7/F54z9XZfefzrFqnHMD9DIEYVyOddPm+gyTEFFzc= github.com/linode/linodego v0.24.1/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= +github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82 h1:wnfcqULT+N2seWf6y4yHzmi7GD2kNx4Ute0qArktD48= github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -666,7 +687,9 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9 h1:SmVbOZFWAlyQshuMfOkiAx1f5oUTsOGG5IXplAEYeeM= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= +github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b h1:/1RFh2SLCJ+tEnT73+Fh5R2AO89sQqs8ba7o+hx1G0Y= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -698,6 +721,7 @@ github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFW github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb h1:GRiLv4rgyqjqzxbhJke65IYUf4NCOOvrPOJbV/sPxkM= github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= @@ -715,6 +739,7 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/panicwrap v1.0.0 h1:67zIyVakCIvcs69A0FGfZjBdPleaonSgGlXRSRlb6fE= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -743,6 +768,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836/go.mod h1:6Q8/OMaaKAgTX7/jt2bOXVDrm1eJhoNd+iwzghR7jvs= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -772,6 +798,7 @@ github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paultyng/go-newrelic/v4 v4.10.0 h1:6R2aC3vONWnfxbW00nAYZ9YSj7nJ3IvQRw2rG5KGijY= @@ -785,6 +812,7 @@ github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -867,6 +895,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible h1:5Td2b0yfaOvw9M9nZ5Oav6Li9bxUNxt4DgxMfIPpsa0= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= @@ -875,6 +904,7 @@ github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible/go.mod h1:0PfY github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= github.com/tencentyun/cos-go-sdk-v5 v0.7.19 h1:janAfTO4MglOrUFuKGTQJBuMc66+F7TgtEIt1wPsJ+k= github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= +github.com/terraform-providers/terraform-provider-openstack v1.15.0 h1:adpjqej+F8BAX9dHmuPF47sUIkgifeqBu6p7iCsyj0Y= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -899,11 +929,13 @@ github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37w github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= +github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557 h1:Jpn2j6wHkC9wJv5iMfJhKqrZJx3TahFx+7sbZ7zQdxs= github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 h1:ujojfQqu+1XfDMOVzAcKIJ3pRSF5f3gAmVGxuLcFWn4= diff --git a/terraformutils/resource.go b/terraformutils/resource.go index fc7450546d..cc51d24c35 100644 --- a/terraformutils/resource.go +++ b/terraformutils/resource.go @@ -57,6 +57,13 @@ func (rf *ResourceFilter) Filter(resource Resource) bool { var vals []interface{} if rf.FieldPath == "id" { vals = []interface{}{resource.InstanceState.ID} + } else if rf.AcceptableValues == nil { + var hasField = WalkAndCheckField(rf.FieldPath, resource.InstanceState.Attributes) + if hasField { + return true + } else { + return WalkAndCheckField(rf.FieldPath, resource.Item) + } } else { vals = WalkAndGet(rf.FieldPath, resource.InstanceState.Attributes) if len(vals) == 0 { diff --git a/terraformutils/service.go b/terraformutils/service.go index 439e3f9fc5..0d7ac3a95d 100644 --- a/terraformutils/service.go +++ b/terraformutils/service.go @@ -71,7 +71,7 @@ func (s *Service) ParseFilters(rawFilters []string) { func (s *Service) ParseFilter(rawFilter string) []ResourceFilter { var filters []ResourceFilter - if len(strings.Split(rawFilter, "=")) == 2 { + if !strings.HasPrefix(rawFilter, "Name=") && len(strings.Split(rawFilter, "=")) == 2 { parts := strings.Split(rawFilter, "=") serviceName, resourcesID := parts[0], parts[1] filters = append(filters, ResourceFilter{ @@ -81,14 +81,18 @@ func (s *Service) ParseFilter(rawFilter string) []ResourceFilter { }) } else { parts := strings.Split(rawFilter, ";") - if len(parts) != 2 && len(parts) != 3 { + if !((len(parts) == 1 && strings.HasPrefix(rawFilter, "Name=")) || len(parts) == 2 || len(parts) == 3) { log.Print("Invalid filter: " + rawFilter) return filters } var ServiceNamePart string var FieldPathPart string var AcceptableValuesPart string - if len(parts) == 2 { + if len(parts) == 1 { + ServiceNamePart = "" + FieldPathPart = parts[0] + AcceptableValuesPart = "" + } else if len(parts) == 2 { ServiceNamePart = "" FieldPathPart = parts[0] AcceptableValuesPart = parts[1] diff --git a/terraformutils/service_test.go b/terraformutils/service_test.go index 25b4f781c0..1f76663ea4 100644 --- a/terraformutils/service_test.go +++ b/terraformutils/service_test.go @@ -109,3 +109,31 @@ func TestServiceAttributeCleanupWithFilter(t *testing.T) { t.Errorf("failed to cleanup") } } + +func TestServiceAttributeNameOnlyCleanupWithFilter(t *testing.T) { + service := Service{ + Resources: []Resource{ + { + InstanceInfo: &terraform.InstanceInfo{ + Type: "aws_vpc", + }, + InstanceState: &terraform.InstanceState{ + ID: "vpc1", + }, + Item: mapI("tags", mapI("Abc", nil))}, + { + InstanceInfo: &terraform.InstanceInfo{ + Type: "aws_vpc", + }, + InstanceState: &terraform.InstanceState{ + ID: "vpc2", + }, + Item: mapI("tags", mapI("Name", "default"))}}, + } + service.ParseFilters([]string{"Name=tags.Abc"}) + service.PostRefreshCleanup() + + if !reflect.DeepEqual(len(service.Resources), 1) { + t.Errorf("failed to cleanup") + } +} diff --git a/terraformutils/walk.go b/terraformutils/walk.go index 4b162c4f82..f619c7a5fa 100644 --- a/terraformutils/walk.go +++ b/terraformutils/walk.go @@ -21,7 +21,13 @@ import ( func WalkAndGet(path string, data interface{}) []interface{} { pathSegments := strings.Split(path, ".") - return walkAndGet(pathSegments, data) + _, values := walkAndGet(pathSegments, data) + return values +} +func WalkAndCheckField(path string, data interface{}) bool { + pathSegments := strings.Split(path, ".") + hasField, _ := walkAndGet(pathSegments, data) + return hasField } func WalkAndOverride(path, oldValue, newValue string, data interface{}) { @@ -29,15 +35,18 @@ func WalkAndOverride(path, oldValue, newValue string, data interface{}) { walkAndOverride(pathSegments, oldValue, newValue, data) } -func walkAndGet(pathSegments []string, data interface{}) []interface{} { +func walkAndGet(pathSegments []string, data interface{}) (bool, []interface{}) { val := reflect.ValueOf(data) switch { case isArray(val.Interface()): var arrayValues []interface{} for i := 0; i < val.Len(); i++ { - arrayValues = append(arrayValues, walkAndGet(pathSegments, val.Index(i).Interface())...) + foundField, fieldValue := walkAndGet(pathSegments, val.Index(i).Interface()) + if foundField { + arrayValues = append(arrayValues, fieldValue...) + } } - return arrayValues + return len(arrayValues) > 0, arrayValues case len(pathSegments) == 1: if val.Kind() == reflect.Map { for _, e := range val.MapKeys() { @@ -45,16 +54,16 @@ func walkAndGet(pathSegments []string, data interface{}) []interface{} { if e.String() == pathSegments[0] { switch { case isArray(v.Interface()): - return v.Interface().([]interface{}) + return true, v.Interface().([]interface{}) case isStringArray(v.Interface()): - return v.Interface().([]interface{}) + return true, v.Interface().([]interface{}) default: - return []interface{}{v.Interface()} + return true, []interface{}{v.Interface()} } } } } - return []interface{}{} + return false, []interface{}{} default: if val.Kind() == reflect.Map { for _, e := range val.MapKeys() { @@ -63,9 +72,9 @@ func walkAndGet(pathSegments []string, data interface{}) []interface{} { return walkAndGet(pathSegments[1:], v.Interface()) } } - return []interface{}{} + return false, []interface{}{} } - return []interface{}{} + return false, []interface{}{} } } diff --git a/terraformutils/walk_test.go b/terraformutils/walk_test.go index 0d8b32d0fe..ed30110e64 100644 --- a/terraformutils/walk_test.go +++ b/terraformutils/walk_test.go @@ -148,3 +148,23 @@ func TestNestedArrayWalkAndOverride(t *testing.T) { t.Errorf("failed to set value") } } + +func TestEmptyWalkAndCheckField(t *testing.T) { + structure := map[string]interface{}{} + value := WalkAndCheckField("attr1", structure) + + if !reflect.DeepEqual(value, false) { + t.Errorf("failed to get value %v", value) + } +} + +func TestSimpleWalkAndCheckField(t *testing.T) { + structure := map[string]interface{}{ + "attr1": "value", + } + value := WalkAndCheckField("attr1", structure) + + if !reflect.DeepEqual(value, true) { + t.Errorf("failed to get value %v", value) + } +} From cfb7d1a61daae1296d12a7ddca267ef34abc28da Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Fri, 12 Feb 2021 11:38:48 +0800 Subject: [PATCH 082/276] #715 fixed EC2 IOPS and throughput configuration --- providers/aws/ec2.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/providers/aws/ec2.go b/providers/aws/ec2.go index 3370250e5b..7e970aa565 100644 --- a/providers/aws/ec2.go +++ b/providers/aws/ec2.go @@ -83,3 +83,20 @@ func (g *Ec2Generator) InitResources() error { } return p.Err() } + +func (g *Ec2Generator) PostConvertHook() error { + for _, r := range g.Resources { + if r.InstanceInfo.Type != "aws_instance" { + continue + } + rootDeviceVolumeType := r.InstanceState.Attributes["root_block_device.0.volume_type"] + if !(rootDeviceVolumeType == "io1" || rootDeviceVolumeType == "io2" || rootDeviceVolumeType == "gp3") { + delete(r.Item["root_block_device"].([]interface{})[0].(map[string]interface{}), "iops") + } + if rootDeviceVolumeType != "gp3" { + delete(r.Item["root_block_device"].([]interface{})[0].(map[string]interface{}), "throughput") + } + } + + return nil +} From ca93d34db01c01154bf59484308046874ab37076 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 14 Feb 2021 16:48:10 +0800 Subject: [PATCH 083/276] #716 added support for dots in filter names --- README.md | 10 +++++++ terraformutils/walk.go | 60 +++++++++++++++++-------------------- terraformutils/walk_test.go | 13 ++++++++ 3 files changed, 51 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 7ccd59bd8a..57a27f305c 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,16 @@ terraformer import aws --resources=s3 --filter="Name=tags.Abc" --regions=eu-west ``` Will only import the s3 resources that have tag `Abc`. This form of filters can help when the field values are not important from filtering perspective. +##### Field with dots + +It is possible to filter by a field that contains a dot. + +Example usage: + +``` +terraformer import aws --resources=s3 --filter="Name=tags.Abc.def" --regions=eu-west-1 +``` +Will only import the s3 resources that have tag `Abc.def`. #### Planning diff --git a/terraformutils/walk.go b/terraformutils/walk.go index f619c7a5fa..106b56b86d 100644 --- a/terraformutils/walk.go +++ b/terraformutils/walk.go @@ -20,13 +20,11 @@ import ( ) func WalkAndGet(path string, data interface{}) []interface{} { - pathSegments := strings.Split(path, ".") - _, values := walkAndGet(pathSegments, data) + _, values := walkAndGet(path, data) return values } func WalkAndCheckField(path string, data interface{}) bool { - pathSegments := strings.Split(path, ".") - hasField, _ := walkAndGet(pathSegments, data) + hasField, _ := walkAndGet(path, data) return hasField } @@ -35,47 +33,45 @@ func WalkAndOverride(path, oldValue, newValue string, data interface{}) { walkAndOverride(pathSegments, oldValue, newValue, data) } -func walkAndGet(pathSegments []string, data interface{}) (bool, []interface{}) { +func walkAndGet(path string, data interface{}) (bool, []interface{}) { val := reflect.ValueOf(data) - switch { - case isArray(val.Interface()): + + if isArray(val.Interface()) { var arrayValues []interface{} for i := 0; i < val.Len(); i++ { - foundField, fieldValue := walkAndGet(pathSegments, val.Index(i).Interface()) + foundField, fieldValue := walkAndGet(path, val.Index(i).Interface()) if foundField { arrayValues = append(arrayValues, fieldValue...) } } return len(arrayValues) > 0, arrayValues - case len(pathSegments) == 1: - if val.Kind() == reflect.Map { - for _, e := range val.MapKeys() { - v := val.MapIndex(e) - if e.String() == pathSegments[0] { - switch { - case isArray(v.Interface()): - return true, v.Interface().([]interface{}) - case isStringArray(v.Interface()): - return true, v.Interface().([]interface{}) - default: - return true, []interface{}{v.Interface()} - } + } + + if val.Kind() == reflect.Map { + for _, e := range val.MapKeys() { + v := val.MapIndex(e) + pathFirstElement := strings.SplitN(path, ".", 2) + if e.String() == pathFirstElement[0] { + var pathReminder = "" + if len(pathFirstElement) > 1 { + pathReminder = pathFirstElement[1] } - } - } - return false, []interface{}{} - default: - if val.Kind() == reflect.Map { - for _, e := range val.MapKeys() { - v := val.MapIndex(e) - if e.String() == pathSegments[0] { - return walkAndGet(pathSegments[1:], v.Interface()) + hasField, value := walkAndGet(pathReminder, v.Interface()) + if !hasField { + hasField, value = walkAndGet(path, v.Interface()) } + return hasField, value + } else if e.String() == path { + return walkAndGet("", v.Interface()) } - return false, []interface{}{} } - return false, []interface{}{} } + + if val.Kind() == reflect.String && path == "" { + return true, []interface{}{val.Interface()} + } + + return false, []interface{}{} } func walkAndOverride(pathSegments []string, oldValue, newValue string, data interface{}) { diff --git a/terraformutils/walk_test.go b/terraformutils/walk_test.go index ed30110e64..0f39eb8d46 100644 --- a/terraformutils/walk_test.go +++ b/terraformutils/walk_test.go @@ -58,6 +58,19 @@ func TestNestedWalkAndGet(t *testing.T) { } } +func TestNestedWalkWithDotInKeyAndGet(t *testing.T) { + structure := map[string]map[string]interface{}{ + "attr1": { + "attr2.attr3": "value", + }, + } + value := WalkAndGet("attr1.attr2.attr3", structure) + + if !reflect.DeepEqual(value, []interface{}{"value"}) { + t.Errorf("failed to get value %v", value) + } +} + func TestNestedArrayWalkAndGet(t *testing.T) { structure := mapI("attr1", []interface{}{ mapI("attr2", "value1"), From ccfc7923da9356ee98a4da260404870c51666576 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 14 Feb 2021 17:16:45 +0800 Subject: [PATCH 084/276] #756 fix name only filtering --- terraformutils/walk.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/terraformutils/walk.go b/terraformutils/walk.go index 106b56b86d..a95a94d1ca 100644 --- a/terraformutils/walk.go +++ b/terraformutils/walk.go @@ -36,6 +36,14 @@ func WalkAndOverride(path, oldValue, newValue string, data interface{}) { func walkAndGet(path string, data interface{}) (bool, []interface{}) { val := reflect.ValueOf(data) + if data == nil { + if path == "" { + return true, []interface{}{} + } else { + return false, []interface{}{} + } + } + if isArray(val.Interface()) { var arrayValues []interface{} for i := 0; i < val.Len(); i++ { From a71d641a11e040e2cbaca992676bf95b50fba684 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 14 Feb 2021 18:08:06 +0800 Subject: [PATCH 085/276] #756 inlined Bucket Policy --- providers/aws/s3.go | 63 ++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 43 deletions(-) diff --git a/providers/aws/s3.go b/providers/aws/s3.go index 684818221a..ebff73571f 100644 --- a/providers/aws/s3.go +++ b/providers/aws/s3.go @@ -51,37 +51,31 @@ func (g *S3Generator) createResources(config aws.Config, buckets *s3.ListBuckets // check if bucket in region constraintString, _ := s3.NormalizeBucketLocation(location.LocationConstraint).MarshalValue() if constraintString == region { - resources = append(resources, terraformutils.NewResource( - resourceName, - resourceName, - "aws_s3_bucket", - "aws", - map[string]string{ - "force_destroy": "false", - "acl": "private", - }, - S3AllowEmptyValues, - S3AdditionalFields)) + attributes := map[string]string{ + "force_destroy": "false", + "acl": "private", + } // try get policy - _, err := svc.GetBucketPolicyRequest(&s3.GetBucketPolicyInput{ + policy, err := svc.GetBucketPolicyRequest(&s3.GetBucketPolicyInput{ Bucket: bucket.Name, }).Send(context.Background()) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucketPolicy" { - // Bucket without policy + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() != "NoSuchBucketPolicy" { + log.Println(err) continue } - log.Println(err) - continue + } else { + attributes["policy"] = *policy.Policy } - // if bucket policy exist create TerraformResource with bucket name as ID - resources = append(resources, terraformutils.NewSimpleResource( + resources = append(resources, terraformutils.NewResource( resourceName, resourceName, - "aws_s3_bucket_policy", + "aws_s3_bucket", "aws", - S3AllowEmptyValues)) + attributes, + S3AllowEmptyValues, + S3AdditionalFields)) } } return resources @@ -109,33 +103,16 @@ func (g *S3Generator) InitResources() error { // support only bucket with policy func (g *S3Generator) PostConvertHook() error { for i, resource := range g.Resources { - if resource.InstanceInfo.Type == "aws_s3_bucket_policy" { - policy := g.escapeAwsInterpolation(resource.Item["policy"].(string)) - g.Resources[i].Item["policy"] = fmt.Sprintf(`< Date: Mon, 15 Feb 2021 23:44:53 +0800 Subject: [PATCH 086/276] fixed linting issues --- terraformutils/resource.go | 3 +-- terraformutils/service.go | 7 ++++--- terraformutils/walk.go | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/terraformutils/resource.go b/terraformutils/resource.go index cc51d24c35..b6c1d4a803 100644 --- a/terraformutils/resource.go +++ b/terraformutils/resource.go @@ -61,9 +61,8 @@ func (rf *ResourceFilter) Filter(resource Resource) bool { var hasField = WalkAndCheckField(rf.FieldPath, resource.InstanceState.Attributes) if hasField { return true - } else { - return WalkAndCheckField(rf.FieldPath, resource.Item) } + return WalkAndCheckField(rf.FieldPath, resource.Item) } else { vals = WalkAndGet(rf.FieldPath, resource.InstanceState.Attributes) if len(vals) == 0 { diff --git a/terraformutils/service.go b/terraformutils/service.go index 0d7ac3a95d..afcb5c9ada 100644 --- a/terraformutils/service.go +++ b/terraformutils/service.go @@ -88,15 +88,16 @@ func (s *Service) ParseFilter(rawFilter string) []ResourceFilter { var ServiceNamePart string var FieldPathPart string var AcceptableValuesPart string - if len(parts) == 1 { + switch len(parts) { + case 1: ServiceNamePart = "" FieldPathPart = parts[0] AcceptableValuesPart = "" - } else if len(parts) == 2 { + case 2: ServiceNamePart = "" FieldPathPart = parts[0] AcceptableValuesPart = parts[1] - } else { + default: ServiceNamePart = strings.TrimPrefix(parts[0], "Type=") FieldPathPart = parts[1] AcceptableValuesPart = parts[2] diff --git a/terraformutils/walk.go b/terraformutils/walk.go index a95a94d1ca..214262e557 100644 --- a/terraformutils/walk.go +++ b/terraformutils/walk.go @@ -39,9 +39,8 @@ func walkAndGet(path string, data interface{}) (bool, []interface{}) { if data == nil { if path == "" { return true, []interface{}{} - } else { - return false, []interface{}{} } + return false, []interface{}{} } if isArray(val.Interface()) { From 1c7d345b2f376a794de8df034797106f7acc020a Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 16 Feb 2021 21:37:36 -0500 Subject: [PATCH 087/276] chore: bump go to v1.16 Signed-off-by: Rui Chen --- .github/workflows/test.yml | 8 +-- go.mod | 2 +- go.sum | 130 ------------------------------------- 3 files changed, 4 insertions(+), 136 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f44ad29526..e637f55edd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,15 +12,13 @@ jobs: test: strategy: matrix: - go-version: [1.15.x] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: + - uses: actions/checkout@v2 - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.14 - - name: Checkout code - uses: actions/checkout@v2 + go-version: 1.16 - name: Test - run: go build -v && go test ./... \ No newline at end of file + run: go build -v && go test ./... diff --git a/go.mod b/go.mod index b30078ec53..9da99c7c5b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/terraformer -go 1.15 +go 1.16 require ( cloud.google.com/go v0.74.0 diff --git a/go.sum b/go.sum index 7a4b665265..b2bc5583ab 100644 --- a/go.sum +++ b/go.sum @@ -11,42 +11,33 @@ cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6T cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0 h1:WRz29PgAsVEyPSDHyk+0fpEkwEFyfhHn+JbksT6gIL4= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.66.0 h1:DZeAkuQGQqnm9Xv36SbMJEU8aFBz4wL04UpMWPWwjzg= cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= -cloud.google.com/go v0.71.0 h1:2ha722Z08cmRa0orJrzBaszYQcLbLFcsZHsGSj/kIF4= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= -cloud.google.com/go v0.72.0 h1:eWRCuwubtDrCJG0oSUMgnsbD4CmPFQF2ei4OFbXvwww= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0 h1:kpgPA77kSSbjSs+fWHkPTxQ6J5Z2Qkruo5jfXEkHxNQ= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/logging v1.1.2 h1:KNALX0NZn8UJhqKnqoHxhMqyoZfBZoh5wF7CQJZ5XrU= cloud.google.com/go/logging v1.1.2/go.mod h1:KrljuAHIw631j9+QXsnq9vDwsrwmdxfGpivMR68M7DY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0 h1:86K1Gel7BQ9/WmNWn7dTKMvTLFzwtBe5FNqYbi9X35g= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.12.0 h1:4y3gHptW1EHVtcPAVE0eBBlFuGqEejTTG3KdIE0lUX4= @@ -69,7 +60,6 @@ github.com/Azure/go-autorest/autorest v0.11.12 h1:gI8ytXbxMfI+IVbI9mP2JGCTXIuhHL github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.3 h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw= github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= @@ -77,13 +67,11 @@ github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyC github.com/Azure/go-autorest/autorest/azure/cli v0.2.0 h1:pSwNMF0qotgehbQNllUWwJ4V3vnrLKOzHrwDLEZK904= github.com/Azure/go-autorest/autorest/azure/cli v0.2.0/go.mod h1:WWTbGPvkAg3I4ms2j2s+Zr5xCGwGqTQh+6M2ZqOczkE= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= @@ -92,20 +80,16 @@ github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yK github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= -github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9QpaFc/z2k0mcs7ZVnCRREeZU= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= @@ -135,7 +119,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= -github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -153,7 +136,6 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 h1:oUQYOKpPm4h7shYEdPJ0T8EzVpu7Zz34qTof9XaMDxY= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295/go.mod h1:mNZkuqaeM5UCiAdkV4r+lrheu8Q5fe/487bRFrGYZ8A= -github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70 h1:FrF4uxA24DF3ARNXVbUin3wa5fDLaB1Cy8mKks/LRz4= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= @@ -172,14 +154,12 @@ github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbj github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= @@ -188,7 +168,6 @@ github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3A github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA= github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= @@ -216,7 +195,6 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -229,11 +207,9 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -270,7 +246,6 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 h1:Od9CDqwkw5F3vjN8Lp8CQhkMOEjC70eTW+AJlTepE6g= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884/go.mod h1:SB2lZXXkyipTEoPLxR3A5YglkZ7QwoXSsyI9h6yUeFc= -github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -300,7 +275,6 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj9zFpCNE+UDefwwFRijKjzvHNCM= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655 h1:hKQ7ba/nVgQ0sGq8KBWJ7hdm0CEN48AlIYjBmfzCQzQ= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= @@ -313,7 +287,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= @@ -324,17 +297,14 @@ github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL9 github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.10 h1:FEv6Pt/V4wLwP4vOCZbWlpfmi8kj4UiRip34IDE6SGw= github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= @@ -394,7 +364,6 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= @@ -404,7 +373,6 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -412,7 +380,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= @@ -423,13 +390,10 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -438,7 +402,6 @@ github.com/google/go-github/v25 v25.1.3/go.mod h1:6z5pC69qHtrPJ0sXPsj4BLnd82b+r6 github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -446,7 +409,6 @@ github.com/google/jsonapi v0.0.0-20170708005851-46d3ced04344 h1:G5TmuUtIYeR0scfa github.com/google/jsonapi v0.0.0-20170708005851-46d3ced04344/go.mod h1:XSx4m2SziAqk9DXY9nz659easTq4q6TyrpYd9tHSm0g= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -463,7 +425,6 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -475,7 +436,6 @@ github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3i github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.13.0 h1:1XkslZZRm6Ks0bLup+hBNth+KQf+0JA1UeoB7YKw9E8= github.com/gophercloud/gophercloud v0.13.0/go.mod h1:VX0Ibx85B60B5XOrZr6kaNwrmPUzcmMpwxvQ1WQIIWM= -github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01 h1:OgCNGSnEalfkRpn//WGJHhpo7fkP+LhTpvEITZ7CkK4= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -488,11 +448,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= -github.com/hashicorp/aws-sdk-go-base v0.4.0 h1:zH9hNUdsS+2G0zJaU85ul8D59BGnZBaKM+KMNPAHGwk= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= -github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089 h1:1eDpXAxTh0iPv+1kc9/gfSI2pxRERDsTk/lNGolwHn8= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= -github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -511,7 +468,6 @@ github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7q github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= @@ -523,7 +479,6 @@ github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1: github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-plugin v1.3.0 h1:4d/wJojzvHV1I4i/rrjVaeuyxWrLzDE1mDCyDy8fXS8= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= @@ -532,16 +487,13 @@ github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6 github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-slug v0.4.1 h1:/jAo8dNuLgSImoLXaX7Od7QB4TfYCVPam+OpAt5bZqc= github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-tfe v0.8.1 h1:J6ulpLaKPHrcnwudRjxvlMYIGzqQFlnPhg3SVFh5N4E= github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnOn8E8stHc= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= @@ -607,7 +559,6 @@ github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZ github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -620,7 +571,6 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= github.com/jonboydell/logzio_client v1.2.0/go.mod h1:ZXJYF4M9/chuG+4fQDS9BN6CqXqokUjtQOjdMqzGC/Y= github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7/go.mod h1:t4Tr0tn92eq5ISef4cS5plFAMYAqZlAXtgUcKE6y8nw= -github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 h1:kie3qOosvRKqwij2HGzXWffwpXvcqfPPXRUw8I4F/mg= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -635,7 +585,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -649,14 +598,12 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91/go.mod h1:C2tFh8w3I6i4lnUJfoBx2Hwku3mgu4wPNTtUNp1i5KI= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -667,19 +614,16 @@ github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= -github.com/likexian/gokit v0.20.15 h1:DgtIqqTRFqtbiLJFzuRESwVrxWxfs8OlY6hnPYBa3BM= github.com/likexian/gokit v0.20.15/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= github.com/linode/linodego v0.24.1 h1:3s7/F54z9XZfefzrFqnHMD9DIEYVyOddPm+gyTEFFzc= github.com/linode/linodego v0.24.1/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= -github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82 h1:wnfcqULT+N2seWf6y4yHzmi7GD2kNx4Ute0qArktD48= github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -687,9 +631,7 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9 h1:SmVbOZFWAlyQshuMfOkiAx1f5oUTsOGG5IXplAEYeeM= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b h1:/1RFh2SLCJ+tEnT73+Fh5R2AO89sQqs8ba7o+hx1G0Y= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -721,7 +663,6 @@ github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFW github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb h1:GRiLv4rgyqjqzxbhJke65IYUf4NCOOvrPOJbV/sPxkM= github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= @@ -735,11 +676,9 @@ github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1D github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/panicwrap v1.0.0 h1:67zIyVakCIvcs69A0FGfZjBdPleaonSgGlXRSRlb6fE= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -759,7 +698,6 @@ github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= @@ -768,7 +706,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836/go.mod h1:6Q8/OMaaKAgTX7/jt2bOXVDrm1eJhoNd+iwzghR7jvs= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -783,7 +720,6 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= @@ -792,13 +728,10 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paultyng/go-newrelic/v4 v4.10.0 h1:6R2aC3vONWnfxbW00nAYZ9YSj7nJ3IvQRw2rG5KGijY= @@ -812,7 +745,6 @@ github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -883,28 +815,23 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= -github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible h1:5Td2b0yfaOvw9M9nZ5Oav6Li9bxUNxt4DgxMfIPpsa0= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible h1:q+D/Y9jla3afgsIihtyhwyl0c2W+eRWNM9ohVwPiiPw= github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= github.com/tencentyun/cos-go-sdk-v5 v0.7.19 h1:janAfTO4MglOrUFuKGTQJBuMc66+F7TgtEIt1wPsJ+k= github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= -github.com/terraform-providers/terraform-provider-openstack v1.15.0 h1:adpjqej+F8BAX9dHmuPF47sUIkgifeqBu6p7iCsyj0Y= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -929,13 +856,11 @@ github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37w github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= -github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557 h1:Jpn2j6wHkC9wJv5iMfJhKqrZJx3TahFx+7sbZ7zQdxs= github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 h1:ujojfQqu+1XfDMOVzAcKIJ3pRSF5f3gAmVGxuLcFWn4= @@ -959,16 +884,13 @@ github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8 github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= @@ -993,9 +915,7 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1025,7 +945,6 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -1035,9 +954,7 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1079,23 +996,17 @@ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -1103,11 +1014,8 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 h1:Mj83v+wSRNEar42a/MQgxk9X42TdEmrOl9i+y8WbxLo= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -1118,9 +1026,7 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1165,24 +1071,19 @@ golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091 h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1190,16 +1091,13 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1252,7 +1150,6 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200501155019-2658dc0cadb5 h1:skr8G4q25c51+6Dl9dOaUHiRYj1JB4V7DXGIDYsKe7Q= golang.org/x/tools v0.0.0-20200501155019-2658dc0cadb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1265,21 +1162,16 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20200918232735-d647fc253266 h1:k7tVuG0g1JwmD3Jh8oAl1vQ1C3jb4Hi/dUl1wWDBJpQ= golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201030143252-cf7a54d06671/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201105220310-78b158585360 h1:/9CzsU8hOpnSUCtem1vfWNgsVeCTgkMdx+VE5YIYxnU= golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfSSmC/Hx/fGAQJUAQaM2gc= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2 h1:vEtypaVub6UvKkiXZ2xx9QIvp9TL7sI7xp7vdi2kezA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1300,18 +1192,14 @@ google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0 h1:J1Pl9P2lnmYFSJvgs70DKELqHNh8CNWXPbud4njEE2s= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0 h1:jMF5hhVfMkTZwHW1SDpKq5CkgWLXOb31Foaca9Zr3oM= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= -google.golang.org/api v0.32.0 h1:Le77IccnTqEa8ryp9wIpX5W3zYm7Gf9LhOp9PHcwFts= google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.35.0 h1:TBCmTTxUrRDA1iTctnK/fIeitxIZ+TQuaf0j29fmCGo= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0 h1:l2Nfbl2GPXdWorv+dT2XfinX2jOOw4zv1VhLstx+6rE= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= @@ -1319,9 +1207,7 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -1348,7 +1234,6 @@ google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200323114720-3f67cca34472/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84 h1:pSLkPbrjnPyLDYUO2VM9mDLqo2V6CFBY84lFSZAfoi4= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= @@ -1360,13 +1245,10 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5 h1:B9nroC8SSX5GtbVvxPF9tYIVkaCpjhVLOrlAY8ONzm8= google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba h1:HocWKLuilwaaLY56cHV38rw84wJ1nscA0Rs7OnO8mm8= google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e h1:wYR00/Ht+i/79g/gzhdehBgLIJCklKoc8Q/NebdzzpY= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc h1:BgQmMjmd7K1zov8j8lYULHW0WnmBGUIMp6+VDwlGErc= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1381,17 +1263,13 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= @@ -1412,7 +1290,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780/go.mod h1:3HH7i1SgMqlzxCcBmUHW657sD4Kvv9sC3HpL3YukzwA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1421,7 +1298,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.19.0 h1:PTE3gBwP61sZfxOsROkUZbXONv+7N5Mw1Et6S+4NGBA= gopkg.in/go-playground/validator.v9 v9.19.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= @@ -1430,7 +1306,6 @@ gopkg.in/h2non/gock.v1 v1.0.15 h1:SzLqcIlb/fDfg7UvukMpNcWsu7sI5tWwL+KCATZqks0= gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -1442,13 +1317,10 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -1459,7 +1331,6 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= @@ -1482,7 +1353,6 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 1515ee72aa318cacd33186acab1f38531d8c4137 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Feb 2021 07:24:42 +0000 Subject: [PATCH 088/276] Bump cloud.google.com/go from 0.74.0 to 0.77.0 Bumps [cloud.google.com/go](https://github.com/googleapis/google-cloud-go) from 0.74.0 to 0.77.0. - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/master/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/v0.74.0...v0.77.0) Signed-off-by: dependabot[bot] --- go.mod | 10 +++++----- go.sum | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 9da99c7c5b..e5a58a98b5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/GoogleCloudPlatform/terraformer go 1.16 require ( - cloud.google.com/go v0.74.0 + cloud.google.com/go v0.77.0 cloud.google.com/go/logging v1.1.2 cloud.google.com/go/storage v1.12.0 github.com/Azure/azure-sdk-for-go v42.3.0+incompatible @@ -59,11 +59,11 @@ require ( github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 github.com/zclconf/go-cty v1.7.1 github.com/zorkian/go-datadog-api v2.30.0+incompatible - golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 - golang.org/x/text v0.3.4 + golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 + golang.org/x/text v0.3.5 gonum.org/v1/gonum v0.7.0 - google.golang.org/api v0.36.0 - google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc + google.golang.org/api v0.40.0 + google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect k8s.io/apimachinery v0.20.2 k8s.io/client-go v0.20.2 diff --git a/go.sum b/go.sum index b2bc5583ab..5c15140f4a 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,8 @@ cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LV cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0 h1:kpgPA77kSSbjSs+fWHkPTxQ6J5Z2Qkruo5jfXEkHxNQ= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.77.0 h1:qA5V5+uQf6Mgr+tmFI8UT3D/ELyhIYkPwNGao/3Y+sQ= +cloud.google.com/go v0.77.0/go.mod h1:R8fYSLIilC247Iu8WS2OGHw1E/Ufn7Pd7HiDjTqiURs= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -204,6 +206,7 @@ github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuij github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -254,6 +257,7 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 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/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fastly/go-fastly v1.18.0 h1:fyVq/142VTFz5ZkNE5d57K+NkTmtwxt2K2Mh5sV5scg= @@ -275,6 +279,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj9zFpCNE+UDefwwFRijKjzvHNCM= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655 h1:hKQ7ba/nVgQ0sGq8KBWJ7hdm0CEN48AlIYjBmfzCQzQ= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= @@ -422,6 +427,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -698,6 +704,7 @@ github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= @@ -731,6 +738,7 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -958,6 +966,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1019,6 +1029,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 h1:BaN3BAqnopnKjvl+15DYP6LLrbBHfbfmlFYzmFj/Q9Q= +golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1030,6 +1042,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1085,8 +1099,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091 h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1095,6 +1113,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1170,6 +1190,9 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1203,6 +1226,8 @@ google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0 h1:l2Nfbl2GPXdWorv+dT2XfinX2jOOw4zv1VhLstx+6rE= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0 h1:uWrpz12dpVPn7cojP82mk02XDgTJLDPc2KbVTxrWb4A= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1252,6 +1277,9 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc h1:BgQmMjmd7K1zov8j8lYULHW0WnmBGUIMp6+VDwlGErc= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d h1:Edhcm0CKDPLQIecHCp5Iz57Lo7MfT6zUFBAlocmOjcY= +google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1273,6 +1301,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From c21c4730b63abaffe6ccf097fdccecc26e744abe Mon Sep 17 00:00:00 2001 From: wojciechpl Date: Wed, 17 Feb 2021 15:32:20 +0100 Subject: [PATCH 089/276] Update clouddns.go interpolation syntax is now deprecated in terraform --- providers/gcp/clouddns.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/gcp/clouddns.go b/providers/gcp/clouddns.go index 15ea2f86bc..4554349f91 100644 --- a/providers/gcp/clouddns.go +++ b/providers/gcp/clouddns.go @@ -116,10 +116,10 @@ func (g *CloudDNSGenerator) PostConvertHook() error { continue } if zoneID == resourceZone.InstanceState.ID { - g.Resources[i].Item["managed_zone"] = "${google_dns_managed_zone." + resourceZone.ResourceName + ".name}" + g.Resources[i].Item["managed_zone"] = "google_dns_managed_zone." + resourceZone.ResourceName + ".name" name := g.Resources[i].Item["name"].(string) name = strings.ReplaceAll(name, resourceZone.Item["dns_name"].(string), "") - g.Resources[i].Item["name"] = name + "${google_dns_managed_zone." + resourceZone.ResourceName + ".dns_name}" + g.Resources[i].Item["name"] = name + "google_dns_managed_zone." + resourceZone.ResourceName + ".dns_name" } } } From b1f9bd6cde58de80c8b3ffd5b21f8e8504497a53 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 18 Feb 2021 14:34:28 -0500 Subject: [PATCH 090/276] add pagination support for roles resource --- providers/datadog/role.go | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/providers/datadog/role.go b/providers/datadog/role.go index c3debee869..e49ccc5a3f 100644 --- a/providers/datadog/role.go +++ b/providers/datadog/role.go @@ -59,13 +59,26 @@ func (g *RoleGenerator) createResource(roleID string) terraformutils.Resource { // from each role create 1 TerraformResource. // Need Role ID as ID for terraform resource func (g *RoleGenerator) InitResources() error { - datadogClientV1 := g.Args["datadogClientV2"].(*datadogV2.APIClient) - authV1 := g.Args["authV2"].(context.Context) + datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) + authV2 := g.Args["authV2"].(context.Context) - roles, _, err := datadogClientV1.RolesApi.ListRoles(authV1).Execute() - if err != nil { - return err + pageSize := int64(100) + pageNumber := int64(0) + remaining := int64(1) + + var roles []datadogV2.Role + for remaining > int64(0) { + resp, _, err := datadogClientV2.RolesApi.ListRoles(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + if err != nil { + return err + } + roles = append(roles, resp.GetData()...) + + remaining = resp.Meta.Page.GetTotalCount() - pageSize*(pageNumber+1) + pageNumber++ } - g.Resources = g.createResources(roles.GetData()) + + g.Resources = g.createResources(roles) return nil + } From 0988e497d5e655d46949686748b29f51b25270f9 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 18 Feb 2021 14:38:08 -0500 Subject: [PATCH 091/276] lint --- providers/datadog/role.go | 1 - 1 file changed, 1 deletion(-) diff --git a/providers/datadog/role.go b/providers/datadog/role.go index e49ccc5a3f..9019cf4f1e 100644 --- a/providers/datadog/role.go +++ b/providers/datadog/role.go @@ -80,5 +80,4 @@ func (g *RoleGenerator) InitResources() error { g.Resources = g.createResources(roles) return nil - } From 746c3323d6e71d11add049927715c44ab76d202d Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 14:48:39 -0500 Subject: [PATCH 092/276] add pagerduty resources --- providers/datadog/datadog_provider.go | 2 + providers/datadog/integration_pagerduty.go | 79 +++++++++++++++++++ .../integration_pagerduty_service_object.go | 75 ++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 providers/datadog/integration_pagerduty.go create mode 100644 providers/datadog/integration_pagerduty_service_object.go diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 113543a7da..6b105a8f8a 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -194,6 +194,8 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "integration_aws_lambda_arn": &IntegrationAWSLambdaARNGenerator{}, "integration_aws_log_collection": &IntegrationAWSLogCollectionGenerator{}, "integration_azure": &IntegrationAzureGenerator{}, + "integration_pagerduty": &IntegrationPagerdutyGenerator{}, + "integration_pagerduty_service_object": &IntegrationPagerdutyServiceObjectGenerator{}, "integration_gcp": &IntegrationGCPGenerator{}, "metric_metadata": &MetricMetadataGenerator{}, "monitor": &MonitorGenerator{}, diff --git a/providers/datadog/integration_pagerduty.go b/providers/datadog/integration_pagerduty.go new file mode 100644 index 0000000000..ebe17c3458 --- /dev/null +++ b/providers/datadog/integration_pagerduty.go @@ -0,0 +1,79 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "fmt" + + datadogCommunity "github.com/zorkian/go-datadog-api" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationPagerdutyAllowEmptyValues ... + IntegrationPagerdutyAllowEmptyValues = []string{"tags."} +) + +// IntegrationPagerdutyGenerator ... +type IntegrationPagerdutyGenerator struct { + DatadogService +} + +func (g *IntegrationPagerdutyGenerator) createResources(pdSubdomain string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + resources = append(resources, g.createResource(pdSubdomain)) + + return resources +} + +func (g *IntegrationPagerdutyGenerator) createIntegrationPDServiceObjectResources(serviceNames []string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, serviceName := range serviceNames { + resources = append(resources, terraformutils.NewSimpleResource( + serviceName, + fmt.Sprintf("integration_pagerduty_service_object_%s", serviceName), + "datadog_integration_pagerduty_service_object", + "datadog", + []string{}, + )) + } + + return resources +} + +func (g *IntegrationPagerdutyGenerator) createResource(serviceName string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + serviceName, + fmt.Sprintf("integration_pagerduty_%s", serviceName), + "datadog_integration_pagerduty", + "datadog", + IntegrationPagerdutyAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from PD Service create 1 TerraformResource. +// Need IntegrationPagerduty Subdomain as ID for terraform resource +func (g *IntegrationPagerdutyGenerator) InitResources() error { + client := datadogCommunity.NewClient(g.Args["api-key"].(string), g.Args["app-key"].(string)) + + integration, err := client.GetIntegrationPD() + if err != nil { + return err + } + g.Resources = g.createResources(integration.GetSubdomain()) + return nil +} diff --git a/providers/datadog/integration_pagerduty_service_object.go b/providers/datadog/integration_pagerduty_service_object.go new file mode 100644 index 0000000000..9472621b42 --- /dev/null +++ b/providers/datadog/integration_pagerduty_service_object.go @@ -0,0 +1,75 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "fmt" + + datadogCommunity "github.com/zorkian/go-datadog-api" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationPagerdutyServiceObjectAllowEmptyValues ... + IntegrationPagerdutyServiceObjectAllowEmptyValues = []string{"tags."} +) + +// IntegrationPagerdutyServiceObjectGenerator ... +type IntegrationPagerdutyServiceObjectGenerator struct { + DatadogService +} + +func (g *IntegrationPagerdutyServiceObjectGenerator) createResources(serviceNames []string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, name := range serviceNames { + resourceName := name + resources = append(resources, g.createResource(resourceName)) + } + + return resources +} + +func (g *IntegrationPagerdutyServiceObjectGenerator) createResource(serviceName string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + serviceName, + fmt.Sprintf("integration_pagerduty_service_object_%s", serviceName), + "datadog_integration_pagerduty_service_object", + "datadog", + IntegrationPagerdutyServiceObjectAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each PD Service create 1 TerraformResource. +// Need IntegrationPagerdutyServiceObject ServiceName as ID for terraform resource +func (g *IntegrationPagerdutyServiceObjectGenerator) InitResources() error { + //datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + //authV1 := g.Args["authV1"].(context.Context) + client := datadogCommunity.NewClient(g.Args["api-key"].(string), g.Args["app-key"].(string)) + + pdIntegration, err := client.GetIntegrationPD() + if err != nil { + return err + } + + var serviceNames []string + for _, service := range pdIntegration.Services { + serviceNames = append(serviceNames, *service.ServiceName) + } + + g.Resources = g.createResources(serviceNames) + return nil +} From 487b9adc6c3a117366d22bc16b4af54b6d4028d9 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 21 Jan 2021 14:50:22 -0500 Subject: [PATCH 093/276] update README.md --- README.md | 4 ++ providers/datadog/datadog_provider.go | 54 +++++++++++++-------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 57a27f305c..6a798caecf 100644 --- a/README.md +++ b/README.md @@ -1552,6 +1552,10 @@ List of supported Datadog services: * `integration_gcp` * `datadog_integration_gcp` * **_NOTE:_** Sensitive fields `private_key, private_key_id, client_id` is not generated and needs to be manually set +* `integration_pagerduty` + * `datadog_integration_pagerduty` +* `integration_pagerduty_service_object` + * `datadog_integration_pagerduty_service_object` * `metric_metadata` * `datadog_metric_metadata` * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 6b105a8f8a..111e59e2f0 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -180,35 +180,35 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { // GetSupportedService return map of support service for Datadog func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "dashboard_list": &DashboardListGenerator{}, - "dashboard": &DashboardGenerator{}, - "downtime": &DowntimeGenerator{}, - "logs_archive": &LogsArchiveGenerator{}, - "logs_archive_order": &LogsArchiveOrderGenerator{}, - "logs_custom_pipeline": &LogsCustomPipelineGenerator{}, - "logs_index": &LogsIndexGenerator{}, - "logs_index_order": &LogsIndexOrderGenerator{}, - "logs_integration_pipeline": &LogsIntegrationPipelineGenerator{}, - "logs_pipeline_order": &LogsPipelineOrderGenerator{}, - "integration_aws": &IntegrationAWSGenerator{}, - "integration_aws_lambda_arn": &IntegrationAWSLambdaARNGenerator{}, - "integration_aws_log_collection": &IntegrationAWSLogCollectionGenerator{}, - "integration_azure": &IntegrationAzureGenerator{}, + "dashboard_list": &DashboardListGenerator{}, + "dashboard": &DashboardGenerator{}, + "downtime": &DowntimeGenerator{}, + "logs_archive": &LogsArchiveGenerator{}, + "logs_archive_order": &LogsArchiveOrderGenerator{}, + "logs_custom_pipeline": &LogsCustomPipelineGenerator{}, + "logs_index": &LogsIndexGenerator{}, + "logs_index_order": &LogsIndexOrderGenerator{}, + "logs_integration_pipeline": &LogsIntegrationPipelineGenerator{}, + "logs_pipeline_order": &LogsPipelineOrderGenerator{}, + "integration_aws": &IntegrationAWSGenerator{}, + "integration_aws_lambda_arn": &IntegrationAWSLambdaARNGenerator{}, + "integration_aws_log_collection": &IntegrationAWSLogCollectionGenerator{}, + "integration_azure": &IntegrationAzureGenerator{}, + "integration_gcp": &IntegrationGCPGenerator{}, "integration_pagerduty": &IntegrationPagerdutyGenerator{}, "integration_pagerduty_service_object": &IntegrationPagerdutyServiceObjectGenerator{}, - "integration_gcp": &IntegrationGCPGenerator{}, - "metric_metadata": &MetricMetadataGenerator{}, - "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, - "security_monitoring_default_rule": &SecurityMonitoringDefaultRuleGenerator{}, - "security_monitoring_rule": &SecurityMonitoringRuleGenerator{}, - "service_level_objective": &ServiceLevelObjectiveGenerator{}, - "synthetics": &SyntheticsGenerator{}, - "synthetics_global_variable": &SyntheticsGlobalVariableGenerator{}, - "synthetics_private_location": &SyntheticsPrivateLocationGenerator{}, - "timeboard": &TimeboardGenerator{}, - "user": &UserGenerator{}, - "role": &RoleGenerator{}, + "metric_metadata": &MetricMetadataGenerator{}, + "monitor": &MonitorGenerator{}, + "screenboard": &ScreenboardGenerator{}, + "security_monitoring_default_rule": &SecurityMonitoringDefaultRuleGenerator{}, + "security_monitoring_rule": &SecurityMonitoringRuleGenerator{}, + "service_level_objective": &ServiceLevelObjectiveGenerator{}, + "synthetics": &SyntheticsGenerator{}, + "synthetics_global_variable": &SyntheticsGlobalVariableGenerator{}, + "synthetics_private_location": &SyntheticsPrivateLocationGenerator{}, + "timeboard": &TimeboardGenerator{}, + "user": &UserGenerator{}, + "role": &RoleGenerator{}, } } From 1ff41d88e6026c9b9ee9691528c446bfb12b8d04 Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 22 Jan 2021 02:39:30 -0500 Subject: [PATCH 094/276] lint --- providers/datadog/integration_pagerduty.go | 15 --------------- .../integration_pagerduty_service_object.go | 2 -- 2 files changed, 17 deletions(-) diff --git a/providers/datadog/integration_pagerduty.go b/providers/datadog/integration_pagerduty.go index ebe17c3458..ab94cda042 100644 --- a/providers/datadog/integration_pagerduty.go +++ b/providers/datadog/integration_pagerduty.go @@ -39,21 +39,6 @@ func (g *IntegrationPagerdutyGenerator) createResources(pdSubdomain string) []te return resources } -func (g *IntegrationPagerdutyGenerator) createIntegrationPDServiceObjectResources(serviceNames []string) []terraformutils.Resource { - resources := []terraformutils.Resource{} - for _, serviceName := range serviceNames { - resources = append(resources, terraformutils.NewSimpleResource( - serviceName, - fmt.Sprintf("integration_pagerduty_service_object_%s", serviceName), - "datadog_integration_pagerduty_service_object", - "datadog", - []string{}, - )) - } - - return resources -} - func (g *IntegrationPagerdutyGenerator) createResource(serviceName string) terraformutils.Resource { return terraformutils.NewSimpleResource( serviceName, diff --git a/providers/datadog/integration_pagerduty_service_object.go b/providers/datadog/integration_pagerduty_service_object.go index 9472621b42..103f12fc02 100644 --- a/providers/datadog/integration_pagerduty_service_object.go +++ b/providers/datadog/integration_pagerduty_service_object.go @@ -56,8 +56,6 @@ func (g *IntegrationPagerdutyServiceObjectGenerator) createResource(serviceName // from each PD Service create 1 TerraformResource. // Need IntegrationPagerdutyServiceObject ServiceName as ID for terraform resource func (g *IntegrationPagerdutyServiceObjectGenerator) InitResources() error { - //datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) - //authV1 := g.Args["authV1"].(context.Context) client := datadogCommunity.NewClient(g.Args["api-key"].(string), g.Args["app-key"].(string)) pdIntegration, err := client.GetIntegrationPD() From de9f4f23778b56065fb14ba61e7f39895a92adf2 Mon Sep 17 00:00:00 2001 From: skarimo Date: Thu, 18 Feb 2021 15:10:56 -0500 Subject: [PATCH 095/276] remove services in favor of individual services --- providers/datadog/integration_pagerduty.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/providers/datadog/integration_pagerduty.go b/providers/datadog/integration_pagerduty.go index ab94cda042..93cdfbd973 100644 --- a/providers/datadog/integration_pagerduty.go +++ b/providers/datadog/integration_pagerduty.go @@ -16,7 +16,6 @@ package datadog import ( "fmt" - datadogCommunity "github.com/zorkian/go-datadog-api" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -40,13 +39,21 @@ func (g *IntegrationPagerdutyGenerator) createResources(pdSubdomain string) []te } func (g *IntegrationPagerdutyGenerator) createResource(serviceName string) terraformutils.Resource { - return terraformutils.NewSimpleResource( + resource := terraformutils.NewResource( serviceName, fmt.Sprintf("integration_pagerduty_%s", serviceName), "datadog_integration_pagerduty", "datadog", + map[string]string{ + "individual_services": "true", + }, IntegrationPagerdutyAllowEmptyValues, + map[string]interface{}{}, ) + // Ignore services in favor of individual_services + resource.IgnoreKeys = append(resource.IgnoreKeys, "^services$") + + return resource } // InitResources Generate TerraformResources from Datadog API, From 9fd07d0e048659bff15a9fe558457c8aead92aaf Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 19 Feb 2021 10:53:33 -0500 Subject: [PATCH 096/276] add paginated endpoint support for monitors resource --- providers/datadog/monitor.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/providers/datadog/monitor.go b/providers/datadog/monitor.go index c258133f33..1122666ddf 100644 --- a/providers/datadog/monitor.go +++ b/providers/datadog/monitor.go @@ -88,10 +88,24 @@ func (g *MonitorGenerator) InitResources() error { return nil } - monitors, _, err := datadogClientV1.MonitorsApi.ListMonitors(authV1).Execute() - if err != nil { - return err + var monitors []datadogV1.Monitor + pageSize := int32(10000) + pageNumber := int64(0) + for { + resp, _, err := datadogClientV1.MonitorsApi.ListMonitors(authV1).PageSize(pageSize).Page(pageNumber).Execute() + if err != nil { + return err + } + + if len(resp) == 0 || int32(len(resp)) < pageSize { + monitors = append(monitors, resp...) + break + } + + monitors = append(monitors, resp...) + pageNumber++ } + g.Resources = g.createResources(monitors) return nil } From 022ce36b5534de703068af8fdf0c875c15a4d86a Mon Sep 17 00:00:00 2001 From: skarimo Date: Fri, 19 Feb 2021 10:56:05 -0500 Subject: [PATCH 097/276] lower page size for request --- providers/datadog/monitor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/datadog/monitor.go b/providers/datadog/monitor.go index 1122666ddf..98a606a78d 100644 --- a/providers/datadog/monitor.go +++ b/providers/datadog/monitor.go @@ -89,7 +89,7 @@ func (g *MonitorGenerator) InitResources() error { } var monitors []datadogV1.Monitor - pageSize := int32(10000) + pageSize := int32(1000) pageNumber := int64(0) for { resp, _, err := datadogClientV1.MonitorsApi.ListMonitors(authV1).PageSize(pageSize).Page(pageNumber).Execute() From 17c831ca8110ae73c34f3ab1b8b2e91cf16db23f Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sat, 20 Feb 2021 13:10:22 +0800 Subject: [PATCH 098/276] #549 initiated AWS SDK upgrade --- README.md | 1 - go.mod | 67 +++++++- go.sum | 293 ++++++++++++++++++++++++++++++++ providers/aws/accessanalyzer.go | 17 +- providers/aws/aws_service.go | 18 +- providers/aws/ec2.go | 37 ++-- providers/aws/s3.go | 4 +- 7 files changed, 400 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 57a27f305c..37c5760ebf 100644 --- a/README.md +++ b/README.md @@ -647,7 +647,6 @@ In that case terraformer will not know with which region resources are associate * `aws_route_table_association` * `s3` * `aws_s3_bucket` - * `aws_s3_bucket_policy` * `secretsmanager` * `aws_secretsmanager_secret` * `securityhub` diff --git a/go.mod b/go.mod index 9da99c7c5b..256f93900d 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,72 @@ require ( github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 github.com/aws/aws-sdk-go v1.36.19 - github.com/aws/aws-sdk-go-v2 v0.24.0 + github.com/aws/aws-sdk-go-v2 v1.2.0 + github.com/aws/aws-sdk-go-v2/config v1.1.1 + github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 + github.com/aws/aws-sdk-go-v2/service/acm v1.1.1 + github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1 + github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1 + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1 + github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1 + github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1 + github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1 + github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1 + github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1 + github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1 + github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1 + github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1 + github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1 + github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1 + github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1 + github.com/aws/aws-sdk-go-v2/service/efs v1.1.1 + github.com/aws/aws-sdk-go-v2/service/eks v1.1.1 + github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1 + github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1 + github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1 + github.com/aws/aws-sdk-go-v2/service/emr v1.1.1 + github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1 + github.com/aws/aws-sdk-go-v2/service/glue v1.1.1 + github.com/aws/aws-sdk-go-v2/service/iam v1.1.1 + github.com/aws/aws-sdk-go-v2/service/iot v1.1.1 + github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1 + github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1 + github.com/aws/aws-sdk-go-v2/service/kms v1.1.1 + github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1 + github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1 + github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1 + github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1 + github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1 + github.com/aws/aws-sdk-go-v2/service/rds v1.1.1 + github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1 + github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 + github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 + github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1 + github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1 + github.com/aws/aws-sdk-go-v2/service/ses v1.1.1 + github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1 + github.com/aws/aws-sdk-go-v2/service/sns v1.1.1 + github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1 + github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 + github.com/aws/aws-sdk-go-v2/service/swf v1.1.1 + github.com/aws/aws-sdk-go-v2/service/waf v1.1.1 + github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1 + github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1 + github.com/aws/aws-sdk-go-v2/service/xray v1.1.1 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect diff --git a/go.sum b/go.sum index b2bc5583ab..cb689b1f13 100644 --- a/go.sum +++ b/go.sum @@ -173,6 +173,296 @@ github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9z github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= +github.com/aws/aws-sdk-go-v2 v0.31.0 h1:TNTDsz+Xq80nYzZPUFS4a2Oyjz9jKHKcTuNAXtcW8b8= +github.com/aws/aws-sdk-go-v2 v0.31.0/go.mod h1:IQw4KL7QIoaNDT3WoEBV1fDlVRhp/WTRteoaplV3SHo= +github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c= +github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= +github.com/aws/aws-sdk-go-v2/config v0.4.0 h1:16lwnZRhleaPbDesZgEJbHxuOv4wy12A372mkhmiktc= +github.com/aws/aws-sdk-go-v2/config v0.4.0/go.mod h1:5uxQPUBCF+TwwWYo2xau4N+rSOS47ZH+QvLbae1Cckc= +github.com/aws/aws-sdk-go-v2/config v1.1.1 h1:ZAoq32boMzcaTW9bcUacBswAmHTbvlvDJICgHFZuECo= +github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= +github.com/aws/aws-sdk-go-v2/credentials v0.2.0 h1:YDv/0/8BzaZtpS4jfptcyIPh5zlhmIhbM2RtNscn/bo= +github.com/aws/aws-sdk-go-v2/credentials v0.2.0/go.mod h1:U81m6Xb5IpJ66ZnotiG7/6JJFuwrc8q8rWpXQxYP0hI= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1 h1:NbvWIM1Mx6sNPTxowHgS2ewXCRp+NGTzUYb/96FZJbY= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v0.1.0 h1:zwhJDxNht/+a0QGy3RCveUFf6REXcmaQIHcYS11m5KY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v0.1.0/go.mod h1:d3o/QBgbYw2OYmbv/EGYs0zFH47qsCKCTDbaOgdQGH8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 h1:EtEU7WRaWliitZh2nmuxEXrN0Cb8EgPUFGIoTMeqbzI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v0.31.0 h1:peKA1aNVZWGhxYItXwaMFtjFf1F4T3IyzjpoFTHWH6w= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v0.31.0/go.mod h1:ftbIDjS8x5ownQD9INfL3xg/3Cpd8xn22RN65/S8jX0= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 h1:6ocrUoJHmXBa0/oCoWYN2nK+UrETpA0zUxCV990nRl0= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1/go.mod h1:+JkwIyrURCsjBdb3M6PdF+LAQ3TPvZAfH+gJ7AI3JT0= +github.com/aws/aws-sdk-go-v2/service/acm v0.31.0 h1:QkipbLwq20gcDPLZW9QH6cwdkR4Ui2yKDvZfLx+VXKo= +github.com/aws/aws-sdk-go-v2/service/acm v0.31.0/go.mod h1:5CAGx34bxJi7+dwLi0OW2vNiM2m641zDZDIxyy3KGkY= +github.com/aws/aws-sdk-go-v2/service/acm v1.1.1 h1:LAr7oTwfOZdfJN1GrZnU05yf2aOO3HVeGv2KjJKp8d4= +github.com/aws/aws-sdk-go-v2/service/acm v1.1.1/go.mod h1:LPzlCt4j2TSsD9P6NtruMhkOf0Ke7uxEHaxRCI5D1x4= +github.com/aws/aws-sdk-go-v2/service/apigateway v0.31.0 h1:yNG6u4Ea8hDM/b+NCOPxNhyfi4164Gub1A72TB+D58A= +github.com/aws/aws-sdk-go-v2/service/apigateway v0.31.0/go.mod h1:equnPApvqFNpI2Q55GOg+hNeJOMnqZqzrnnlkvckcbk= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1 h1:G2JpxWOpTyeLgTbh5gfiESvvm6B3lu/6kQNEhAS8Tvk= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1/go.mod h1:wmgrgVgNP96iRTgbY+Qd3UdqVvmlOCd46tY2P6sOTfs= +github.com/aws/aws-sdk-go-v2/service/appsync v0.31.0 h1:O3UX2/Eop1Z7YkVFdl4z3KAY8xlxHMc7oOLpA7gzzdM= +github.com/aws/aws-sdk-go-v2/service/appsync v0.31.0/go.mod h1:SJtL4QwIL7hUvvtdui2PL52v2QHgJ4aDPRjL+DqKJA0= +github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1 h1:NYPqPq18/WvalPPowYG0laum27pdEXq5gnrTp1ppVF4= +github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1/go.mod h1:uhccc+JDGc1Ck0q8F3iI0+PPIP1N+yTZEfuMPp2Achw= +github.com/aws/aws-sdk-go-v2/service/autoscaling v0.31.0 h1:BmpZDHFn1QhsLZ2lI7wMhRRK28rcYTmN7W9QY22aoqk= +github.com/aws/aws-sdk-go-v2/service/autoscaling v0.31.0/go.mod h1:VYp/EgnDckBH0wdfkaNvjXsyU11OzDrQ4zXYEHoZoFY= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1 h1:O0iefEPzxDdVVBtY7o0Hyj4SUre27QRh5mthCU+HYDA= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1/go.mod h1:lmXoX7IIO5yAHRCmHlqda9tFfsbkY3IO3rt85VvXmIQ= +github.com/aws/aws-sdk-go-v2/service/budgets v0.31.0 h1:kBxisypqFiXnLj9QZpep8lV8FeNgH314scX1Q6I5mjs= +github.com/aws/aws-sdk-go-v2/service/budgets v0.31.0/go.mod h1:8xObAwrQOsYomRBytI8EdHhuwC4aCdjpUvU/tDOi0YE= +github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1 h1:ZVgyQqcfkXmz8VLA/R0j0FdqMBwPYNs52Ho2DzwY8zo= +github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1/go.mod h1:/v+APBnOBPy/NpPFS1lH5qJ9BfEQVfPAEnBm5XV1870= +github.com/aws/aws-sdk-go-v2/service/cloud9 v0.31.0 h1:uUVDtGnFdnrjvVD+wMlRZi8/feJtq18zwSv1uNQHKyg= +github.com/aws/aws-sdk-go-v2/service/cloud9 v0.31.0/go.mod h1:lvUm57SVAWTqSPeJw/jRt8clIxQPhYV/2idGW9namqI= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1 h1:WblDVlnxgdvuZNwBw3UX3JaO7hdVuvaLNK4P0XK1gKM= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1/go.mod h1:InGDFYVeG6/bfb5KRB2n5qTFWZ/vp483zdUE1EPbDM0= +github.com/aws/aws-sdk-go-v2/service/cloudformation v0.31.0 h1:Xcr9L5Q+X5jlofHanupgEpF+2wAIulF5N67Oso92Pvw= +github.com/aws/aws-sdk-go-v2/service/cloudformation v0.31.0/go.mod h1:ScoIqiowvOH6AUbGPrNAoOhan43UjUGyBItoXKlOfks= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1 h1:cRw6t1ZAqc0fG2CFtWnXXdBwgREo6B06X63lDlpGPlI= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1/go.mod h1:Fq3q5X0gHcCCldZx+ibAo0HRo2xbVi9LFoFj2Pp9nl0= +github.com/aws/aws-sdk-go-v2/service/cloudfront v0.31.0 h1:QACFlH/uvFYqhsSRn2c05DkiEZsBeCWY5cZFpN57GMI= +github.com/aws/aws-sdk-go-v2/service/cloudfront v0.31.0/go.mod h1:E+HPxVl87/GlUTmxM+tbuynZdqUG+VmSO++W61RmRnE= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1 h1:Qhi6EdWHqYvqKXZBZ55YHNR6RL9JJTi65ndbqPKRdpM= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1/go.mod h1:xNq//oorX26+SRydd//Rqk3iPLoKzoYmAGDm6p3wpzc= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v0.31.0 h1:pE0bkNXb+L/b6eaVIz0GTUUsLCz/tEhy9QS+pYZbagA= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v0.31.0/go.mod h1:Xet4o/3wZwXSKZ6XqPQB6S8Rw2eQ6wLzDLEGuHElpZ0= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1 h1:jso38tIYjMhe0i5uBD2sG/nmgODmh8ZCKFvaejqlIQ8= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1/go.mod h1:e6vwvVG3CrANic49hz9SG2bkKnSujNy8r+S6MZ21oEE= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v0.31.0 h1:Vk3Y9dgetwZFz0kW2u8+8USjy4c3OORohYXhidwKOKw= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v0.31.0/go.mod h1:/ijKLSMyzLwTesSbGLu2tgvh8ET2GYmLdvSiMvMtzkU= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1 h1:MNQmQJZNCAlPqkWP01/7YptslcAbVmLNyqac+W/Q5oY= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1/go.mod h1:gI/6WuEdSe7fWiBOMVPJfaonzq9mSA2E7h85CZNXzuI= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v0.31.0 h1:XDX1BX3+My/dVVbgnXbLB7mm3xj5Lr9FmuPP4wfQ3P4= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v0.31.0/go.mod h1:T4hENhAKLIeFlFRkYYnQm0bHIuVbOTpOaJjbVw/odS0= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1 h1:wvmvsbvJw/ml/PtdvqbcJnpu/GZLA5dERO0pqpcvyw0= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1/go.mod h1:HFCCrSEnP3mVyR8zOmcbLSQJW4DGRKoz1hjJxh4d/tw= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v0.31.0 h1:fZC2McQzpsbw7JpFzzvmKYPzTJjDb3QQOayaXXLy90I= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v0.31.0/go.mod h1:yZPu7NACE3dv2Ro8cmef9p6GxfwTi6lzEQkSYPq4TUM= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1 h1:abNETLBP3ShOHUBocGFBHqbP3D9Ho2vKhG8soWId4js= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1/go.mod h1:rtyMQxf1ahZkyvpcwnHGR7goHPJC4WRUmazENZsbjas= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v0.31.0 h1:own7MF26XAyY/Kvmga2xhLIbWqUNrZU36oGMPUt3yB4= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v0.31.0/go.mod h1:FLbWTw3O8K6njSXyGco8nczBt4Spm5W/CISNIeJDki4= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1 h1:9McrdB/9iGpEZw2xZdRdCYQlNuCHFFYjvROkO5yo1RM= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1/go.mod h1:IB6HamJdrHbUjbWEgWkGX1Lrp8mZzxoBLXHOTAmoXFA= +github.com/aws/aws-sdk-go-v2/service/codebuild v0.31.0 h1:AoVHRL1iTWU7bKpBeKZM3a1s3jZKBzM/gzOpXxSX1/o= +github.com/aws/aws-sdk-go-v2/service/codebuild v0.31.0/go.mod h1:nTGmHi8VC+/Mfh78NVLQR09sQkRyU0SXEAaNcKE1VOU= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1 h1:5Ku1ITd/Epk23vIwq/2NU1F0gUKlUcjyk5gOrsXPZIA= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1/go.mod h1:Hc+1mcfi7yTl5Qtrn7PRwazVWblIIWCfhqwaj8M6vAw= +github.com/aws/aws-sdk-go-v2/service/codecommit v0.31.0 h1:GSf9yEw+WndSnar+gEUfrnhIvg+5plQjN7v3NDULgfQ= +github.com/aws/aws-sdk-go-v2/service/codecommit v0.31.0/go.mod h1:3TriU8VIcjWgQY/HMABqVIsijgNIBkc/HY01uzTN4NA= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1 h1:7WUEimiBFjeo0x/K8JNhPc61oho7TPhXyfrpYxpEMN0= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1/go.mod h1:JUViTUm6ZiAJOwKItWf/lN5KeBRdidcjfZnAhgKTc0Y= +github.com/aws/aws-sdk-go-v2/service/codedeploy v0.31.0 h1:zKIUYrNJv2cf6ZiWQ7LlckmZhgH8HBK4yVg2+Eswkks= +github.com/aws/aws-sdk-go-v2/service/codedeploy v0.31.0/go.mod h1:d1DGaVPwCyhIgj9ERcW7to8bL/CXC4DIYfE4uRiK1Mg= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1 h1:nCv1/hV+E3kMUJVwgUzw5zNvcHzP9cQqVmcVZXlcmiE= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1/go.mod h1:ktnHZmgGlqoJkUjyzR4RHDlGhfSxQV+AQY7Xx3nPNPw= +github.com/aws/aws-sdk-go-v2/service/codepipeline v0.31.0 h1:/Y0F6/uIEblN9JNoH5dLocFw45ptt4iSzVmsOYJhddU= +github.com/aws/aws-sdk-go-v2/service/codepipeline v0.31.0/go.mod h1:TQaBBV5p4+6FIZgt8tlS3dtjHPuULXnzoFH7zRMgfUo= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1 h1:FbzagBHyTmKk4DbXJOx4l/a+k0y49TgWoyzCc04YwAk= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1/go.mod h1:7pc2jReqY0EvHa5ReuVBIwmRlW8yQV5O3ptw4T+OS80= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v0.31.0 h1:SEEPDaPAz3jIwWO8njlZtM/sH7B+IsSG3sYz/U0tM7k= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v0.31.0/go.mod h1:aTe0yGYoQqJWzs4phFv4UkXQMQLEhbw9fZGd2er4zOM= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1 h1:A/ZhwplRVmY3cSM5NfW/3lp0PBJFAhWvHD5+sYo7oxI= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1/go.mod h1:85mUFI4DMZiUYpQzTfUvDaFf/TL/pd419Elk5FOCVtY= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v0.31.0 h1:TL0DhwAi4OQjgfefBuk53YbHKoezpOsKnL4oDRR0Ep0= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v0.31.0/go.mod h1:JW5h2Bp0WeFLSeE5Tt8tLZtHQ3g7uvh62y5iQ+oju6s= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1 h1:HoHckIJOdxpS4RSEqnPXp9+gFjixFH97pT46Q4buxhA= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1/go.mod h1:/yhD37TwPeVuZZ8qx1n7H65O0+a2Mh3gEF4TTB4Sn24= +github.com/aws/aws-sdk-go-v2/service/configservice v0.31.0 h1:s6DLkiGUG3DmxJsWnTs68n7S5L9h/2zkrweU+bM84hI= +github.com/aws/aws-sdk-go-v2/service/configservice v0.31.0/go.mod h1:bA5PyBxggow3OQISPS6+VNVT1atsF5pEGAunKY2TQ8c= +github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1 h1:2PU0yT1crQJ08BJOF8Flq8j962NpiU3QltBaKg4NI0c= +github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1/go.mod h1:d8io9sMSzJBqxJrNABjaDuFH6t02btWR2ZQtDTGF35A= +github.com/aws/aws-sdk-go-v2/service/datapipeline v0.31.0 h1:JpF06tBWFVD7PuE0ztLOwKzG2KDxC3tRk0orU7CKYOU= +github.com/aws/aws-sdk-go-v2/service/datapipeline v0.31.0/go.mod h1:npbHJr/KbtmsXCATTMpnzFBsp0cSUNTcy0cBilLQKyg= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1 h1:iBj0PYHYe7Po52v8fAcMEH0RRLbgN0XkJ+dux63lKD8= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1/go.mod h1:f+FK6B06DiJnhr8Ba6rnN8SSPITHG3et63y8NORbbsk= +github.com/aws/aws-sdk-go-v2/service/devicefarm v0.31.0 h1:6S7IolSJLZ7VR4vJF/+Y2l9tWFzIpS3Evhj0IoYnZA0= +github.com/aws/aws-sdk-go-v2/service/devicefarm v0.31.0/go.mod h1:Prxq85+6vG+1/8eXtM1KDWianLM1VaQvL49cspoV98I= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1 h1:NSFZm6LIFbASAv833Bm4+Ea/GiaWr2NvTalswFtOTj4= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1/go.mod h1:UMb/XuyQ0X/Gr+GVwCwL5qYvPE5vWwUOYHooaa4WhzQ= +github.com/aws/aws-sdk-go-v2/service/dynamodb v0.31.0 h1:sqdT+stp7NlYs/cOtLMSMXj0WrGXSj4gWmIiPFrpNX8= +github.com/aws/aws-sdk-go-v2/service/dynamodb v0.31.0/go.mod h1:3gJdaC23NGEM57Zm9L5CZzKGOfuvoclmAZu8ZFLNQKI= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1 h1:rs3qt8vsrOXgm3qfVdjVkwnPiBXI2M7qN1nExoZmJfI= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1/go.mod h1:0xGVqnX5hK8bd/Qnqklpdellx5/6KPSPV7vfno3i1Sk= +github.com/aws/aws-sdk-go-v2/service/ec2 v0.31.0 h1:WFmkmj3SBb74ahh3/M1FHS6GgQ7uyJKNoUorIWXyYLI= +github.com/aws/aws-sdk-go-v2/service/ec2 v0.31.0/go.mod h1:l0pwXTelza2kR5KczSC7f0HJcgXpROUY+oJ+KvfVkH4= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1 h1:xZYDtbub5yhn+ASvD26m76Cgb0k+0+ShE+nZwK9djUQ= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1/go.mod h1:L7nNXGNEV0lkTauKM/KcEIZkT262pckC0YNykwAtX20= +github.com/aws/aws-sdk-go-v2/service/ecr v0.31.0 h1:wJaZLmT5FJvUdlQfq1rNHyFj2WS5tpPqpLEMDp2avXE= +github.com/aws/aws-sdk-go-v2/service/ecr v0.31.0/go.mod h1:57qetkcAXkGAsoRsxPUpK/ZuTj9A1b6vq7wnig/q7ac= +github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1 h1:idXCsD7Rl3LtE/MFFw81a1C1tVRSP3AOnv96U0TsRUo= +github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1/go.mod h1:NGFCwbEd03lj5kwG8vO5qS5m4CfvHE4ir3pA5ozrlUM= +github.com/aws/aws-sdk-go-v2/service/ecs v0.31.0 h1:QFs/Ta5qq79BFXkbqSWW/iOg4w4ZIhksxk5KLau86DY= +github.com/aws/aws-sdk-go-v2/service/ecs v0.31.0/go.mod h1:Y7b7BL883bwUY1yFQQv0Zo0/yLi1YewcVpjHs63jQdA= +github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1 h1:McBGvH3M7n8s6SGuS+UNm8+q5BEmE30cNH/81qy0B4Q= +github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1/go.mod h1:HHh+ZaGFQVK16XijQFZKaJdTpeOdxWK894pn9vY2Tgo= +github.com/aws/aws-sdk-go-v2/service/efs v0.31.0 h1:DYMjNVmLPQ5V7zlRBW77l1ZcXpI0I6KZpDqPMqiotms= +github.com/aws/aws-sdk-go-v2/service/efs v0.31.0/go.mod h1:ZkkoEcVW2QhiRHfIqjvX7FzU06+sA0gCCWvIs6jyxmI= +github.com/aws/aws-sdk-go-v2/service/efs v1.1.1 h1:UnjpU4x5bCWhJn43C+FXSjRs4fh8z8YjN8AsjxkEFW8= +github.com/aws/aws-sdk-go-v2/service/efs v1.1.1/go.mod h1:fJbRgAwIrq3LyqphCXgJs6bVYfMlLZ9G6vepkPvAJsw= +github.com/aws/aws-sdk-go-v2/service/eks v0.31.0 h1:T1H3oyZwfmm88N2QFEUPpxZasL76bv8KQrZ8Z1PCtXw= +github.com/aws/aws-sdk-go-v2/service/eks v0.31.0/go.mod h1:6dzei1oFWmVBcjD5J/n2WoYe3w90gwUuO5GLIxQfY3M= +github.com/aws/aws-sdk-go-v2/service/eks v1.1.1 h1:nK/Kl0TIfwaHUkcCj9+L6td2Xds7QNYMODJKWG1wPOY= +github.com/aws/aws-sdk-go-v2/service/eks v1.1.1/go.mod h1:9SVAH9Cu/e1iQOu7VIBp7DhqTq3Dr5cAooCzoh61mEc= +github.com/aws/aws-sdk-go-v2/service/elasticache v0.31.0 h1:u+4Ix+UmE5UqiWDa3VXS6nvVN5vtnt5HND8F3Q0Z9+k= +github.com/aws/aws-sdk-go-v2/service/elasticache v0.31.0/go.mod h1:qgPiENzy2GQMGsbAbGHzbZfe4HBkhxlQUxSoqrfsyO4= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1 h1:/1VLazyWVSYTzl3CmmfjT2g3jc9krekNcTyGiW09AYY= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1/go.mod h1:DfEntnpXu52dWWWGCjrx2RNMsHWHXuyI2LOpn+XkFFY= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v0.31.0 h1:YxBOJFbViSncZCTQcXzZ3yZrU8qf9spaXx2VGGgVhoI= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v0.31.0/go.mod h1:wVFJNTewEFohF6/cV260zlty6bP2fueQr9YhCetPCMo= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1 h1:xLqpXaLCUtHJuJiOASwPIPLAJMt1v+6h8phzma1haT8= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1/go.mod h1:9Klmao5OCdCMYyXPNy+skSx6c4LoKsbPL8IcEqV5wVU= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v0.31.0 h1:53+EY9rDKKDAJ0cTuD/v+drY29k7IN8pCqaNvVsC3+s= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v0.31.0/go.mod h1:I+GNxv9WaxS3zV7J30UVTMdTb2cyC3K8yrNWddmGoqc= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1 h1:YyPHbW33NvSfUVVYIHVdMQX/BVnkdiJcgGdpjFqU64s= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1/go.mod h1:Gqg2Xf3BaVCDXPjNgkTwM3Q1zN7OSrOszkJ8s9xuYXU= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v0.31.0 h1:AOnDS+K8ipnxkUgqQMhm/rXnzgb9UiPpf6hbwQWivjQ= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v0.31.0/go.mod h1:zLAVHFVrJOY+++w+Epq5gPIQ3Z6UaLPvmf3uBqloBR8= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1 h1:ARoh9oSYV0QwcenklgpagsW+fI0xx5STB31yn3BtcPE= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1/go.mod h1:DP/R8CgrCb5TFyP3GIM5FcDWcrSl0sTZWHQSxXMtrEk= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v0.31.0 h1:ya+ScQTQdOqxc97UrFLNGlEQfV0eJjwigsaLthdxNw0= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v0.31.0/go.mod h1:v8BaK1/o2HLjNUrZqEmFO5JBm/CfGLyNRIXbxrqOR1U= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1 h1:Kz5PZgEUnzh3134+b8/kLmA6XrkSLD/qBV5YhUAlP0U= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1/go.mod h1:LtpgnMWYTwd6oasEo9HsE8dPDyeOnnU4A8at3LkyI6g= +github.com/aws/aws-sdk-go-v2/service/emr v0.31.0 h1:6c5rreRHuOAX4GA+yo7AeFk7fkEb9UZbVfB0GyR4oJM= +github.com/aws/aws-sdk-go-v2/service/emr v0.31.0/go.mod h1:GqUjZLHbrUG8zlJWhSt0Jt9KMN1ZMowyyyR+gGPr8x0= +github.com/aws/aws-sdk-go-v2/service/emr v1.1.1 h1:Al6w3GqqFKUmBjrQK+RWYNT7t7REiZ52GQL0ew/LSds= +github.com/aws/aws-sdk-go-v2/service/emr v1.1.1/go.mod h1:hgkNhB3DJRxLgFjL84KMXQ1c6XNRZQla4qiU1foMdbw= +github.com/aws/aws-sdk-go-v2/service/firehose v0.31.0 h1:SoGU4Bke3Jr77AaxHTTDGKDoltDcqb8BLgVMQs6o6sQ= +github.com/aws/aws-sdk-go-v2/service/firehose v0.31.0/go.mod h1:Hj98m/b7VARqwovXTixJD9VkQs1+mTQh7r4XlNf+AiY= +github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1 h1:RDEx0S3iyLDCK4/Y2TH4kXo53vJeSNeNyCdVzSwLR4g= +github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1/go.mod h1:mIQsr8OSwIu5DgdTeEimmQN6nld0TxfLfIW+aqTEX68= +github.com/aws/aws-sdk-go-v2/service/glue v0.31.0 h1:YNTMJKEn/PtJP1Vwycu3D5GTZrjNCH6G9EhtLeAI91g= +github.com/aws/aws-sdk-go-v2/service/glue v0.31.0/go.mod h1:TQUg6oZ2nZ2WySThFURRYmzmKhfmFfgyxPOXXF2wa4Y= +github.com/aws/aws-sdk-go-v2/service/glue v1.1.1 h1:O0mpo0QQXcsjr9lhLpQFKHjBJVY2XXkv5c/nWsZ0zgw= +github.com/aws/aws-sdk-go-v2/service/glue v1.1.1/go.mod h1:TegWq2QgDYYk6v6JD8POmo4gWwJhn4Ar6KoCyNxdyC0= +github.com/aws/aws-sdk-go-v2/service/iam v0.31.0 h1:1MgHdHe1VMoputD7JA3q6CkfyULtwvXAjkeqOIjpJTM= +github.com/aws/aws-sdk-go-v2/service/iam v0.31.0/go.mod h1:uqLp4cqedOQNNICBvmGhDLm9pJmN7E4gt0M0w5yFS2Y= +github.com/aws/aws-sdk-go-v2/service/iam v1.1.1 h1:dfpLUOEtz+DlRpeAA9vg/tM/VjAcDGBE47m2ZbdXrZU= +github.com/aws/aws-sdk-go-v2/service/iam v1.1.1/go.mod h1:vBPRxb7qWfonEjDJR+ckM+1b1z2gXOogQjmTIPw15L4= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.4.0 h1:osjGuGbk/aVW8u2yhOijPhxLU1ardwPDsga5HHyQMbw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.4.0/go.mod h1:Pjv1Z+nRaluwWCMuB6OQeqGRyiGk2WTrKG8RHs5wZug= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1 h1:q+3dVb1s3piv/Q/Ft0+OjU5iKItBRfCvU5wNLQUyIbA= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1/go.mod h1:zurGx7QI3Bk2OFwswSXl3PtJDdgD3QzjkfskiukJ2Mg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v0.2.0 h1:xeqwfWQGg3hjLMs61PlixdxhU+qqrd7S50j/3kV1j/0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v0.2.0/go.mod h1:Ef71w/O9Ulhxj8gD9Pq2S0lXMvyNzFLMRuIxWpDRQxk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 h1:4AH9fFjUlVktQMznF+YN33aWNXaR4VgDXyP28qokJC0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.4.0 h1:OiRO8lneLP7wJ80dqAwHpIRcMInUO04HzcQUVtPwk3U= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.4.0/go.mod h1:fMsE4Rr6OkxQUmZxi4Amj8LS0BakLZw05Rog0jYStQM= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0 h1:6yUvdqgAAWoKAotui7AI4QvJASrjI6rkJtweSyjH6M4= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0/go.mod h1:q+4U7Z1uD6Iimym8uPQp0Ong/XICxInhzIKVSwn7bUU= +github.com/aws/aws-sdk-go-v2/service/iot v0.31.0 h1:z2tS0bxsJsdVaxvyS+g/T/AtIqvSzNVAfuk9wnHO/DE= +github.com/aws/aws-sdk-go-v2/service/iot v0.31.0/go.mod h1:KARNdH4vq80q6Ck2LKswlmDRbP8B1CtjK8b7z3AiDe0= +github.com/aws/aws-sdk-go-v2/service/iot v1.1.1 h1:D7cWw8QZTkOEoF5uCnCUMYcNA1uo+yD+XuZXnZLcS+k= +github.com/aws/aws-sdk-go-v2/service/iot v1.1.1/go.mod h1:LM7v3TvBIu+R+UZ4QKQzoDS94lzJ3XLLFLN4wsbnbVM= +github.com/aws/aws-sdk-go-v2/service/kafka v0.31.0 h1:Wr3HdFFaMGY63Oii7BTFbXc9rWexg/MBDwFEsoj5JQ0= +github.com/aws/aws-sdk-go-v2/service/kafka v0.31.0/go.mod h1:M/dlYC+IZJj5HLVUta0xusgSsx8VYJllhWGQphMdSPg= +github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1 h1:FrFngpnVCdYW+lUljqqj9CLfY7xzRrGdY7/AkSOG5EE= +github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1/go.mod h1:VqHOqKal4FUR6PfZDazxEcI/IBxyXOwOKKYzmUu4kC8= +github.com/aws/aws-sdk-go-v2/service/kinesis v0.31.0 h1:px/xTjNQ1XMNuYvrszMtinJ9HhoK7/A5QzgtU02g3us= +github.com/aws/aws-sdk-go-v2/service/kinesis v0.31.0/go.mod h1:OYBQZvaQy8tR59aqEYerLKGbdfkbxTOgqLpQWvlg6Oc= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1 h1:w6pCp3eYLGhIH+mkNVZkR2KdpMXulXLzkQhmXbHeHTE= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1/go.mod h1:7GLbfWUWm4KRU04QHvxkZGIQDiUjLFD+nVZW8joexTo= +github.com/aws/aws-sdk-go-v2/service/kms v0.31.0 h1:ju4tqKfhT+6AG39E+bUsZcaqkLhEW573RKbvwJo8G9M= +github.com/aws/aws-sdk-go-v2/service/kms v0.31.0/go.mod h1:NcamFVUaE0JeTLqM9GbDL03yoUWrXCufXQ4gMrCT0Lc= +github.com/aws/aws-sdk-go-v2/service/kms v1.1.1 h1:rK1edW1dLtSGr1551ttHqQopajK4Pv9C4ez70dVMQaI= +github.com/aws/aws-sdk-go-v2/service/kms v1.1.1/go.mod h1:6K5oOoDdnkW/h+Jv+xOA+tvgI6lwGBT9igkJGL1ypaY= +github.com/aws/aws-sdk-go-v2/service/lambda v0.31.0 h1:68fZwWzwVBpdvlQNMVU5b4eKjtZW+IowjwAEWfNGS/I= +github.com/aws/aws-sdk-go-v2/service/lambda v0.31.0/go.mod h1:TNMkaS9maTfsI4lmf54tgVKWjcHoxSIvldhsRwR0UuE= +github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1 h1:ptubVb1eLQgZh7U4i+k2vpf3PlL4ZoTmGdTj+VowqqM= +github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1/go.mod h1:iSHLnnmJNKoAUdzKnUFh4rIGM3V58fxa+XCYtRpeFX8= +github.com/aws/aws-sdk-go-v2/service/mediapackage v0.31.0 h1:67T7C98ZxPh88ZOCAlR3fzLr7MBP9vIGK3bS81MDOgM= +github.com/aws/aws-sdk-go-v2/service/mediapackage v0.31.0/go.mod h1:5Cv4ncfrAoUhoOrLS4UHR3f8t/3cI00Ue+Vrbj+phI8= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1 h1:lIftsFn6TsByMl+v32Y4ztGLIz/C4Rq7gat5AihCpdw= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1/go.mod h1:9YtJbicAA2/uNt2VsIMWd6eapsIJn2o/0u0VJMAtrXo= +github.com/aws/aws-sdk-go-v2/service/mediastore v0.31.0 h1:qoZnd4arRiWOFQuMTOzfmtxGEabOgVblQy4P8rDTmTg= +github.com/aws/aws-sdk-go-v2/service/mediastore v0.31.0/go.mod h1:2uJryReEzOxrpktUKyB1u5B2+AcqoC2g7iLsqd/Sh30= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1 h1:tl/58Fn+6E9VTEmconNpPqDWSZM+aeV1DjI/sahJYLQ= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1/go.mod h1:gevnsX8qzzxtNcZoSab72+PNtrfFmgb1n1Z4GKbgkxU= +github.com/aws/aws-sdk-go-v2/service/organizations v0.31.0 h1:UIpKsOP4LYR32M6hhHY5MhKF5guBSrNZ71pcFWF74LE= +github.com/aws/aws-sdk-go-v2/service/organizations v0.31.0/go.mod h1:C6LkUy13It4YU6/0SZcKz0WxjGPrwGXdmhpQc9ppz/A= +github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1 h1:JPmFEmO4ycVquOwChmPJtC8Ct4oM1r3qEHwBdHZ4y3w= +github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1/go.mod h1:goX7wNhH+gPuyYZX0AEJWm7cegEHyKnRLvZW4T4ZTgg= +github.com/aws/aws-sdk-go-v2/service/qldb v0.31.0 h1:3GwwI1ojlKYq9Z4AQpxMrNIiR6hoeaFCRc2Y2Bc6Rig= +github.com/aws/aws-sdk-go-v2/service/qldb v0.31.0/go.mod h1:fa+gF6o0Y09CgmJ4OF0NDos/WnUWfZpswswYOHFwI+M= +github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1 h1:2yUiwjSgEdMO2zRvbFkMVB5+qIw33o+1uvsS+Vwt3LU= +github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1/go.mod h1:PdAF531U/qcXoTn4/Ay+RCTXAiim7Z4zPPiJMSY0P+w= +github.com/aws/aws-sdk-go-v2/service/rds v0.31.0 h1:9QnLjHZGNMR73qWhWQjbLd3Rg1b/UE9XmWNRWpcoypk= +github.com/aws/aws-sdk-go-v2/service/rds v0.31.0/go.mod h1:QR1y6Z2xttVeN5/Ka1qI5nNy5QNh3iMHBEx97R+EP3w= +github.com/aws/aws-sdk-go-v2/service/rds v1.1.1 h1:bA0wFJBnOiEa5ZcNHt9vHlTjjjj/rFvCcQq7nqE36WI= +github.com/aws/aws-sdk-go-v2/service/rds v1.1.1/go.mod h1:5KthKjThUjPkKAfTTtqEreCr5Lu5zYu78xfiSxo9KF4= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v0.31.0 h1:Om4H0ZDKWIhRDcVXSO5PQpWs8nuFg2qS39I9w8BD0Wg= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v0.31.0/go.mod h1:MBMdPulWDqlGeRIMt9KjAqJxhM69clkLz/cOrpCb3QY= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1 h1:uDSFv0UmCcrrqhRrTlP9l/YTSESnZkZIHdJVdVDYY/4= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1/go.mod h1:21JHC8cArZT+J7hgQZgS+4kx8s9SdSFIqxOmiR+sGto= +github.com/aws/aws-sdk-go-v2/service/route53 v0.31.0 h1:0qVkvLk5bfNwpV7jbWFeTNzwibf5UQox18t4OZRSGuM= +github.com/aws/aws-sdk-go-v2/service/route53 v0.31.0/go.mod h1:pAjhJw+tl3oKqX/SzArjU2KSKZs3qLzfG39rqAxM9w8= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 h1:cKr6St+CtC3/dl/rEBJvlk7A/IN5D5F02GNkGzfbtVU= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= +github.com/aws/aws-sdk-go-v2/service/s3 v0.31.0 h1:KDBpodyszhL8F83QYv36qBzDj99oPlt1coZNGSFKTXU= +github.com/aws/aws-sdk-go-v2/service/s3 v0.31.0/go.mod h1:KnvsmhsdHaJJZatMeNscBKaEmz0V5oXe1N5ZaLmGDBs= +github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 h1:p20kkvl+DwV3wYsnLGcmsspBzWGD6EsWKi/W+09Z1NI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0/go.mod h1:nHAD0aOk81kN3xdNYzKg4g9JISKSwRdUUDEXOgIojf4= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v0.31.0 h1:RPlRz535UVwpXtj7lWAL2HW7Lv8S0y/Jy+9sZHxtkdw= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v0.31.0/go.mod h1:C/lUWjIxMClzBE33jWymfvA9x5hb3busK6cuLg+0KT8= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 h1:tOZVE/wpwnCH6zMCvDi8WsuXLV1p5PG/WOhHu8LWphE= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1/go.mod h1:ytf+Mop8BTUFmWJSCI/U33FawS9A8UWwybOdNOXU6zE= +github.com/aws/aws-sdk-go-v2/service/securityhub v0.31.0 h1:Q3qiz1RVn+yRukseTf5j7OS/+66CQ7ig5DMOdWBGRtc= +github.com/aws/aws-sdk-go-v2/service/securityhub v0.31.0/go.mod h1:jLS1JPpsUrsrm2mdI6sOVJYdEoeBX/JwmKVE5C6+yxY= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1 h1:80QYiUXqf6EHmxhW3wk9VGaGuem7GAeW2TcJj7hc0Do= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1/go.mod h1:M/Eb/iVz5QLNeFxNP10Ww6uYarHvm8X1SaTc23NhoYw= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v0.31.0 h1:H9BTjvHO5WVURQgxaF4TYA/5JPnV/oGv/3dwgZTGqkY= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v0.31.0/go.mod h1:hJAjGj2cz8HMandRgfte82mGHBsZH7JCn4G2OyeDrLo= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1 h1:5qx3KZq6WyQnX+gvLuU6sLBBWJulFrVn7sZoe+9GpJQ= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1/go.mod h1:AxJdVkbAHbnhUhUP3cFgMGEe288M8+YDXW7gbcdqOtQ= +github.com/aws/aws-sdk-go-v2/service/ses v0.31.0 h1:LGG/StZLR73+UlY2HDklSkj8hP3qm0Zod8Z90iQG+44= +github.com/aws/aws-sdk-go-v2/service/ses v0.31.0/go.mod h1:A/++wHjcpV2TKYvmLhrQkZwmyI/GfShxefgvM35zUJ8= +github.com/aws/aws-sdk-go-v2/service/ses v1.1.1 h1:ZCT1HdrWSIt8014g2Wia7B1SpytNh9EGZ/qKpZvRVgA= +github.com/aws/aws-sdk-go-v2/service/ses v1.1.1/go.mod h1:U9bdibu41007uBclE2QUdURjHU6SzQKqxY5GKppL7gE= +github.com/aws/aws-sdk-go-v2/service/sfn v0.31.0 h1:CPy3AD5FJyqP3s3npH02N/786tyG1/hHwk9M0qTz5vY= +github.com/aws/aws-sdk-go-v2/service/sfn v0.31.0/go.mod h1:lOKatGV5faT6PowqlJUUCsk9MlAl2MLPB+r0dEs5lm8= +github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1 h1:GexTkfjidovrPhnvLrX2ggMo7pooiZJfZw/K1MOwe/o= +github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1/go.mod h1:e1kcDzRmGL4UoKqMcyJT344yqMivOXIftV+O1H6fixY= +github.com/aws/aws-sdk-go-v2/service/sns v0.31.0 h1:wbuobXnoDBp5R8tLcK6INVWqiyedymFReSBoEsfI3VQ= +github.com/aws/aws-sdk-go-v2/service/sns v0.31.0/go.mod h1:z2sDp3+VSVK29ymUSY23ECKpKgUjePTDoBGDWa2s8t8= +github.com/aws/aws-sdk-go-v2/service/sns v1.1.1 h1:5Js3R6coB5uI/h/Gua2Vm+uyuZrgmXs80zqtkOBumxk= +github.com/aws/aws-sdk-go-v2/service/sns v1.1.1/go.mod h1:V2HdUZQcKhcF58AwYU78fkQ5Drfw3qAGMUd9o1uvrf8= +github.com/aws/aws-sdk-go-v2/service/sqs v0.31.0 h1:KWDgaC5RRb8ind8+b1+EveN7ywQ+2+KgQP8UJN9ao/c= +github.com/aws/aws-sdk-go-v2/service/sqs v0.31.0/go.mod h1:fl3rAHxyXa29C+IDaKxR2C1nxw6bKIIoPm45pKBubcs= +github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1 h1:T1fzWyfSgTNfFwpePwG9l0re3HWHprjUId/zy1Q4YvM= +github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1/go.mod h1:vT8RRjBL5Z9KBZGGhjLcG6pngVLeq7MqySFsNdGFjSc= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 h1:37QubsarExl5ZuCBlnRP+7l1tNwZPBSTqpTBrPH98RU= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= +github.com/aws/aws-sdk-go-v2/service/sts v0.31.0 h1:iJwlIyswoW4VM8RUmhC3397jdGa6QhMUtUf5daX+/a0= +github.com/aws/aws-sdk-go-v2/service/sts v0.31.0/go.mod h1:gliVu4/DZsKINvBoEcMIlxMIQft/yPYQhnSLxwiWqFM= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 h1:TJoIfnIFubCX0ACVeJ0w46HEH5MwjwYN4iFhuYIhfIY= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= +github.com/aws/aws-sdk-go-v2/service/swf v0.31.0 h1:SWpbVzSVgBkL+7nBVLBliqSs61THNR1z85zihiJzCR0= +github.com/aws/aws-sdk-go-v2/service/swf v0.31.0/go.mod h1:1rgCDRbQ1Yc9NsAXrjbAeu6oUhgn0lpnv235Ul/tRUs= +github.com/aws/aws-sdk-go-v2/service/swf v1.1.1 h1:EStZ7gUWjg5++OVEZu3xjfIkD8hD4dGqV+9EwHtjfDo= +github.com/aws/aws-sdk-go-v2/service/swf v1.1.1/go.mod h1:bbRKpQC4O12+BLlo6k67OyXWeJB8jWQwcmmKLrJgQVQ= +github.com/aws/aws-sdk-go-v2/service/waf v0.31.0 h1:XV0dF9pK9dnh7zHvloULsGsGE/3B3/3jXqkQct3PEDw= +github.com/aws/aws-sdk-go-v2/service/waf v0.31.0/go.mod h1:Qfq9m3y6DrrFTktcswXFo1EWCqF/kMWJBO4mYtR8dLE= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.1 h1:ttI5GZs4+1gUrjkO9ghNbu1TQ2jyO3DloZ8DRozl0VQ= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.1/go.mod h1:aSpFbfXuliA/KIQ6EfxYRXSJlnXpMfwUEPY7v5XtABw= +github.com/aws/aws-sdk-go-v2/service/wafregional v0.31.0 h1:tWZdulq3jaGxA6PmQuygBzG9GB18RZfJD9mXsgkXDz4= +github.com/aws/aws-sdk-go-v2/service/wafregional v0.31.0/go.mod h1:XIfwlh8iurBBeZZvfQ2zYRns/iftFGVu0oxZ09Uc4O4= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1 h1:4UytI/MUBqd9Be5DgWXwWuzSRvbt6S4B5toSgbAZlEw= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1/go.mod h1:rcc9EDUl/wpNAF+7AvKKh/r2fP6kpl8buDxwQ5Ep6ak= +github.com/aws/aws-sdk-go-v2/service/workspaces v0.31.0 h1:eZZUV8lZgxGPck/dKWC6bXxfLn1DmN3cC1dhSJc/Oso= +github.com/aws/aws-sdk-go-v2/service/workspaces v0.31.0/go.mod h1:8Q0T7Es63j2zfSaunZqBtiF8fJPwvSxHMgH/E6ic6LU= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1 h1:QXIL9UoGbmATmspJ8v+OMp4er7K/q8ZQ5O0/iyfAG2w= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1/go.mod h1:/EpCu/KcalvPnsyM8zYgXCQ+dStC43HbtCO0hInHZP8= +github.com/aws/aws-sdk-go-v2/service/xray v0.31.0 h1:f4TePHb8RuEUK0K5KonchrBVuE2nQPuHfzBt0tDGrTI= +github.com/aws/aws-sdk-go-v2/service/xray v0.31.0/go.mod h1:kiTKEma8t39zVRcumMkp2612YQPqIDfN0lwhSYiF/Xw= +github.com/aws/aws-sdk-go-v2/service/xray v1.1.1 h1:KdBCrnM+HnMW/On4O6EQ9OhiM3Fz0hrpvMhzIRY1/eY= +github.com/aws/aws-sdk-go-v2/service/xray v1.1.1/go.mod h1:yXqbCaS1hC9CrShJsTrshudAvR/pspjeIRDbMpPRrC0= +github.com/aws/smithy-go v0.5.0 h1:ArsdWUrb1n6/V/REXhuwq2TZv+kuqOBpMlGBd2EkDYM= +github.com/aws/smithy-go v0.5.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/aws/smithy-go v1.1.0 h1:D6CSsM3gdxaGaqXnPgOBCeL6Mophqzu7KJOu7zW78sU= +github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -275,6 +565,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj9zFpCNE+UDefwwFRijKjzvHNCM= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655 h1:hKQ7ba/nVgQ0sGq8KBWJ7hdm0CEN48AlIYjBmfzCQzQ= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= @@ -698,6 +989,7 @@ github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= @@ -731,6 +1023,7 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= diff --git a/providers/aws/accessanalyzer.go b/providers/aws/accessanalyzer.go index d464d3e801..1bc2840e76 100644 --- a/providers/aws/accessanalyzer.go +++ b/providers/aws/accessanalyzer.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer" ) @@ -33,12 +32,16 @@ func (g *AccessAnalyzerGenerator) InitResources() error { if e != nil { return e } - svc := accessanalyzer.New(config) - p := accessanalyzer.NewListAnalyzersPaginator(svc.ListAnalyzersRequest(&accessanalyzer.ListAnalyzersInput{})) + svc := accessanalyzer.NewFromConfig(config) + p := accessanalyzer.NewListAnalyzersPaginator(svc, &accessanalyzer.ListAnalyzersInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, analyzer := range p.CurrentPage().Analyzers { - resourceName := aws.StringValue(analyzer.Name) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, analyzer := range page.Analyzers { + resourceName := *analyzer.Name resources = append(resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -48,5 +51,5 @@ func (g *AccessAnalyzerGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/aws_service.go b/providers/aws/aws_service.go index 1dc2e9e6bc..c53ead18fe 100644 --- a/providers/aws/aws_service.go +++ b/providers/aws/aws_service.go @@ -22,8 +22,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sts" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/external" - "github.com/aws/aws-sdk-go-v2/aws/stscreds" + "github.com/aws/aws-sdk-go-v2/config" "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -41,10 +40,10 @@ func (s *AWSService) generateConfig() (aws.Config, error) { return config, e } if s.Verbose { - config.LogLevel = aws.LogDebugWithHTTPBody + config.ClientLogMode = aws.LogRequestWithBody & aws.LogResponseWithBody & aws.LogRetries } - creds, e := config.Credentials.Retrieve(context.Background()) + creds, e := config.Credentials.Retrieve(context.TODO()) if e != nil { return config, e @@ -66,11 +65,10 @@ func (s *AWSService) generateConfig() (aws.Config, error) { func (s *AWSService) buildBaseConfig() (aws.Config, error) { if s.GetArgs()["region"].(string) != "" { - return external.LoadDefaultAWSConfig( - external.WithRegion(s.GetArgs()["region"].(string)), - external.WithMFATokenFunc(stscreds.StdinTokenProvider)) + + return config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-west-2")) } - return external.LoadDefaultAWSConfig(external.WithMFATokenFunc(stscreds.StdinTokenProvider)) + return config.LoadDefaultConfig(context.TODO()) } // for CF interpolation and IAM Policy variables @@ -79,8 +77,8 @@ func (*AWSService) escapeAwsInterpolation(str string) string { } func (s *AWSService) getAccountNumber(config aws.Config) (*string, error) { - stsSvc := sts.New(config) - identity, err := stsSvc.GetCallerIdentityRequest(&sts.GetCallerIdentityInput{}).Send(context.Background()) + stsSvc := sts.NewFromConfig(config) + identity, err := stsSvc.GetCallerIdentity(context.TODO(), &sts.GetCallerIdentityInput{}) if err != nil { return nil, err } diff --git a/providers/aws/ec2.go b/providers/aws/ec2.go index 7e970aa565..112c7de6c5 100644 --- a/providers/aws/ec2.go +++ b/providers/aws/ec2.go @@ -22,6 +22,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) var ec2AllowEmptyValues = []string{"tags."} @@ -35,39 +36,43 @@ func (g *Ec2Generator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - var filters []ec2.Filter + svc := ec2.NewFromConfig(config) + var filters []types.Filter for _, filter := range g.Filter { if strings.HasPrefix(filter.FieldPath, "tags.") && filter.IsApplicable("instance") { - filters = append(filters, ec2.Filter{ + filters = append(filters, types.Filter{ Name: aws.String("tag:" + strings.TrimPrefix(filter.FieldPath, "tags.")), Values: filter.AcceptableValues, }) } } - p := ec2.NewDescribeInstancesPaginator(svc.DescribeInstancesRequest(&ec2.DescribeInstancesInput{ + p := ec2.NewDescribeInstancesPaginator(svc, &ec2.DescribeInstancesInput{ Filters: filters, - })) - for p.Next(context.Background()) { - for _, reservation := range p.CurrentPage().Reservations { + }) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, reservation := range page.Reservations { for _, instance := range reservation.Instances { name := "" for _, tag := range instance.Tags { - if strings.ToLower(aws.StringValue(tag.Key)) == "name" { - name = aws.StringValue(tag.Value) + if strings.ToLower(*tag.Key) == "name" { + name = *tag.Value } } - attr, err := svc.DescribeInstanceAttributeRequest(&ec2.DescribeInstanceAttributeInput{ - Attribute: ec2.InstanceAttributeNameUserData, + attr, err := svc.DescribeInstanceAttribute(context.TODO(), &ec2.DescribeInstanceAttributeInput{ + Attribute: types.InstanceAttributeNameUserData, InstanceId: instance.InstanceId, - }).Send(context.Background()) + }) userDataBase64 := "" if err == nil && attr.UserData != nil && attr.UserData.Value != nil { - userDataBase64 = aws.StringValue(attr.UserData.Value) + userDataBase64 = *attr.UserData.Value } r := terraformutils.NewResource( - aws.StringValue(instance.InstanceId), - aws.StringValue(instance.InstanceId)+"_"+name, + *instance.InstanceId, + *instance.InstanceId+"_"+name, "aws_instance", "aws", map[string]string{ @@ -81,7 +86,7 @@ func (g *Ec2Generator) InitResources() error { } } } - return p.Err() + return nil } func (g *Ec2Generator) PostConvertHook() error { diff --git a/providers/aws/s3.go b/providers/aws/s3.go index ebff73571f..0076adc8ca 100644 --- a/providers/aws/s3.go +++ b/providers/aws/s3.go @@ -38,7 +38,7 @@ type S3Generator struct { // createResources iterate on all buckets // for each bucket we check region and choose only bucket from set region // for each bucket try get bucket policy, if policy exist create additional NewTerraformResource for policy -func (g *S3Generator) createResources(config aws.Config, buckets *s3.ListBucketsResponse, region string) []terraformutils.Resource { +func (g *S3Generator) createResources(config aws.Config, buckets *s3.ListBucketsOutput, region string) []terraformutils.Resource { resources := []terraformutils.Resource{} svc := s3.New(config) for _, bucket := range buckets.Buckets { @@ -89,7 +89,7 @@ func (g *S3Generator) InitResources() error { if e != nil { return e } - svc := s3.New(config) + svc := s3.NewFromConfig(config) buckets, err := svc.ListBucketsRequest(&s3.ListBucketsInput{}).Send(context.Background()) if err != nil { From 91b74535b911c27b2b34c76351af19b913955e21 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 21 Feb 2021 01:15:19 +0800 Subject: [PATCH 099/276] #549 refactored second batch of services --- go.mod | 1 - providers/aws/acm.go | 27 ++++--- providers/aws/alb.go | 77 +++++++++++--------- providers/aws/api_gateway.go | 121 +++++++++++++++++++------------- providers/aws/appsync.go | 6 +- providers/aws/autoscaling.go | 50 ++++++++----- providers/aws/aws_provider.go | 7 ++ providers/aws/aws_service.go | 4 +- providers/aws/budgets.go | 10 +-- providers/aws/cloud9.go | 13 ++-- providers/aws/cloud_front.go | 19 ++--- providers/aws/cloudformation.go | 29 ++++---- providers/aws/cloudhsm.go | 25 ++++--- providers/aws/cloudtrail.go | 10 +-- 14 files changed, 230 insertions(+), 169 deletions(-) diff --git a/go.mod b/go.mod index 256f93900d..5bdd49c3c7 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,6 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go v1.36.19 github.com/aws/aws-sdk-go-v2 v1.2.0 github.com/aws/aws-sdk-go-v2/config v1.1.1 github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 diff --git a/providers/aws/acm.go b/providers/aws/acm.go index 161e902194..a0f6bc0501 100644 --- a/providers/aws/acm.go +++ b/providers/aws/acm.go @@ -21,7 +21,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/acm" ) @@ -34,30 +33,30 @@ type ACMGenerator struct { } func (g *ACMGenerator) createCertificatesResources(svc *acm.Client) []terraformutils.Resource { - resources := []terraformutils.Resource{} - p := acm.NewListCertificatesPaginator(svc.ListCertificatesRequest(&acm.ListCertificatesInput{})) - for p.Next(context.Background()) { - for _, cert := range p.CurrentPage().CertificateSummaryList { - certArn := aws.StringValue(cert.CertificateArn) + var resources []terraformutils.Resource + p := acm.NewListCertificatesPaginator(svc, &acm.ListCertificatesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + log.Println(err) + return resources + } + for _, cert := range page.CertificateSummaryList { + certArn := *cert.CertificateArn certID := extractCertificateUUID(certArn) resources = append(resources, terraformutils.NewResource( certArn, - certID+"_"+strings.TrimSuffix(aws.StringValue(cert.DomainName), "."), + certID+"_"+strings.TrimSuffix(*cert.DomainName, "."), "aws_acm_certificate", "aws", map[string]string{ - "domain_name": aws.StringValue(cert.DomainName), + "domain_name": *cert.DomainName, }, acmAllowEmptyValues, acmAdditionalFields, )) } } - - if err := p.Err(); err != nil { - log.Println(err) - return resources - } return resources } @@ -68,7 +67,7 @@ func (g *ACMGenerator) InitResources() error { if e != nil { return e } - svc := acm.New(config) + svc := acm.NewFromConfig(config) g.Resources = g.createCertificatesResources(svc) return nil diff --git a/providers/aws/alb.go b/providers/aws/alb.go index 1770b3f38a..50c295b8dd 100644 --- a/providers/aws/alb.go +++ b/providers/aws/alb.go @@ -22,6 +22,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" "github.com/hashicorp/terraform/helper/resource" ) @@ -32,12 +33,16 @@ type AlbGenerator struct { } func (g *AlbGenerator) loadLB(svc *elasticloadbalancingv2.Client) error { - p := elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(svc.DescribeLoadBalancersRequest(&elasticloadbalancingv2.DescribeLoadBalancersInput{})) - for p.Next(context.Background()) { - for _, lb := range p.CurrentPage().LoadBalancers { - resourceName := aws.StringValue(lb.LoadBalancerName) + p := elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(svc, &elasticloadbalancingv2.DescribeLoadBalancersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, lb := range page.LoadBalancers { + resourceName := StringValue(lb.LoadBalancerName) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(lb.LoadBalancerArn), + *lb.LoadBalancerArn, resourceName, "aws_lb", "aws", @@ -49,14 +54,18 @@ func (g *AlbGenerator) loadLB(svc *elasticloadbalancingv2.Client) error { } } } - return p.Err() + return nil } func (g *AlbGenerator) loadLBListener(svc *elasticloadbalancingv2.Client, loadBalancerArn *string) error { - p := elasticloadbalancingv2.NewDescribeListenersPaginator(svc.DescribeListenersRequest(&elasticloadbalancingv2.DescribeListenersInput{LoadBalancerArn: loadBalancerArn})) - for p.Next(context.Background()) { - for _, ls := range p.CurrentPage().Listeners { - resourceName := aws.StringValue(ls.ListenerArn) + p := elasticloadbalancingv2.NewDescribeListenersPaginator(svc, &elasticloadbalancingv2.DescribeListenersInput{LoadBalancerArn: loadBalancerArn}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, ls := range page.Listeners { + resourceName := *ls.ListenerArn g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -74,23 +83,23 @@ func (g *AlbGenerator) loadLBListener(svc *elasticloadbalancingv2.Client, loadBa } } } - return p.Err() + return nil } func (g *AlbGenerator) loadLBListenerRule(svc *elasticloadbalancingv2.Client, listenerArn *string) error { var marker *string for { - lsrs, err := svc.DescribeRulesRequest(&elasticloadbalancingv2.DescribeRulesInput{ + lsrs, err := svc.DescribeRules(context.TODO(), &elasticloadbalancingv2.DescribeRulesInput{ ListenerArn: listenerArn, Marker: marker, - PageSize: aws.Int64(400)}, - ).Send(context.Background()) + PageSize: aws.Int32(400)}, + ) if err != nil { return err } for _, lsr := range lsrs.Rules { - if !aws.BoolValue(lsr.IsDefault) { - resourceName := aws.StringValue(lsr.RuleArn) + if !lsr.IsDefault { + resourceName := *lsr.RuleArn g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -108,15 +117,15 @@ func (g *AlbGenerator) loadLBListenerRule(svc *elasticloadbalancingv2.Client, li return nil } -func (g *AlbGenerator) loadLBListenerCertificate(svc *elasticloadbalancingv2.Client, loadBalancer *elasticloadbalancingv2.Listener) error { - lcs, err := svc.DescribeListenerCertificatesRequest(&elasticloadbalancingv2.DescribeListenerCertificatesInput{ +func (g *AlbGenerator) loadLBListenerCertificate(svc *elasticloadbalancingv2.Client, loadBalancer *types.Listener) error { + lcs, err := svc.DescribeListenerCertificates(context.TODO(), &elasticloadbalancingv2.DescribeListenerCertificatesInput{ ListenerArn: loadBalancer.ListenerArn, - }).Send(context.Background()) + }) if err != nil { return err } for _, lc := range lcs.Certificates { - certificateArn := aws.StringValue(lc.CertificateArn) + certificateArn := *lc.CertificateArn if certificateArn == *loadBalancer.Certificates[0].CertificateArn { // discard default certificate continue } @@ -137,12 +146,16 @@ func (g *AlbGenerator) loadLBListenerCertificate(svc *elasticloadbalancingv2.Cli } func (g *AlbGenerator) loadLBTargetGroup(svc *elasticloadbalancingv2.Client) error { - p := elasticloadbalancingv2.NewDescribeTargetGroupsPaginator(svc.DescribeTargetGroupsRequest(&elasticloadbalancingv2.DescribeTargetGroupsInput{})) - for p.Next(context.Background()) { - for _, tg := range p.CurrentPage().TargetGroups { - resourceName := aws.StringValue(tg.TargetGroupName) + p := elasticloadbalancingv2.NewDescribeTargetGroupsPaginator(svc, &elasticloadbalancingv2.DescribeTargetGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, tg := range page.TargetGroups { + resourceName := StringValue(tg.TargetGroupName) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(tg.TargetGroupArn), + *tg.TargetGroupArn, resourceName, "aws_lb_target_group", "aws", @@ -154,26 +167,26 @@ func (g *AlbGenerator) loadLBTargetGroup(svc *elasticloadbalancingv2.Client) err } } } - return p.Err() + return nil } func (g *AlbGenerator) loadTargetGroupTargets(svc *elasticloadbalancingv2.Client, targetGroupArn *string) error { - targetHealths, err := svc.DescribeTargetHealthRequest(&elasticloadbalancingv2.DescribeTargetHealthInput{ + targetHealths, err := svc.DescribeTargetHealth(context.TODO(), &elasticloadbalancingv2.DescribeTargetHealthInput{ TargetGroupArn: targetGroupArn, - }).Send(context.Background()) + }) if err != nil { return err } for _, tgh := range targetHealths.TargetHealthDescriptions { - id := resource.PrefixedUniqueId(fmt.Sprintf("%s-", aws.StringValue(targetGroupArn))) + id := resource.PrefixedUniqueId(fmt.Sprintf("%s-", *targetGroupArn)) g.Resources = append(g.Resources, terraformutils.NewResource( id, id, "aws_lb_target_group_attachment", "aws", map[string]string{ - "target_id": aws.StringValue(tgh.Target.Id), - "target_group_arn": aws.StringValue(targetGroupArn), + "target_id": *tgh.Target.Id, + "target_group_arn": *targetGroupArn, }, AlbAllowEmptyValues, map[string]interface{}{}, @@ -188,7 +201,7 @@ func (g *AlbGenerator) InitResources() error { if e != nil { return e } - svc := elasticloadbalancingv2.New(config) + svc := elasticloadbalancingv2.NewFromConfig(config) if err := g.loadLB(svc); err != nil { return err } diff --git a/providers/aws/api_gateway.go b/providers/aws/api_gateway.go index c0d5c652ca..97fb1bc4eb 100644 --- a/providers/aws/api_gateway.go +++ b/providers/aws/api_gateway.go @@ -16,13 +16,14 @@ package aws import ( "context" + "github.com/IBM/ibm-cos-sdk-go/aws" "log" "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/GoogleCloudPlatform/terraformer/terraformutils/terraformerstring" "github.com/aws/aws-sdk-go-v2/service/apigateway" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go-v2/service/apigateway/types" ) var apiGatewayAllowEmptyValues = []string{"tags.", "parent_id", "path_part"} @@ -36,7 +37,7 @@ func (g *APIGatewayGenerator) InitResources() error { if e != nil { return e } - svc := apigateway.New(config) + svc := apigateway.NewFromConfig(config) if err := g.loadRestApis(svc); err != nil { return err @@ -52,9 +53,13 @@ func (g *APIGatewayGenerator) InitResources() error { } func (g *APIGatewayGenerator) loadRestApis(svc *apigateway.Client) error { - p := apigateway.NewGetRestApisPaginator(svc.GetRestApisRequest(&apigateway.GetRestApisInput{})) - for p.Next(context.Background()) { - for _, restAPI := range p.CurrentPage().Items { + p := apigateway.NewGetRestApisPaginator(svc, &apigateway.GetRestApisInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, restAPI := range page.Items { if g.shouldFilterRestAPI(restAPI.Tags) { continue } @@ -84,7 +89,7 @@ func (g *APIGatewayGenerator) loadRestApis(svc *apigateway.Client) error { } } } - return p.Err() + return nil } func (g *APIGatewayGenerator) shouldFilterRestAPI(tags map[string]string) bool { @@ -101,14 +106,14 @@ func (g *APIGatewayGenerator) shouldFilterRestAPI(tags map[string]string) bool { } func (g *APIGatewayGenerator) loadStages(svc *apigateway.Client, restAPIID *string) error { - output, err := svc.GetStagesRequest(&apigateway.GetStagesInput{ + output, err := svc.GetStages(context.TODO(), &apigateway.GetStagesInput{ RestApiId: restAPIID, - }).Send(context.Background()) + }) if err != nil { return err } - for _, stage := range output.GetStagesOutput.Item { - stageID := *restAPIID + "/" + *stage.StageName + for _, stage := range output.Item { + stageID := *restAPIID + "/" + StringValue(stage.StageName) g.Resources = append(g.Resources, terraformutils.NewResource( stageID, stageID, @@ -126,11 +131,15 @@ func (g *APIGatewayGenerator) loadStages(svc *apigateway.Client, restAPIID *stri } func (g *APIGatewayGenerator) loadResources(svc *apigateway.Client, restAPIID *string) error { - p := apigateway.NewGetResourcesPaginator(svc.GetResourcesRequest(&apigateway.GetResourcesInput{ + p := apigateway.NewGetResourcesPaginator(svc, &apigateway.GetResourcesInput{ RestApiId: restAPIID, - })) - for p.Next(context.Background()) { - for _, resource := range p.CurrentPage().Items { + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, resource := range page.Items { resourceID := *resource.Id g.Resources = append(g.Resources, terraformutils.NewResource( resourceID, @@ -138,10 +147,10 @@ func (g *APIGatewayGenerator) loadResources(svc *apigateway.Client, restAPIID *s "aws_api_gateway_resource", "aws", map[string]string{ - "path": aws.StringValue(resource.Path), - "path_part": aws.StringValue(resource.PathPart), - "partent_id": aws.StringValue(resource.ParentId), - "rest_api_id": aws.StringValue(restAPIID), + "path": StringValue(resource.Path), + "path_part": StringValue(resource.PathPart), + "partent_id": StringValue(resource.ParentId), + "rest_api_id": StringValue(restAPIID), }, apiGatewayAllowEmptyValues, map[string]interface{}{}, @@ -152,15 +161,19 @@ func (g *APIGatewayGenerator) loadResources(svc *apigateway.Client, restAPIID *s } } } - return p.Err() + return nil } func (g *APIGatewayGenerator) loadModels(svc *apigateway.Client, restAPIID *string) error { - p := apigateway.NewGetModelsPaginator(svc.GetModelsRequest(&apigateway.GetModelsInput{ + p := apigateway.NewGetModelsPaginator(svc, &apigateway.GetModelsInput{ RestApiId: restAPIID, - })) - for p.Next(context.Background()) { - for _, model := range p.CurrentPage().Items { + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return nil + } + for _, model := range page.Items { resourceID := *model.Id g.Resources = append(g.Resources, terraformutils.NewResource( resourceID, @@ -168,20 +181,20 @@ func (g *APIGatewayGenerator) loadModels(svc *apigateway.Client, restAPIID *stri "aws_api_gateway_model", "aws", map[string]string{ - "name": aws.StringValue(model.Name), - "content_type": aws.StringValue(model.ContentType), - "schema": aws.StringValue(model.Schema), - "rest_api_id": aws.StringValue(restAPIID), + "name": StringValue(model.Name), + "content_type": StringValue(model.ContentType), + "schema": StringValue(model.Schema), + "rest_api_id": StringValue(restAPIID), }, apiGatewayAllowEmptyValues, map[string]interface{}{}, )) } } - return p.Err() + return nil } -func (g *APIGatewayGenerator) loadResourceMethods(svc *apigateway.Client, restAPIID *string, resource apigateway.Resource) error { +func (g *APIGatewayGenerator) loadResourceMethods(svc *apigateway.Client, restAPIID *string, resource types.Resource) error { for httpMethod, method := range resource.ResourceMethods { methodID := *restAPIID + "/" + *resource.Id + "/" + httpMethod authorizationType := "NONE" @@ -204,17 +217,17 @@ func (g *APIGatewayGenerator) loadResourceMethods(svc *apigateway.Client, restAP map[string]interface{}{}, )) - methodDetails, err := svc.GetMethodRequest(&apigateway.GetMethodInput{ + methodDetails, err := svc.GetMethod(context.TODO(), &apigateway.GetMethodInput{ HttpMethod: &httpMethod, ResourceId: resource.Id, RestApiId: restAPIID, - }).Send(context.Background()) + }) if err != nil { return err } if methodDetails.MethodIntegration != nil { - typeString, _ := methodDetails.MethodIntegration.Type.MarshalValue() + typeString := string(methodDetails.MethodIntegration.Type) g.Resources = append(g.Resources, terraformutils.NewResource( methodID, methodID, @@ -229,11 +242,11 @@ func (g *APIGatewayGenerator) loadResourceMethods(svc *apigateway.Client, restAP apiGatewayAllowEmptyValues, map[string]interface{}{}, )) - integrationDetails, err := svc.GetIntegrationRequest(&apigateway.GetIntegrationInput{ + integrationDetails, err := svc.GetIntegration(context.TODO(), &apigateway.GetIntegrationInput{ HttpMethod: &httpMethod, ResourceId: resource.Id, RestApiId: restAPIID, - }).Send(context.Background()) + }) if err != nil { return err } @@ -281,18 +294,18 @@ func (g *APIGatewayGenerator) loadResourceMethods(svc *apigateway.Client, restAP func (g *APIGatewayGenerator) loadResponses(svc *apigateway.Client, restAPIID *string) error { var position *string for { - response, err := svc.GetGatewayResponsesRequest(&apigateway.GetGatewayResponsesInput{ + response, err := svc.GetGatewayResponses(context.TODO(), &apigateway.GetGatewayResponsesInput{ RestApiId: restAPIID, Position: position, - }).Send(context.Background()) + }) if err != nil { return err } for _, response := range response.Items { - if aws.BoolValue(response.DefaultResponse) { + if response.DefaultResponse { continue } - responseTypeString, _ := response.ResponseType.MarshalValue() + responseTypeString := string(response.ResponseType) responseID := *restAPIID + "/" + responseTypeString g.Resources = append(g.Resources, terraformutils.NewResource( responseID, @@ -318,10 +331,10 @@ func (g *APIGatewayGenerator) loadResponses(svc *apigateway.Client, restAPIID *s func (g *APIGatewayGenerator) loadDocumentationParts(svc *apigateway.Client, restAPIID *string) error { var position *string for { - response, err := svc.GetDocumentationPartsRequest(&apigateway.GetDocumentationPartsInput{ + response, err := svc.GetDocumentationParts(context.TODO(), &apigateway.GetDocumentationPartsInput{ RestApiId: restAPIID, Position: position, - }).Send(context.Background()) + }) if err != nil { return err } @@ -346,10 +359,10 @@ func (g *APIGatewayGenerator) loadDocumentationParts(svc *apigateway.Client, res func (g *APIGatewayGenerator) loadAuthorizers(svc *apigateway.Client, restAPIID *string) error { var position *string for { - response, err := svc.GetAuthorizersRequest(&apigateway.GetAuthorizersInput{ + response, err := svc.GetAuthorizers(context.TODO(), &apigateway.GetAuthorizersInput{ RestApiId: restAPIID, Position: position, - }).Send(context.Background()) + }) if err != nil { return err } @@ -376,9 +389,13 @@ func (g *APIGatewayGenerator) loadAuthorizers(svc *apigateway.Client, restAPIID } func (g *APIGatewayGenerator) loadVpcLinks(svc *apigateway.Client) error { - p := apigateway.NewGetVpcLinksPaginator(svc.GetVpcLinksRequest(&apigateway.GetVpcLinksInput{})) - for p.Next(context.Background()) { - for _, vpcLink := range p.CurrentPage().Items { + p := apigateway.NewGetVpcLinksPaginator(svc, &apigateway.GetVpcLinksInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, vpcLink := range page.Items { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *vpcLink.Id, *vpcLink.Name, @@ -387,13 +404,17 @@ func (g *APIGatewayGenerator) loadVpcLinks(svc *apigateway.Client) error { apiGatewayAllowEmptyValues)) } } - return p.Err() + return nil } func (g *APIGatewayGenerator) loadUsagePlans(svc *apigateway.Client) error { - p := apigateway.NewGetUsagePlansPaginator(svc.GetUsagePlansRequest(&apigateway.GetUsagePlansInput{})) - for p.Next(context.Background()) { - for _, usagePlan := range p.CurrentPage().Items { + p := apigateway.NewGetUsagePlansPaginator(svc, &apigateway.GetUsagePlansInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, usagePlan := range page.Items { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *usagePlan.Id, *usagePlan.Name, @@ -402,5 +423,5 @@ func (g *APIGatewayGenerator) loadUsagePlans(svc *apigateway.Client) error { apiGatewayAllowEmptyValues)) } } - return p.Err() + return nil } diff --git a/providers/aws/appsync.go b/providers/aws/appsync.go index 92700ccd89..af8180e6f4 100644 --- a/providers/aws/appsync.go +++ b/providers/aws/appsync.go @@ -17,13 +17,13 @@ func (g *AppSyncGenerator) InitResources() error { return e } - svc := appsync.New(config) + svc := appsync.NewFromConfig(config) var nextToken *string for { - apis, err := svc.ListGraphqlApisRequest(&appsync.ListGraphqlApisInput{ + apis, err := svc.ListGraphqlApis(context.TODO(), &appsync.ListGraphqlApisInput{ NextToken: nextToken, - }).Send(context.Background()) + }) if err != nil { return err } diff --git a/providers/aws/autoscaling.go b/providers/aws/autoscaling.go index fb696d5ceb..b6038d0733 100644 --- a/providers/aws/autoscaling.go +++ b/providers/aws/autoscaling.go @@ -32,10 +32,14 @@ type AutoScalingGenerator struct { } func (g *AutoScalingGenerator) loadAutoScalingGroups(svc *autoscaling.Client) error { - p := autoscaling.NewDescribeAutoScalingGroupsPaginator(svc.DescribeAutoScalingGroupsRequest(&autoscaling.DescribeAutoScalingGroupsInput{})) - for p.Next(context.Background()) { - for _, asg := range p.CurrentPage().AutoScalingGroups { - resourceName := aws.StringValue(asg.AutoScalingGroupName) + p := autoscaling.NewDescribeAutoScalingGroupsPaginator(svc, &autoscaling.DescribeAutoScalingGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, asg := range page.AutoScalingGroups { + resourceName := StringValue(asg.AutoScalingGroupName) g.Resources = append(g.Resources, terraformutils.NewResource( resourceName, resourceName, @@ -51,17 +55,21 @@ func (g *AutoScalingGenerator) loadAutoScalingGroups(svc *autoscaling.Client) er )) } } - return p.Err() + return nil } func (g *AutoScalingGenerator) loadLaunchConfigurations(svc *autoscaling.Client) error { - p := autoscaling.NewDescribeLaunchConfigurationsPaginator(svc.DescribeLaunchConfigurationsRequest(&autoscaling.DescribeLaunchConfigurationsInput{})) - for p.Next(context.Background()) { - for _, lc := range p.CurrentPage().LaunchConfigurations { - resourceName := aws.StringValue(lc.LaunchConfigurationName) + p := autoscaling.NewDescribeLaunchConfigurationsPaginator(svc, &autoscaling.DescribeLaunchConfigurationsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, lc := range page.LaunchConfigurations { + resourceName := StringValue(lc.LaunchConfigurationName) attributes := map[string]string{} // only for LaunchConfigurations with userdata, we want get user_data_base64 - if aws.StringValue(lc.UserData) != "" { + if StringValue(lc.UserData) != "" { attributes["user_data_base64"] = "=" // need set not empty string to get user_data_base64 from provider } g.Resources = append(g.Resources, terraformutils.NewResource( @@ -75,25 +83,29 @@ func (g *AutoScalingGenerator) loadLaunchConfigurations(svc *autoscaling.Client) )) } } - return p.Err() + return nil } func (g *AutoScalingGenerator) loadLaunchTemplates(config aws.Config) error { - ec2svc := ec2.New(config) + ec2svc := ec2.NewFromConfig(config) - p := ec2.NewDescribeLaunchTemplatesPaginator(ec2svc.DescribeLaunchTemplatesRequest(&ec2.DescribeLaunchTemplatesInput{})) - for p.Next(context.Background()) { - for _, lt := range p.CurrentPage().LaunchTemplates { + p := ec2.NewDescribeLaunchTemplatesPaginator(ec2svc, &ec2.DescribeLaunchTemplatesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, lt := range page.LaunchTemplates { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(lt.LaunchTemplateId), - aws.StringValue(lt.LaunchTemplateName), + StringValue(lt.LaunchTemplateId), + StringValue(lt.LaunchTemplateName), "aws_launch_template", "aws", AsgAllowEmptyValues, )) } } - return p.Err() + return nil } // Generate TerraformResources from AWS API, @@ -105,7 +117,7 @@ func (g *AutoScalingGenerator) InitResources() error { if e != nil { return e } - svc := autoscaling.New(config) + svc := autoscaling.NewFromConfig(config) if err := g.loadAutoScalingGroups(svc); err != nil { return err } diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index 982a7a9bee..1e96ee65a4 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -305,3 +305,10 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "xray": &AwsFacade{service: &XrayGenerator{}}, } } + +func StringValue(value *string) string { + if value != nil { + return *value + } + return "" +} diff --git a/providers/aws/aws_service.go b/providers/aws/aws_service.go index c53ead18fe..fc0cb28177 100644 --- a/providers/aws/aws_service.go +++ b/providers/aws/aws_service.go @@ -64,8 +64,10 @@ func (s *AWSService) generateConfig() (aws.Config, error) { } func (s *AWSService) buildBaseConfig() (aws.Config, error) { + if s.GetArgs()["profile"].(string) != "" { + os.Setenv("AWS_PROFILE", s.GetArgs()["profile"].(string)) + } if s.GetArgs()["region"].(string) != "" { - return config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-west-2")) } return config.LoadDefaultConfig(context.TODO()) diff --git a/providers/aws/budgets.go b/providers/aws/budgets.go index d6e72d3df5..b8e62ac7e8 100644 --- a/providers/aws/budgets.go +++ b/providers/aws/budgets.go @@ -19,18 +19,18 @@ import ( "fmt" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/budgets" + "github.com/aws/aws-sdk-go-v2/service/budgets/types" ) type BudgetsGenerator struct { AWSService } -func (g *BudgetsGenerator) createResources(budgets []budgets.Budget, account *string) []terraformutils.Resource { +func (g *BudgetsGenerator) createResources(budgets []types.Budget, account *string) []terraformutils.Resource { var resources []terraformutils.Resource for _, budget := range budgets { - resourceName := aws.StringValue(budget.BudgetName) + resourceName := StringValue(budget.BudgetName) resources = append(resources, terraformutils.NewSimpleResource( fmt.Sprintf("%s:%s", *account, resourceName), resourceName, @@ -46,14 +46,14 @@ func (g *BudgetsGenerator) InitResources() error { if e != nil { return e } - budgetsSvc := budgets.New(config) + budgetsSvc := budgets.NewFromConfig(config) account, err := g.getAccountNumber(config) if err != nil { return err } - output, err := budgetsSvc.DescribeBudgetsRequest(&budgets.DescribeBudgetsInput{AccountId: account}).Send(context.Background()) + output, err := budgetsSvc.DescribeBudgets(context.TODO(), &budgets.DescribeBudgetsInput{AccountId: account}) if err != nil { return err } diff --git a/providers/aws/cloud9.go b/providers/aws/cloud9.go index ad55f04caf..7aadd23cb3 100644 --- a/providers/aws/cloud9.go +++ b/providers/aws/cloud9.go @@ -19,6 +19,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/cloud9" + "github.com/aws/aws-sdk-go-v2/service/cloud9/types" ) var cloud9AllowEmptyValues = []string{"tags."} @@ -32,17 +33,17 @@ func (g *Cloud9Generator) InitResources() error { if e != nil { return e } - svc := cloud9.New(config) - output, err := svc.ListEnvironmentsRequest(&cloud9.ListEnvironmentsInput{}).Send(context.Background()) + svc := cloud9.NewFromConfig(config) + output, err := svc.ListEnvironments(context.TODO(), &cloud9.ListEnvironmentsInput{}) if err != nil { return err } for _, environmentID := range output.EnvironmentIds { - details, _ := svc.DescribeEnvironmentStatusRequest(&cloud9.DescribeEnvironmentStatusInput{ + details, _ := svc.DescribeEnvironmentStatus(context.TODO(), &cloud9.DescribeEnvironmentStatusInput{ EnvironmentId: &environmentID, - }).Send(context.Background()) - if details.Status == cloud9.EnvironmentStatusError || - details.Status == cloud9.EnvironmentStatusDeleting { + }) + if details.Status == types.EnvironmentStatusError || + details.Status == types.EnvironmentStatusDeleting { continue } g.Resources = append(g.Resources, terraformutils.NewSimpleResource( diff --git a/providers/aws/cloud_front.go b/providers/aws/cloud_front.go index 481d05bea2..b7f63bec49 100644 --- a/providers/aws/cloud_front.go +++ b/providers/aws/cloud_front.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudfront" ) @@ -33,13 +32,17 @@ func (g *CloudFrontGenerator) InitResources() error { if e != nil { return e } - svc := cloudfront.New(config) - p := cloudfront.NewListDistributionsPaginator(svc.ListDistributionsRequest(&cloudfront.ListDistributionsInput{})) - for p.Next(context.Background()) { - for _, distribution := range p.CurrentPage().DistributionList.Items { + svc := cloudfront.NewFromConfig(config) + p := cloudfront.NewListDistributionsPaginator(svc, &cloudfront.ListDistributionsInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, distribution := range page.DistributionList.Items { r := terraformutils.NewResource( - aws.StringValue(distribution.Id), - aws.StringValue(distribution.Id), + StringValue(distribution.Id), + StringValue(distribution.Id), "aws_cloudfront_distribution", "aws", map[string]string{ @@ -52,5 +55,5 @@ func (g *CloudFrontGenerator) InitResources() error { g.Resources = append(g.Resources, r) } } - return p.Err() + return nil } diff --git a/providers/aws/cloudformation.go b/providers/aws/cloudformation.go index d722cf585b..6ced466105 100644 --- a/providers/aws/cloudformation.go +++ b/providers/aws/cloudformation.go @@ -18,8 +18,8 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudformation" + "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" ) var cloudFormationAllowEmptyValues = []string{"tags."} @@ -33,11 +33,15 @@ func (g *CloudFormationGenerator) InitResources() error { if e != nil { return e } - svc := cloudformation.New(config) - p := cloudformation.NewListStacksPaginator(svc.ListStacksRequest(&cloudformation.ListStacksInput{})) - for p.Next(context.Background()) { - for _, stackSummary := range p.CurrentPage().StackSummaries { - if stackSummary.StackStatus == cloudformation.StackStatusDeleteComplete { + svc := cloudformation.NewFromConfig(config) + p := cloudformation.NewListStacksPaginator(svc, &cloudformation.ListStacksInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, stackSummary := range page.StackSummaries { + if stackSummary.StackStatus == types.StackStatusDeleteComplete { continue } g.Resources = append(g.Resources, terraformutils.NewSimpleResource( @@ -49,15 +53,12 @@ func (g *CloudFormationGenerator) InitResources() error { )) } } - if err := p.Err(); err != nil { - return err - } - stackSets, err := svc.ListStackSetsRequest(&cloudformation.ListStackSetsInput{}).Send(context.Background()) + stackSets, err := svc.ListStackSets(context.TODO(), &cloudformation.ListStackSetsInput{}) if err != nil { return err } for _, stackSetSummary := range stackSets.Summaries { - if stackSetSummary.Status == cloudformation.StackSetStatusDeleted { + if stackSetSummary.Status == types.StackSetStatusDeleted { continue } g.Resources = append(g.Resources, terraformutils.NewSimpleResource( @@ -68,14 +69,14 @@ func (g *CloudFormationGenerator) InitResources() error { cloudFormationAllowEmptyValues, )) - stackSetInstances, err := svc.ListStackInstancesRequest(&cloudformation.ListStackInstancesInput{ + stackSetInstances, err := svc.ListStackInstances(context.TODO(), &cloudformation.ListStackInstancesInput{ StackSetName: stackSetSummary.StackSetName, - }).Send(context.Background()) + }) if err != nil { return err } for _, stackSetI := range stackSetInstances.Summaries { - id := aws.StringValue(stackSetI.StackSetId) + "," + aws.StringValue(stackSetI.Account) + "," + aws.StringValue(stackSetI.Region) + id := StringValue(stackSetI.StackSetId) + "," + StringValue(stackSetI.Account) + "," + StringValue(stackSetI.Region) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( id, diff --git a/providers/aws/cloudhsm.go b/providers/aws/cloudhsm.go index 1f89bed0b4..a06ae2bf88 100644 --- a/providers/aws/cloudhsm.go +++ b/providers/aws/cloudhsm.go @@ -19,7 +19,6 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" ) var cloudHsmAllowEmptyValues = []string{"tags."} @@ -33,14 +32,18 @@ func (g *CloudHsmGenerator) InitResources() error { if e != nil { return e } - svc := cloudhsmv2.New(config) + svc := cloudhsmv2.NewFromConfig(config) - p := cloudhsmv2.NewDescribeClustersPaginator(svc.DescribeClustersRequest(&cloudhsmv2.DescribeClustersInput{})) - for p.Next(context.Background()) { - for _, cluster := range p.CurrentPage().Clusters { + p := cloudhsmv2.NewDescribeClustersPaginator(svc, &cloudhsmv2.DescribeClustersInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, cluster := range page.Clusters { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(cluster.ClusterId), - aws.StringValue(cluster.ClusterId), + StringValue(cluster.ClusterId), + StringValue(cluster.ClusterId), "aws_cloudhsm_v2_cluster", "aws", cloudHsmAllowEmptyValues, @@ -48,12 +51,12 @@ func (g *CloudHsmGenerator) InitResources() error { for _, hsm := range cluster.Hsms { g.Resources = append(g.Resources, terraformutils.NewResource( - aws.StringValue(hsm.HsmId), - aws.StringValue(hsm.HsmId), + StringValue(hsm.HsmId), + StringValue(hsm.HsmId), "aws_cloudhsm_v2_hsm", "aws", map[string]string{ - "cluster_id": aws.StringValue(hsm.ClusterId), + "cluster_id": StringValue(hsm.ClusterId), }, cloudHsmAllowEmptyValues, map[string]interface{}{}, @@ -62,5 +65,5 @@ func (g *CloudHsmGenerator) InitResources() error { } } } - return p.Err() + return nil } diff --git a/providers/aws/cloudtrail.go b/providers/aws/cloudtrail.go index d7afeadd28..9de73cd02a 100644 --- a/providers/aws/cloudtrail.go +++ b/providers/aws/cloudtrail.go @@ -18,8 +18,8 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudtrail" + "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" ) var cloudtrailAllowEmptyValues = []string{"tags."} @@ -28,10 +28,10 @@ type CloudTrailGenerator struct { AWSService } -func (g *CloudTrailGenerator) createResources(trailList []cloudtrail.Trail) []terraformutils.Resource { +func (g *CloudTrailGenerator) createResources(trailList []types.Trail) []terraformutils.Resource { var resources []terraformutils.Resource for _, trail := range trailList { - resourceName := aws.StringValue(trail.Name) + resourceName := StringValue(trail.Name) resources = append(resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -47,8 +47,8 @@ func (g *CloudTrailGenerator) InitResources() error { if e != nil { return e } - svc := cloudtrail.New(config) - output, err := svc.DescribeTrailsRequest(&cloudtrail.DescribeTrailsInput{}).Send(context.Background()) + svc := cloudtrail.NewFromConfig(config) + output, err := svc.DescribeTrails(context.TODO(), &cloudtrail.DescribeTrailsInput{}) if err != nil { return err } From d1a60f1b10c38bdeddedcdf6fd97cacc2bdb536b Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 21 Feb 2021 16:23:02 +0800 Subject: [PATCH 100/276] #549 refactored another batch of services --- go.sum | 1 + providers/aws/cloudwatch.go | 20 ++-- providers/aws/codebuild.go | 13 +- providers/aws/codecommit.go | 17 +-- providers/aws/codedeploy.go | 14 ++- providers/aws/codepipeline.go | 31 +++-- providers/aws/cognito.go | 39 +++--- providers/aws/config.go | 15 +-- providers/aws/customer_gateway.go | 11 +- providers/aws/datapipeline.go | 19 +-- providers/aws/devicefarm.go | 19 +-- providers/aws/dynamodb.go | 14 ++- providers/aws/ebs.go | 49 ++++---- providers/aws/ecr.go | 14 ++- providers/aws/ecs.go | 53 +++++---- providers/aws/efs.go | 52 ++++---- providers/aws/eip.go | 9 +- providers/aws/eks.go | 14 ++- providers/aws/elastic_beanstalk.go | 9 +- providers/aws/elasticache.go | 61 ++++++---- providers/aws/elb.go | 17 +-- providers/aws/emr.go | 26 ++-- providers/aws/eni.go | 20 ++-- providers/aws/es.go | 12 +- providers/aws/firehose.go | 4 +- providers/aws/glue.go | 38 ++++-- providers/aws/iam.go | 185 +++++++++++++++++------------ providers/aws/igw.go | 21 ++-- providers/aws/iot.go | 10 +- providers/aws/kinesis.go | 22 +++- 30 files changed, 484 insertions(+), 345 deletions(-) diff --git a/go.sum b/go.sum index cb689b1f13..502e56f88d 100644 --- a/go.sum +++ b/go.sum @@ -168,6 +168,7 @@ github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3A github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA= github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= diff --git a/providers/aws/cloudwatch.go b/providers/aws/cloudwatch.go index c74ae28102..3cb3408609 100644 --- a/providers/aws/cloudwatch.go +++ b/providers/aws/cloudwatch.go @@ -34,7 +34,7 @@ func (g *CloudWatchGenerator) InitResources() error { return e } - cloudwatchSvc := cloudwatch.New(config) + cloudwatchSvc := cloudwatch.NewFromConfig(config) err := g.createMetricAlarms(cloudwatchSvc) if err != nil { return err @@ -44,7 +44,7 @@ func (g *CloudWatchGenerator) InitResources() error { return err } - cloudwatcheventsSvc := cloudwatchevents.New(config) + cloudwatcheventsSvc := cloudwatchevents.NewFromConfig(config) err = g.createRules(cloudwatcheventsSvc) if err != nil { return err @@ -56,9 +56,9 @@ func (g *CloudWatchGenerator) InitResources() error { func (g *CloudWatchGenerator) createMetricAlarms(cloudwatchSvc *cloudwatch.Client) error { var nextToken *string for { - output, err := cloudwatchSvc.DescribeAlarmsRequest(&cloudwatch.DescribeAlarmsInput{ + output, err := cloudwatchSvc.DescribeAlarms(context.TODO(), &cloudwatch.DescribeAlarmsInput{ NextToken: nextToken, - }).Send(context.Background()) + }) if err != nil { return err } @@ -81,9 +81,9 @@ func (g *CloudWatchGenerator) createMetricAlarms(cloudwatchSvc *cloudwatch.Clien func (g *CloudWatchGenerator) createDashboards(cloudwatchSvc *cloudwatch.Client) error { var nextToken *string for { - output, err := cloudwatchSvc.ListDashboardsRequest(&cloudwatch.ListDashboardsInput{ + output, err := cloudwatchSvc.ListDashboards(context.TODO(), &cloudwatch.ListDashboardsInput{ NextToken: nextToken, - }).Send(context.Background()) + }) if err != nil { return err } @@ -106,9 +106,9 @@ func (g *CloudWatchGenerator) createDashboards(cloudwatchSvc *cloudwatch.Client) func (g *CloudWatchGenerator) createRules(cloudwatcheventsSvc *cloudwatchevents.Client) error { var listRulesNextToken *string for { - output, err := cloudwatcheventsSvc.ListRulesRequest(&cloudwatchevents.ListRulesInput{ + output, err := cloudwatcheventsSvc.ListRules(context.TODO(), &cloudwatchevents.ListRulesInput{ NextToken: listRulesNextToken, - }).Send(context.Background()) + }) if err != nil { return err } @@ -122,10 +122,10 @@ func (g *CloudWatchGenerator) createRules(cloudwatcheventsSvc *cloudwatchevents. var listTargetsNextToken *string for { - targetResponse, err := cloudwatcheventsSvc.ListTargetsByRuleRequest(&cloudwatchevents.ListTargetsByRuleInput{ + targetResponse, err := cloudwatcheventsSvc.ListTargetsByRule(context.TODO(), &cloudwatchevents.ListTargetsByRuleInput{ Rule: rule.Name, NextToken: listTargetsNextToken, - }).Send(context.Background()) + }) if err != nil { return err } diff --git a/providers/aws/codebuild.go b/providers/aws/codebuild.go index 00999c089a..74a2087a9d 100644 --- a/providers/aws/codebuild.go +++ b/providers/aws/codebuild.go @@ -45,11 +45,14 @@ func (g *CodeBuildGenerator) InitResources() error { if e != nil { return e } - svc := codebuild.New(config) - output, err := svc.ListProjectsRequest(&codebuild.ListProjectsInput{}).Send(context.Background()) - if err != nil { - return err + svc := codebuild.NewFromConfig(config) + p := codebuild.NewListProjectsPaginator(svc, &codebuild.ListProjectsInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + g.Resources = g.createResources(page.Projects) } - g.Resources = g.createResources(output.Projects) return nil } diff --git a/providers/aws/codecommit.go b/providers/aws/codecommit.go index aa573c5729..9cba5728f6 100644 --- a/providers/aws/codecommit.go +++ b/providers/aws/codecommit.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codecommit" ) @@ -33,12 +32,16 @@ func (g *CodeCommitGenerator) InitResources() error { if e != nil { return e } - svc := codecommit.New(config) - p := codecommit.NewListRepositoriesPaginator(svc.ListRepositoriesRequest(&codecommit.ListRepositoriesInput{})) + svc := codecommit.NewFromConfig(config) + p := codecommit.NewListRepositoriesPaginator(svc, &codecommit.ListRepositoriesInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, repository := range p.CurrentPage().Repositories { - resourceName := aws.StringValue(repository.RepositoryName) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, repository := range page.Repositories { + resourceName := StringValue(repository.RepositoryName) resources = append(resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -48,5 +51,5 @@ func (g *CodeCommitGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/codedeploy.go b/providers/aws/codedeploy.go index 8a31696e5e..f70a9ac8bc 100644 --- a/providers/aws/codedeploy.go +++ b/providers/aws/codedeploy.go @@ -33,11 +33,15 @@ func (g *CodeDeployGenerator) InitResources() error { if e != nil { return e } - svc := codedeploy.New(config) - p := codedeploy.NewListApplicationsPaginator(svc.ListApplicationsRequest(&codedeploy.ListApplicationsInput{})) + svc := codedeploy.NewFromConfig(config) + p := codedeploy.NewListApplicationsPaginator(svc, &codedeploy.ListApplicationsInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, application := range p.CurrentPage().Applications { + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, application := range page.Applications { resources = append(resources, terraformutils.NewSimpleResource( fmt.Sprintf(":%s", application), application, @@ -47,5 +51,5 @@ func (g *CodeDeployGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/codepipeline.go b/providers/aws/codepipeline.go index ad817de1c8..4a6ea3a44b 100644 --- a/providers/aws/codepipeline.go +++ b/providers/aws/codepipeline.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codepipeline" ) @@ -29,10 +28,14 @@ type CodePipelineGenerator struct { } func (g *CodePipelineGenerator) loadPipelines(svc *codepipeline.Client) error { - p := codepipeline.NewListPipelinesPaginator(svc.ListPipelinesRequest(&codepipeline.ListPipelinesInput{})) - for p.Next(context.Background()) { - for _, pipeline := range p.CurrentPage().Pipelines { - resourceName := aws.StringValue(pipeline.Name) + p := codepipeline.NewListPipelinesPaginator(svc, &codepipeline.ListPipelinesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, pipeline := range page.Pipelines { + resourceName := StringValue(pipeline.Name) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -41,14 +44,18 @@ func (g *CodePipelineGenerator) loadPipelines(svc *codepipeline.Client) error { codepipelineAllowEmptyValues)) } } - return p.Err() + return nil } func (g *CodePipelineGenerator) loadWebhooks(svc *codepipeline.Client) error { - p := codepipeline.NewListWebhooksPaginator(svc.ListWebhooksRequest(&codepipeline.ListWebhooksInput{})) - for p.Next(context.Background()) { - for _, webhook := range p.CurrentPage().Webhooks { - resourceArn := aws.StringValue(webhook.Arn) + p := codepipeline.NewListWebhooksPaginator(svc, &codepipeline.ListWebhooksInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, webhook := range page.Webhooks { + resourceArn := StringValue(webhook.Arn) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceArn, resourceArn, @@ -57,7 +64,7 @@ func (g *CodePipelineGenerator) loadWebhooks(svc *codepipeline.Client) error { codepipelineAllowEmptyValues)) } } - return p.Err() + return nil } func (g *CodePipelineGenerator) InitResources() error { @@ -65,7 +72,7 @@ func (g *CodePipelineGenerator) InitResources() error { if e != nil { return e } - svc := codepipeline.New(config) + svc := codepipeline.NewFromConfig(config) if err := g.loadPipelines(svc); err != nil { return err diff --git a/providers/aws/cognito.go b/providers/aws/cognito.go index 8bfe805e8b..a05834b4a8 100644 --- a/providers/aws/cognito.go +++ b/providers/aws/cognito.go @@ -16,17 +16,15 @@ type CognitoGenerator struct { const CognitoMaxResults = 60 // Required field for Cognito API func (g *CognitoGenerator) loadIdentityPools(svc *cognitoidentity.Client) error { - var nextToken *string - for { - pools, err := svc.ListIdentityPoolsRequest(&cognitoidentity.ListIdentityPoolsInput{ - NextToken: nextToken, - MaxResults: aws.Int64(CognitoMaxResults), - }).Send(context.Background()) + p := cognitoidentity.NewListIdentityPoolsPaginator(svc, &cognitoidentity.ListIdentityPoolsInput{ + MaxResults: *aws.Int32(CognitoMaxResults), + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) if err != nil { return err } - - for _, pool := range pools.IdentityPools { + for _, pool := range page.IdentityPools { var id = *pool.IdentityPoolId var resourceName = *pool.IdentityPoolName g.Resources = append(g.Resources, terraformutils.NewSimpleResource( @@ -36,22 +34,21 @@ func (g *CognitoGenerator) loadIdentityPools(svc *cognitoidentity.Client) error "aws", []string{})) } - - nextToken = pools.NextToken - if nextToken == nil { - break - } } return nil } func (g *CognitoGenerator) loadUserPools(svc *cognitoidentityprovider.Client) error { - req := svc.ListUserPoolsRequest(&cognitoidentityprovider.ListUserPoolsInput{MaxResults: aws.Int64(CognitoMaxResults)}) - p := cognitoidentityprovider.NewListUserPoolsPaginator(req) + p := cognitoidentityprovider.NewListUserPoolsPaginator(svc, &cognitoidentityprovider.ListUserPoolsInput{ + MaxResults: *aws.Int32(CognitoMaxResults), + }) - for p.Next(context.Background()) { - page := p.CurrentPage() + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } for _, pool := range page.UserPools { id := *pool.Id resourceName := *pool.Name @@ -63,10 +60,6 @@ func (g *CognitoGenerator) loadUserPools(svc *cognitoidentityprovider.Client) er []string{})) } } - - if err := p.Err(); err != nil { - return err - } return nil } @@ -76,11 +69,11 @@ func (g *CognitoGenerator) InitResources() error { return e } - svcCognitoIdentity := cognitoidentity.New(config) + svcCognitoIdentity := cognitoidentity.NewFromConfig(config) if err := g.loadIdentityPools(svcCognitoIdentity); err != nil { return err } - svcCognitoIdentityProvider := cognitoidentityprovider.New(config) + svcCognitoIdentityProvider := cognitoidentityprovider.NewFromConfig(config) if err := g.loadUserPools(svcCognitoIdentityProvider); err != nil { return err } diff --git a/providers/aws/config.go b/providers/aws/config.go index b8dda51497..5395d2d38d 100644 --- a/providers/aws/config.go +++ b/providers/aws/config.go @@ -32,7 +32,7 @@ func (g *ConfigGenerator) InitResources() error { if e != nil { return e } - client := configservice.New(config) + client := configservice.NewFromConfig(config) configurationRecorderRefs, err := g.addConfigurationRecorders(client) if err != nil { @@ -47,8 +47,8 @@ func (g *ConfigGenerator) InitResources() error { } func (g *ConfigGenerator) addConfigurationRecorders(svc *configservice.Client) ([]string, error) { - configurationRecorders, err := svc.DescribeConfigurationRecordersRequest( - &configservice.DescribeConfigurationRecordersInput{}).Send(context.Background()) + configurationRecorders, err := svc.DescribeConfigurationRecorders(context.TODO(), + &configservice.DescribeConfigurationRecordersInput{}) if err != nil { return nil, err @@ -73,10 +73,11 @@ func (g *ConfigGenerator) addConfigRules(svc *configservice.Client, configuratio var nextToken *string for { - configRules, err := svc.DescribeConfigRulesRequest( + configRules, err := svc.DescribeConfigRules( + context.TODO(), &configservice.DescribeConfigRulesInput{ NextToken: nextToken, - }).Send(context.Background()) + }) if err != nil { return err @@ -104,8 +105,8 @@ func (g *ConfigGenerator) addConfigRules(svc *configservice.Client, configuratio } func (g *ConfigGenerator) addDeliveryChannels(svc *configservice.Client, configurationRecorderRefs []string) error { - deliveryChannels, err := svc.DescribeDeliveryChannelsRequest( - &configservice.DescribeDeliveryChannelsInput{}).Send(context.Background()) + deliveryChannels, err := svc.DescribeDeliveryChannels(context.TODO(), + &configservice.DescribeDeliveryChannelsInput{}) if err != nil { return err diff --git a/providers/aws/customer_gateway.go b/providers/aws/customer_gateway.go index ae741b3b61..bc6d08ca54 100644 --- a/providers/aws/customer_gateway.go +++ b/providers/aws/customer_gateway.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -29,12 +28,12 @@ type CustomerGatewayGenerator struct { AWSService } -func (CustomerGatewayGenerator) createResources(cgws *ec2.DescribeCustomerGatewaysResponse) []terraformutils.Resource { +func (CustomerGatewayGenerator) createResources(cgws *ec2.DescribeCustomerGatewaysOutput) []terraformutils.Resource { resources := []terraformutils.Resource{} for _, cgws := range cgws.CustomerGateways { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(cgws.CustomerGatewayId), - aws.StringValue(cgws.CustomerGatewayId), + StringValue(cgws.CustomerGatewayId), + StringValue(cgws.CustomerGatewayId), "aws_customer_gateway", "aws", customerGatewayAllowEmptyValues, @@ -51,8 +50,8 @@ func (g *CustomerGatewayGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - cgws, err := svc.DescribeCustomerGatewaysRequest(&ec2.DescribeCustomerGatewaysInput{}).Send(context.Background()) + svc := ec2.NewFromConfig(config) + cgws, err := svc.DescribeCustomerGateways(context.TODO(), &ec2.DescribeCustomerGatewaysInput{}) if err != nil { return err } diff --git a/providers/aws/datapipeline.go b/providers/aws/datapipeline.go index 78a39f064a..d470bc9c2f 100644 --- a/providers/aws/datapipeline.go +++ b/providers/aws/datapipeline.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/datapipeline" ) @@ -33,13 +32,17 @@ func (g *DataPipelineGenerator) InitResources() error { if e != nil { return e } - svc := datapipeline.New(config) - p := datapipeline.NewListPipelinesPaginator(svc.ListPipelinesRequest(&datapipeline.ListPipelinesInput{})) + svc := datapipeline.NewFromConfig(config) + p := datapipeline.NewListPipelinesPaginator(svc, &datapipeline.ListPipelinesInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, pipeline := range p.CurrentPage().PipelineIdList { - pipelineID := aws.StringValue(pipeline.Id) - pipelineName := aws.StringValue(pipeline.Name) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, pipeline := range page.PipelineIdList { + pipelineID := StringValue(pipeline.Id) + pipelineName := StringValue(pipeline.Name) resources = append(resources, terraformutils.NewSimpleResource( pipelineID, pipelineName, @@ -49,5 +52,5 @@ func (g *DataPipelineGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/devicefarm.go b/providers/aws/devicefarm.go index f2e992dab1..fb38eb99cf 100644 --- a/providers/aws/devicefarm.go +++ b/providers/aws/devicefarm.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/devicefarm" ) @@ -33,13 +32,17 @@ func (g *DeviceFarmGenerator) InitResources() error { if e != nil { return e } - svc := devicefarm.New(config) - p := devicefarm.NewListProjectsPaginator(svc.ListProjectsRequest(&devicefarm.ListProjectsInput{})) + svc := devicefarm.NewFromConfig(config) + p := devicefarm.NewListProjectsPaginator(svc, &devicefarm.ListProjectsInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, project := range p.CurrentPage().Projects { - projectArn := aws.StringValue(project.Arn) - projectName := aws.StringValue(project.Name) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, project := range page.Projects { + projectArn := StringValue(project.Arn) + projectName := StringValue(project.Name) resources = append(resources, terraformutils.NewSimpleResource( projectArn, projectName, @@ -49,5 +52,5 @@ func (g *DeviceFarmGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/dynamodb.go b/providers/aws/dynamodb.go index 99077e8e90..88d8df8931 100644 --- a/providers/aws/dynamodb.go +++ b/providers/aws/dynamodb.go @@ -32,10 +32,14 @@ func (g *DynamoDbGenerator) InitResources() error { if e != nil { return e } - svc := dynamodb.New(config) - p := dynamodb.NewListTablesPaginator(svc.ListTablesRequest(&dynamodb.ListTablesInput{})) - for p.Next(context.Background()) { - for _, tableName := range p.CurrentPage().TableNames { + svc := dynamodb.NewFromConfig(config) + p := dynamodb.NewListTablesPaginator(svc, &dynamodb.ListTablesInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, tableName := range page.TableNames { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( tableName, tableName, @@ -45,7 +49,7 @@ func (g *DynamoDbGenerator) InitResources() error { )) } } - return p.Err() + return nil } func (g *DynamoDbGenerator) PostConvertHook() error { diff --git a/providers/aws/ebs.go b/providers/aws/ebs.go index f36dab0901..857a5569e7 100644 --- a/providers/aws/ebs.go +++ b/providers/aws/ebs.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform/helper/hashcode" "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) var ebsAllowEmptyValues = []string{"tags."} @@ -41,30 +42,34 @@ func (g *EbsGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - var filters []ec2.Filter + svc := ec2.NewFromConfig(config) + var filters []types.Filter for _, filter := range g.Filter { if strings.HasPrefix(filter.FieldPath, "tags.") && filter.IsApplicable("ebs_volume") { - filters = append(filters, ec2.Filter{ + filters = append(filters, types.Filter{ Name: aws.String("tag:" + strings.TrimPrefix(filter.FieldPath, "tags.")), Values: filter.AcceptableValues, }) } } - p := ec2.NewDescribeVolumesPaginator(svc.DescribeVolumesRequest(&ec2.DescribeVolumesInput{ + p := ec2.NewDescribeVolumesPaginator(svc, &ec2.DescribeVolumesInput{ Filters: filters, - })) - for p.Next(context.Background()) { - for _, volume := range p.CurrentPage().Volumes { + }) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, volume := range page.Volumes { isRootDevice := false // Let's leave root device configuration to be done in ec2_instance resources for _, attachment := range volume.Attachments { - instances, _ := svc.DescribeInstancesRequest(&ec2.DescribeInstancesInput{ - InstanceIds: []string{aws.StringValue(attachment.InstanceId)}, - }).Send(context.Background()) + instances, _ := svc.DescribeInstances(context.TODO(), &ec2.DescribeInstancesInput{ + InstanceIds: []string{StringValue(attachment.InstanceId)}, + }) for _, reservation := range instances.Reservations { for _, instance := range reservation.Instances { - if aws.StringValue(instance.RootDeviceName) == aws.StringValue(attachment.Device) { + if StringValue(instance.RootDeviceName) == StringValue(attachment.Device) { isRootDevice = true } } @@ -73,28 +78,28 @@ func (g *EbsGenerator) InitResources() error { if !isRootDevice { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(volume.VolumeId), - aws.StringValue(volume.VolumeId), + StringValue(volume.VolumeId), + StringValue(volume.VolumeId), "aws_ebs_volume", "aws", ebsAllowEmptyValues, )) for _, attachment := range volume.Attachments { - if attachment.State == ec2.VolumeAttachmentStateAttached { + if attachment.State == types.VolumeAttachmentStateAttached { attachmentID := g.volumeAttachmentID( - aws.StringValue(attachment.Device), - aws.StringValue(attachment.VolumeId), - aws.StringValue(attachment.InstanceId)) + StringValue(attachment.Device), + StringValue(attachment.VolumeId), + StringValue(attachment.InstanceId)) g.Resources = append(g.Resources, terraformutils.NewResource( attachmentID, - aws.StringValue(attachment.InstanceId)+":"+aws.StringValue(attachment.Device), + StringValue(attachment.InstanceId)+":"+StringValue(attachment.Device), "aws_volume_attachment", "aws", map[string]string{ - "device_name": aws.StringValue(attachment.Device), - "volume_id": aws.StringValue(attachment.VolumeId), - "instance_id": aws.StringValue(attachment.InstanceId), + "device_name": StringValue(attachment.Device), + "volume_id": StringValue(attachment.VolumeId), + "instance_id": StringValue(attachment.InstanceId), }, []string{}, map[string]interface{}{}, @@ -104,5 +109,5 @@ func (g *EbsGenerator) InitResources() error { } } } - return p.Err() + return nil } diff --git a/providers/aws/ecr.go b/providers/aws/ecr.go index eca9a373b7..f5b3aec5a7 100644 --- a/providers/aws/ecr.go +++ b/providers/aws/ecr.go @@ -32,11 +32,15 @@ func (g *EcrGenerator) InitResources() error { if e != nil { return e } - svc := ecr.New(config) + svc := ecr.NewFromConfig(config) - p := ecr.NewDescribeRepositoriesPaginator(svc.DescribeRepositoriesRequest(&ecr.DescribeRepositoriesInput{})) - for p.Next(context.Background()) { - for _, repository := range p.CurrentPage().Repositories { + p := ecr.NewDescribeRepositoriesPaginator(svc, &ecr.DescribeRepositoriesInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, repository := range page.Repositories { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *repository.RepositoryName, *repository.RepositoryName, @@ -57,5 +61,5 @@ func (g *EcrGenerator) InitResources() error { ecrAllowEmptyValues)) } } - return p.Err() + return nil } diff --git a/providers/aws/ecs.go b/providers/aws/ecs.go index c15284fc6e..e0377376c8 100644 --- a/providers/aws/ecs.go +++ b/providers/aws/ecs.go @@ -17,11 +17,11 @@ package aws import ( "context" "fmt" + "github.com/IBM/ibm-cos-sdk-go/aws" "strconv" "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ecs" ) @@ -36,11 +36,15 @@ func (g *EcsGenerator) InitResources() error { if e != nil { return e } - svc := ecs.New(config) + svc := ecs.NewFromConfig(config) - p := ecs.NewListClustersPaginator(svc.ListClustersRequest(&ecs.ListClustersInput{})) - for p.Next(context.Background()) { - for _, clusterArn := range p.CurrentPage().ClusterArns { + p := ecs.NewListClustersPaginator(svc, &ecs.ListClustersInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, clusterArn := range page.ClusterArns { arnParts := strings.Split(clusterArn, "/") clusterName := arnParts[len(arnParts)-1] @@ -52,20 +56,25 @@ func (g *EcsGenerator) InitResources() error { ecsAllowEmptyValues, )) - servicePage := ecs.NewListServicesPaginator(svc.ListServicesRequest(&ecs.ListServicesInput{ - Cluster: aws.String(clusterArn), - })) - for servicePage.Next(context.Background()) { - for _, serviceArn := range servicePage.CurrentPage().ServiceArns { + servicePage := ecs.NewListServicesPaginator(svc, &ecs.ListServicesInput{ + Cluster: &clusterArn, + }) + for servicePage.HasMorePages() { + serviceNextPage, err := servicePage.NextPage(context.TODO()) + if err != nil { + fmt.Println(err.Error()) + continue + } + for _, serviceArn := range serviceNextPage.ServiceArns { arnParts := strings.Split(serviceArn, "/") serviceName := arnParts[len(arnParts)-1] - serResp, err := svc.DescribeServicesRequest(&ecs.DescribeServicesInput{ + serResp, err := svc.DescribeServices(context.TODO(), &ecs.DescribeServicesInput{ Services: []string{ serviceName, }, Cluster: aws.String(clusterArn), - }).Send(context.Background()) + }) if err != nil { fmt.Println(err.Error()) continue @@ -88,20 +97,18 @@ func (g *EcsGenerator) InitResources() error { )) } } - if err := servicePage.Err(); err != nil { - return err - } } } - if err := p.Err(); err != nil { - return err - } - taskDefinitionsMap := map[string]terraformutils.Resource{} - taskDefinitionsPage := ecs.NewListTaskDefinitionsPaginator(svc.ListTaskDefinitionsRequest(&ecs.ListTaskDefinitionsInput{})) - for taskDefinitionsPage.Next(context.Background()) { - for _, taskDefinitionArn := range taskDefinitionsPage.CurrentPage().TaskDefinitionArns { + taskDefinitionsPage := ecs.NewListTaskDefinitionsPaginator(svc, &ecs.ListTaskDefinitionsInput{}) + for taskDefinitionsPage.HasMorePages() { + taskDefinitionsNextPage, e := taskDefinitionsPage.NextPage(context.TODO()) + if e != nil { + fmt.Println(e.Error()) + continue + } + for _, taskDefinitionArn := range taskDefinitionsNextPage.TaskDefinitionArns { arnParts := strings.Split(taskDefinitionArn, ":") definitionWithFamily := arnParts[len(arnParts)-2] revision, _ := strconv.Atoi(arnParts[len(arnParts)-1]) @@ -132,7 +139,7 @@ func (g *EcsGenerator) InitResources() error { g.Resources = append(g.Resources, v) } - return taskDefinitionsPage.Err() + return nil } func (g *EcsGenerator) PostConvertHook() error { diff --git a/providers/aws/efs.go b/providers/aws/efs.go index 2e987e92a2..1f7eedf231 100644 --- a/providers/aws/efs.go +++ b/providers/aws/efs.go @@ -17,9 +17,9 @@ package aws import ( "context" "fmt" + "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/efs" ) @@ -34,7 +34,7 @@ func (g *EfsGenerator) InitResources() error { if e != nil { return e } - svc := efs.New(config) + svc := efs.NewFromConfig(config) if err := g.loadFileSystem(svc); err != nil { return err } @@ -48,19 +48,23 @@ func (g *EfsGenerator) InitResources() error { } func (g *EfsGenerator) loadFileSystem(svc *efs.Client) error { - p := efs.NewDescribeFileSystemsPaginator(svc.DescribeFileSystemsRequest(&efs.DescribeFileSystemsInput{})) - for p.Next(context.Background()) { - for _, fileSystem := range p.CurrentPage().FileSystems { + p := efs.NewDescribeFileSystemsPaginator(svc, &efs.DescribeFileSystemsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, fileSystem := range page.FileSystems { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(fileSystem.FileSystemId), - aws.StringValue(fileSystem.FileSystemId), + StringValue(fileSystem.FileSystemId), + StringValue(fileSystem.FileSystemId), "aws_efs_file_system", "aws", efsAllowEmptyValues)) - targetsResponse, err := svc.DescribeMountTargetsRequest(&efs.DescribeMountTargetsInput{ + targetsResponse, err := svc.DescribeMountTargets(context.TODO(), &efs.DescribeMountTargetsInput{ FileSystemId: fileSystem.FileSystemId, - }).Send(context.Background()) + }) if err != nil { fmt.Println(err.Error()) continue @@ -74,9 +78,9 @@ func (g *EfsGenerator) loadFileSystem(svc *efs.Client) error { efsAllowEmptyValues)) } - policyResponse, err := svc.DescribeFileSystemPolicyRequest(&efs.DescribeFileSystemPolicyInput{ + policyResponse, err := svc.DescribeFileSystemPolicy(context.TODO(), &efs.DescribeFileSystemPolicyInput{ FileSystemId: fileSystem.FileSystemId, - }).Send(context.Background()) + }) if err != nil { fmt.Println(err.Error()) continue @@ -97,13 +101,17 @@ POLICY`, escapedPolicy), map[string]interface{}{})) } } - return p.Err() + return nil } func (g *EfsGenerator) loadMountTarget(svc *efs.Client) error { - p := efs.NewDescribeFileSystemsPaginator(svc.DescribeFileSystemsRequest(&efs.DescribeFileSystemsInput{})) - for p.Next(context.Background()) { - for _, fileSystem := range p.CurrentPage().FileSystems { + p := efs.NewDescribeFileSystemsPaginator(svc, &efs.DescribeFileSystemsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, fileSystem := range page.FileSystems { id := aws.StringValue(fileSystem.FileSystemId) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( id, @@ -113,13 +121,17 @@ func (g *EfsGenerator) loadMountTarget(svc *efs.Client) error { efsAllowEmptyValues)) } } - return p.Err() + return nil } func (g *EfsGenerator) loadAccessPoint(svc *efs.Client) error { - p := efs.NewDescribeAccessPointsPaginator(svc.DescribeAccessPointsRequest(&efs.DescribeAccessPointsInput{})) - for p.Next(context.Background()) { - for _, fileSystem := range p.CurrentPage().AccessPoints { + p := efs.NewDescribeAccessPointsPaginator(svc, &efs.DescribeAccessPointsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, fileSystem := range page.AccessPoints { id := aws.StringValue(fileSystem.AccessPointId) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( id, @@ -129,5 +141,5 @@ func (g *EfsGenerator) loadAccessPoint(svc *efs.Client) error { efsAllowEmptyValues)) } } - return p.Err() + return nil } diff --git a/providers/aws/eip.go b/providers/aws/eip.go index 0bc4f2c2aa..8da4b032af 100644 --- a/providers/aws/eip.go +++ b/providers/aws/eip.go @@ -20,7 +20,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -32,7 +31,7 @@ type ElasticIPGenerator struct { func (g *ElasticIPGenerator) createElasticIpsResources(svc *ec2.Client) []terraformutils.Resource { resources := []terraformutils.Resource{} - addresses, err := svc.DescribeAddressesRequest(&ec2.DescribeAddressesInput{}).Send(context.Background()) + addresses, err := svc.DescribeAddresses(context.TODO(), &ec2.DescribeAddressesInput{}) if err != nil { log.Println(err) @@ -41,8 +40,8 @@ func (g *ElasticIPGenerator) createElasticIpsResources(svc *ec2.Client) []terraf for _, eip := range addresses.Addresses { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(eip.AllocationId), - aws.StringValue(eip.AllocationId), + StringValue(eip.AllocationId), + StringValue(eip.AllocationId), "aws_eip", "aws", eipAllowEmptyValues, @@ -59,7 +58,7 @@ func (g *ElasticIPGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) + svc := ec2.NewFromConfig(config) g.Resources = g.createElasticIpsResources(svc) return nil diff --git a/providers/aws/eks.go b/providers/aws/eks.go index 70b4c684df..a0c4d2150b 100644 --- a/providers/aws/eks.go +++ b/providers/aws/eks.go @@ -32,10 +32,14 @@ func (g *EksGenerator) InitResources() error { if e != nil { return e } - svc := eks.New(config) - p := eks.NewListClustersPaginator(svc.ListClustersRequest(&eks.ListClustersInput{})) - for p.Next(context.Background()) { - for _, clusterName := range p.CurrentPage().Clusters { + svc := eks.NewFromConfig(config) + p := eks.NewListClustersPaginator(svc, &eks.ListClustersInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, clusterName := range page.Clusters { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( clusterName, clusterName, @@ -45,5 +49,5 @@ func (g *EksGenerator) InitResources() error { )) } } - return p.Err() + return nil } diff --git a/providers/aws/elastic_beanstalk.go b/providers/aws/elastic_beanstalk.go index 9465c07699..dc269160e8 100644 --- a/providers/aws/elastic_beanstalk.go +++ b/providers/aws/elastic_beanstalk.go @@ -16,7 +16,6 @@ package aws import ( "context" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk" ) @@ -32,7 +31,7 @@ func (g *BeanstalkGenerator) InitResources() error { if e != nil { return e } - client := elasticbeanstalk.New(config) + client := elasticbeanstalk.NewFromConfig(config) err := g.addApplications(client) if err != nil { @@ -43,8 +42,7 @@ func (g *BeanstalkGenerator) InitResources() error { } func (g *BeanstalkGenerator) addApplications(client *elasticbeanstalk.Client) error { - request := client.DescribeApplicationsRequest(&elasticbeanstalk.DescribeApplicationsInput{}) - response, err := request.Send(context.Background()) + response, err := client.DescribeApplications(context.TODO(), &elasticbeanstalk.DescribeApplicationsInput{}) if err != nil { return err } @@ -61,8 +59,7 @@ func (g *BeanstalkGenerator) addApplications(client *elasticbeanstalk.Client) er } func (g *BeanstalkGenerator) addEnvironments(client *elasticbeanstalk.Client) error { - request := client.DescribeEnvironmentsRequest(&elasticbeanstalk.DescribeEnvironmentsInput{}) - response, err := request.Send(context.Background()) + response, err := client.DescribeEnvironments(context.TODO(), &elasticbeanstalk.DescribeEnvironmentsInput{}) if err != nil { return err } diff --git a/providers/aws/elasticache.go b/providers/aws/elasticache.go index 67a3c11afa..5fa6f10cd0 100644 --- a/providers/aws/elasticache.go +++ b/providers/aws/elasticache.go @@ -16,13 +16,12 @@ package aws import ( "context" + "github.com/IBM/ibm-cos-sdk-go/aws" "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/elasticache" - - "github.com/aws/aws-sdk-go-v2/aws" ) var elastiCacheAllowEmptyValues = []string{"tags."} @@ -32,10 +31,14 @@ type ElastiCacheGenerator struct { } func (g *ElastiCacheGenerator) loadCacheClusters(svc *elasticache.Client) error { - p := elasticache.NewDescribeCacheClustersPaginator(svc.DescribeCacheClustersRequest(&elasticache.DescribeCacheClustersInput{})) - for p.Next(context.Background()) { - for _, cluster := range p.CurrentPage().CacheClusters { - resourceName := aws.StringValue(cluster.CacheClusterId) + p := elasticache.NewDescribeCacheClustersPaginator(svc, &elasticache.DescribeCacheClustersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, cluster := range page.CacheClusters { + resourceName := StringValue(cluster.CacheClusterId) resource := terraformutils.NewSimpleResource( resourceName, resourceName, @@ -47,7 +50,7 @@ func (g *ElastiCacheGenerator) loadCacheClusters(svc *elasticache.Client) error // terraform-aws provider has ConflictsWith on ReplicationGroupId with all next attributes, // but return all attributes on refresh :( // https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_elasticache_cluster.go#L167 - if aws.StringValue(cluster.ReplicationGroupId) != "" { + if StringValue(cluster.ReplicationGroupId) != "" { resource.IgnoreKeys = append(resource.IgnoreKeys, "^availability_zones$", "^az_mode$", @@ -71,14 +74,18 @@ func (g *ElastiCacheGenerator) loadCacheClusters(svc *elasticache.Client) error g.Resources = append(g.Resources, resource) } } - return p.Err() + return nil } func (g *ElastiCacheGenerator) loadParameterGroups(svc *elasticache.Client) error { - p := elasticache.NewDescribeCacheParameterGroupsPaginator(svc.DescribeCacheParameterGroupsRequest(&elasticache.DescribeCacheParameterGroupsInput{})) - for p.Next(context.Background()) { - for _, parameterGroup := range p.CurrentPage().CacheParameterGroups { - resourceName := aws.StringValue(parameterGroup.CacheParameterGroupName) + p := elasticache.NewDescribeCacheParameterGroupsPaginator(svc, &elasticache.DescribeCacheParameterGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, parameterGroup := range page.CacheParameterGroups { + resourceName := StringValue(parameterGroup.CacheParameterGroupName) if strings.Contains(resourceName, ".") { continue // skip default Default ParameterGroups like default.redis5.0 } @@ -91,14 +98,18 @@ func (g *ElastiCacheGenerator) loadParameterGroups(svc *elasticache.Client) erro )) } } - return p.Err() + return nil } func (g *ElastiCacheGenerator) loadSubnetGroups(svc *elasticache.Client) error { - p := elasticache.NewDescribeCacheSubnetGroupsPaginator(svc.DescribeCacheSubnetGroupsRequest(&elasticache.DescribeCacheSubnetGroupsInput{})) - for p.Next(context.Background()) { - for _, subnet := range p.CurrentPage().CacheSubnetGroups { - resourceName := aws.StringValue(subnet.CacheSubnetGroupName) + p := elasticache.NewDescribeCacheSubnetGroupsPaginator(svc, &elasticache.DescribeCacheSubnetGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, subnet := range page.CacheSubnetGroups { + resourceName := StringValue(subnet.CacheSubnetGroupName) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -108,13 +119,17 @@ func (g *ElastiCacheGenerator) loadSubnetGroups(svc *elasticache.Client) error { )) } } - return p.Err() + return nil } func (g *ElastiCacheGenerator) loadReplicationGroups(svc *elasticache.Client) error { - p := elasticache.NewDescribeReplicationGroupsPaginator(svc.DescribeReplicationGroupsRequest(&elasticache.DescribeReplicationGroupsInput{})) - for p.Next(context.Background()) { - for _, replicationGroup := range p.CurrentPage().ReplicationGroups { + p := elasticache.NewDescribeReplicationGroupsPaginator(svc, &elasticache.DescribeReplicationGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, replicationGroup := range page.ReplicationGroups { resourceName := aws.StringValue(replicationGroup.ReplicationGroupId) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, @@ -125,7 +140,7 @@ func (g *ElastiCacheGenerator) loadReplicationGroups(svc *elasticache.Client) er )) } } - return p.Err() + return nil } // Generate TerraformResources from AWS API, @@ -137,7 +152,7 @@ func (g *ElastiCacheGenerator) InitResources() error { if e != nil { return e } - svc := elasticache.New(config) + svc := elasticache.NewFromConfig(config) if err := g.loadCacheClusters(svc); err != nil { return err diff --git a/providers/aws/elb.go b/providers/aws/elb.go index e88a3d4a5b..fdf47f510f 100644 --- a/providers/aws/elb.go +++ b/providers/aws/elb.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" ) @@ -37,11 +36,15 @@ func (g *ElbGenerator) InitResources() error { if e != nil { return e } - svc := elasticloadbalancing.New(config) - p := elasticloadbalancing.NewDescribeLoadBalancersPaginator(svc.DescribeLoadBalancersRequest(&elasticloadbalancing.DescribeLoadBalancersInput{})) - for p.Next(context.Background()) { - for _, loadBalancer := range p.CurrentPage().LoadBalancerDescriptions { - resourceName := aws.StringValue(loadBalancer.LoadBalancerName) + svc := elasticloadbalancing.NewFromConfig(config) + p := elasticloadbalancing.NewDescribeLoadBalancersPaginator(svc, &elasticloadbalancing.DescribeLoadBalancersInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + for _, loadBalancer := range page.LoadBalancerDescriptions { + resourceName := StringValue(loadBalancer.LoadBalancerName) resource := terraformutils.NewSimpleResource( resourceName, resourceName, @@ -53,5 +56,5 @@ func (g *ElbGenerator) InitResources() error { g.Resources = append(g.Resources, resource) } } - return p.Err() + return nil } diff --git a/providers/aws/emr.go b/providers/aws/emr.go index 707300e313..b894fac5a9 100644 --- a/providers/aws/emr.go +++ b/providers/aws/emr.go @@ -32,7 +32,7 @@ func (g *EmrGenerator) InitResources() error { if e != nil { return e } - client := emr.New(config) + client := emr.NewFromConfig(config) err := g.addClusters(client) if err != nil { @@ -43,9 +43,13 @@ func (g *EmrGenerator) InitResources() error { } func (g *EmrGenerator) addClusters(client *emr.Client) error { - p := emr.NewListClustersPaginator(client.ListClustersRequest(&emr.ListClustersInput{})) - for p.Next(context.Background()) { - for _, cluster := range p.CurrentPage().Clusters { + p := emr.NewListClustersPaginator(client, &emr.ListClustersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, cluster := range page.Clusters { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *cluster.Id, *cluster.Name, @@ -55,13 +59,17 @@ func (g *EmrGenerator) addClusters(client *emr.Client) error { )) } } - return p.Err() + return nil } func (g *EmrGenerator) addSecurityConfigurations(client *emr.Client) error { - p := emr.NewListSecurityConfigurationsPaginator(client.ListSecurityConfigurationsRequest(&emr.ListSecurityConfigurationsInput{})) - for p.Next(context.Background()) { - for _, securityConfiguration := range p.CurrentPage().SecurityConfigurations { + p := emr.NewListSecurityConfigurationsPaginator(client, &emr.ListSecurityConfigurationsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, securityConfiguration := range page.SecurityConfigurations { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *securityConfiguration.Name, *securityConfiguration.Name, @@ -71,5 +79,5 @@ func (g *EmrGenerator) addSecurityConfigurations(client *emr.Client) error { )) } } - return p.Err() + return nil } diff --git a/providers/aws/eni.go b/providers/aws/eni.go index 09c2ac9fbf..01d1a6850f 100644 --- a/providers/aws/eni.go +++ b/providers/aws/eni.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -33,8 +32,8 @@ func (EniGenerator) createResources(enis *ec2.DescribeNetworkInterfacesOutput) [ var resources []terraformutils.Resource for _, eni := range enis.NetworkInterfaces { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(eni.NetworkInterfaceId), - aws.StringValue(eni.NetworkInterfaceId), + StringValue(eni.NetworkInterfaceId), + StringValue(eni.NetworkInterfaceId), "aws_network_interface", "aws", EniAllowEmptyValues, @@ -50,13 +49,16 @@ func (g *EniGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - p := ec2.NewDescribeNetworkInterfacesPaginator( - svc.DescribeNetworkInterfacesRequest(&ec2.DescribeNetworkInterfacesInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage())...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeNetworkInterfacesPaginator(svc, &ec2.DescribeNetworkInterfacesInput{}) + for p.HasMorePages() { + page, e := p.NextPage(context.TODO()) + if e != nil { + return e + } + g.Resources = append(g.Resources, g.createResources(page)...) } - return p.Err() + return nil } func (g *EniGenerator) PostConvertHook() error { diff --git a/providers/aws/es.go b/providers/aws/es.go index 29f5b1b973..07426c04e8 100644 --- a/providers/aws/es.go +++ b/providers/aws/es.go @@ -18,8 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" - es "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice" ) @@ -34,21 +32,21 @@ func (g *EsGenerator) InitResources() error { if e != nil { return e } - svc := es.New(config) + svc := es.NewFromConfig(config) - domainNames, err := svc.ListDomainNamesRequest(&es.ListDomainNamesInput{}).Send(context.Background()) + domainNames, err := svc.ListDomainNames(context.TODO(), &es.ListDomainNamesInput{}) if err != nil { return err } for _, domainName := range domainNames.DomainNames { g.Resources = append(g.Resources, terraformutils.NewResource( - aws.StringValue(domainName.DomainName), - aws.StringValue(domainName.DomainName), + StringValue(domainName.DomainName), + StringValue(domainName.DomainName), "aws_elasticsearch_domain", "aws", map[string]string{ - "domain_name": aws.StringValue(domainName.DomainName), + "domain_name": StringValue(domainName.DomainName), }, esAllowEmptyValues, map[string]interface{}{}, diff --git a/providers/aws/firehose.go b/providers/aws/firehose.go index 5d5d6e1c7c..00c8945ca7 100644 --- a/providers/aws/firehose.go +++ b/providers/aws/firehose.go @@ -47,10 +47,10 @@ func (g *FirehoseGenerator) InitResources() error { if e != nil { return e } - svc := firehose.New(config) + svc := firehose.NewFromConfig(config) var streamNames []string for { - output, err := svc.ListDeliveryStreamsRequest(&firehose.ListDeliveryStreamsInput{}).Send(context.Background()) + output, err := svc.ListDeliveryStreams(context.TODO(), &firehose.ListDeliveryStreamsInput{}) if err != nil { return err } diff --git a/providers/aws/glue.go b/providers/aws/glue.go index 591c0111c0..fef714f179 100644 --- a/providers/aws/glue.go +++ b/providers/aws/glue.go @@ -27,9 +27,13 @@ type GlueGenerator struct { func (g *GlueGenerator) loadGlueCrawlers(svc *glue.Client) error { var GlueCrawlerAllowEmptyValues = []string{"tags."} - p := glue.NewGetCrawlersPaginator(svc.GetCrawlersRequest(&glue.GetCrawlersInput{})) - for p.Next(context.Background()) { - for _, crawler := range p.CurrentPage().Crawlers { + p := glue.NewGetCrawlersPaginator(svc, &glue.GetCrawlersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, crawler := range page.Crawlers { resource := terraformutils.NewSimpleResource(*crawler.Name, *crawler.Name, "aws_glue_crawler", "aws", @@ -37,14 +41,18 @@ func (g *GlueGenerator) loadGlueCrawlers(svc *glue.Client) error { g.Resources = append(g.Resources, resource) } } - return p.Err() + return nil } func (g *GlueGenerator) loadGlueCatalogDatabase(svc *glue.Client, account *string) (databaseNames []*string, error error) { var GlueCatalogDatabaseAllowEmptyValues = []string{"tags."} - p := glue.NewGetDatabasesPaginator(svc.GetDatabasesRequest(&glue.GetDatabasesInput{})) - for p.Next(context.Background()) { - for _, catalogDatabase := range p.CurrentPage().DatabaseList { + p := glue.NewGetDatabasesPaginator(svc, &glue.GetDatabasesInput{}) + for p.HasMorePages() { + page, error := p.NextPage(context.TODO()) + if error != nil { + return databaseNames, error + } + for _, catalogDatabase := range page.DatabaseList { // format of ID is "CATALOG-ID:DATABASE-NAME". // CATALOG-ID is AWS Account ID // https://docs.aws.amazon.com/cli/latest/reference/glue/create-database.html#options @@ -57,7 +65,7 @@ func (g *GlueGenerator) loadGlueCatalogDatabase(svc *glue.Client, account *strin databaseNames = append(databaseNames, catalogDatabase.Name) } } - return databaseNames, p.Err() + return databaseNames, nil } func (g *GlueGenerator) loadGlueCatalogTable(svc *glue.Client, account *string, databaseName *string) error { @@ -65,9 +73,13 @@ func (g *GlueGenerator) loadGlueCatalogTable(svc *glue.Client, account *string, // CATALOG-ID is AWS Account ID // https://docs.aws.amazon.com/cli/latest/reference/glue/create-database.html#options var GlueCatalogTableAllowEmptyValues = []string{"tags."} - p := glue.NewGetTablesPaginator(svc.GetTablesRequest(&glue.GetTablesInput{DatabaseName: databaseName})) - for p.Next(context.Background()) { - for _, catalogTable := range p.CurrentPage().TableList { + p := glue.NewGetTablesPaginator(svc, &glue.GetTablesInput{DatabaseName: databaseName}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, catalogTable := range page.TableList { databaseTable := *databaseName + ":" + *catalogTable.Name id := *account + ":" + databaseTable resource := terraformutils.NewSimpleResource(id, databaseTable, @@ -77,7 +89,7 @@ func (g *GlueGenerator) loadGlueCatalogTable(svc *glue.Client, account *string, g.Resources = append(g.Resources, resource) } } - return p.Err() + return nil } // Generate TerraformResources from AWS API, @@ -89,7 +101,7 @@ func (g *GlueGenerator) InitResources() error { if e != nil { return e } - svc := glue.New(config) + svc := glue.NewFromConfig(config) account, err := g.getAccountNumber(config) if err != nil { diff --git a/providers/aws/iam.go b/providers/aws/iam.go index b2f627d445..3715303bc5 100644 --- a/providers/aws/iam.go +++ b/providers/aws/iam.go @@ -23,8 +23,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/iam" - - "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/iam/types" ) var IamAllowEmptyValues = []string{"tags."} @@ -40,7 +39,7 @@ func (g *IamGenerator) InitResources() error { if e != nil { return e } - svc := iam.New(config) + svc := iam.NewFromConfig(config) g.Resources = []terraformutils.Resource{} err := g.getUsers(svc) if err != nil { @@ -71,19 +70,28 @@ func (g *IamGenerator) InitResources() error { } func (g *IamGenerator) getRoles(svc *iam.Client) error { - p := iam.NewListRolesPaginator(svc.ListRolesRequest(&iam.ListRolesInput{})) - for p.Next(context.Background()) { - for _, role := range p.CurrentPage().Roles { - roleName := aws.StringValue(role.RoleName) + p := iam.NewListRolesPaginator(svc, &iam.ListRolesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, role := range page.Roles { + roleName := StringValue(role.RoleName) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( roleName, roleName, "aws_iam_role", "aws", IamAllowEmptyValues)) - rolePoliciesPage := iam.NewListRolePoliciesPaginator(svc.ListRolePoliciesRequest(&iam.ListRolePoliciesInput{RoleName: role.RoleName})) - for rolePoliciesPage.Next(context.Background()) { - for _, policyName := range rolePoliciesPage.CurrentPage().PolicyNames { + rolePoliciesPage := iam.NewListRolePoliciesPaginator(svc, &iam.ListRolePoliciesInput{RoleName: role.RoleName}) + for rolePoliciesPage.HasMorePages() { + rolePoliciesNextPage, err := rolePoliciesPage.NextPage(context.TODO()) + if err != nil { + log.Println(err) + continue + } + for _, policyName := range rolePoliciesNextPage.PolicyNames { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( roleName+":"+policyName, roleName+"_"+policyName, @@ -92,15 +100,16 @@ func (g *IamGenerator) getRoles(svc *iam.Client) error { IamAllowEmptyValues)) } } - if err := rolePoliciesPage.Err(); err != nil { - log.Println(err) - continue - } - roleAttachedPoliciesPage := iam.NewListAttachedRolePoliciesPaginator(svc.ListAttachedRolePoliciesRequest(&iam.ListAttachedRolePoliciesInput{ + roleAttachedPoliciesPage := iam.NewListAttachedRolePoliciesPaginator(svc, &iam.ListAttachedRolePoliciesInput{ RoleName: &roleName, - })) - for roleAttachedPoliciesPage.Next(context.Background()) { - for _, attachedPolicy := range roleAttachedPoliciesPage.CurrentPage().AttachedPolicies { + }) + for roleAttachedPoliciesPage.HasMorePages() { + roleAttachedPoliciesNextPage, err := roleAttachedPoliciesPage.NextPage(context.TODO()) + if err != nil { + log.Println(err) + continue + } + for _, attachedPolicy := range roleAttachedPoliciesNextPage.AttachedPolicies { g.Resources = append(g.Resources, terraformutils.NewResource( roleName+"/"+*attachedPolicy.PolicyArn, roleName+"_"+*attachedPolicy.PolicyName, @@ -114,23 +123,23 @@ func (g *IamGenerator) getRoles(svc *iam.Client) error { map[string]interface{}{})) } } - if err := roleAttachedPoliciesPage.Err(); err != nil { - log.Println(err) - continue - } } } - return p.Err() + return nil } func (g *IamGenerator) getUsers(svc *iam.Client) error { - p := iam.NewListUsersPaginator(svc.ListUsersRequest(&iam.ListUsersInput{})) - for p.Next(context.Background()) { - for _, user := range p.CurrentPage().Users { - resourceName := aws.StringValue(user.UserName) + p := iam.NewListUsersPaginator(svc, &iam.ListUsersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, user := range page.Users { + resourceName := StringValue(user.UserName) g.Resources = append(g.Resources, terraformutils.NewResource( resourceName, - aws.StringValue(user.UserId), + StringValue(user.UserId), "aws_iam_user", "aws", map[string]string{ @@ -152,13 +161,17 @@ func (g *IamGenerator) getUsers(svc *iam.Client) error { } } } - return p.Err() + return nil } func (g *IamGenerator) getUserGroup(svc *iam.Client, userName *string) error { - p := iam.NewListGroupsForUserPaginator(svc.ListGroupsForUserRequest(&iam.ListGroupsForUserInput{UserName: userName})) - for p.Next(context.Background()) { - for _, group := range p.CurrentPage().Groups { + p := iam.NewListGroupsForUserPaginator(svc, &iam.ListGroupsForUserInput{UserName: userName}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, group := range page.Groups { userGroupMembership := *userName + "/" + *group.GroupName g.Resources = append(g.Resources, terraformutils.NewResource( userGroupMembership, @@ -175,16 +188,20 @@ func (g *IamGenerator) getUserGroup(svc *iam.Client, userName *string) error { )) } } - return p.Err() + return nil } func (g *IamGenerator) getUserPolices(svc *iam.Client, userName *string) error { - p := iam.NewListUserPoliciesPaginator(svc.ListUserPoliciesRequest(&iam.ListUserPoliciesInput{UserName: userName})) - for p.Next(context.Background()) { - for _, policy := range p.CurrentPage().PolicyNames { - resourceName := aws.StringValue(userName) + "_" + policy + p := iam.NewListUserPoliciesPaginator(svc, &iam.ListUserPoliciesInput{UserName: userName}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, policy := range page.PolicyNames { + resourceName := StringValue(userName) + "_" + policy resourceName = strings.ReplaceAll(resourceName, "@", "") - policyID := aws.StringValue(userName) + ":" + policy + policyID := StringValue(userName) + ":" + policy g.Resources = append(g.Resources, terraformutils.NewSimpleResource( policyID, resourceName, @@ -193,15 +210,19 @@ func (g *IamGenerator) getUserPolices(svc *iam.Client, userName *string) error { IamAllowEmptyValues)) } } - return p.Err() + return nil } func (g *IamGenerator) getUserPolicyAttachment(svc *iam.Client, userName *string) error { - p := iam.NewListAttachedUserPoliciesPaginator(svc.ListAttachedUserPoliciesRequest(&iam.ListAttachedUserPoliciesInput{ + p := iam.NewListAttachedUserPoliciesPaginator(svc, &iam.ListAttachedUserPoliciesInput{ UserName: userName, - })) - for p.Next(context.Background()) { - for _, attachedPolicy := range p.CurrentPage().AttachedPolicies { + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, attachedPolicy := range page.AttachedPolicies { g.Resources = append(g.Resources, terraformutils.NewResource( *userName+"/"+*attachedPolicy.PolicyArn, *userName+"_"+*attachedPolicy.PolicyName, @@ -215,15 +236,19 @@ func (g *IamGenerator) getUserPolicyAttachment(svc *iam.Client, userName *string map[string]interface{}{})) } } - return p.Err() + return nil } func (g *IamGenerator) getPolicies(svc *iam.Client) error { - p := iam.NewListPoliciesPaginator(svc.ListPoliciesRequest(&iam.ListPoliciesInput{Scope: iam.PolicyScopeTypeLocal})) - for p.Next(context.Background()) { - for _, policy := range p.CurrentPage().Policies { - resourceName := aws.StringValue(policy.PolicyName) - policyARN := aws.StringValue(policy.Arn) + p := iam.NewListPoliciesPaginator(svc, &iam.ListPoliciesInput{Scope: types.PolicyScopeTypeLocal}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, policy := range page.Policies { + resourceName := StringValue(policy.PolicyName) + policyARN := StringValue(policy.Arn) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( policyARN, @@ -233,14 +258,18 @@ func (g *IamGenerator) getPolicies(svc *iam.Client) error { IamAllowEmptyValues)) } } - return p.Err() + return nil } func (g *IamGenerator) getGroups(svc *iam.Client) error { - p := iam.NewListGroupsPaginator(svc.ListGroupsRequest(&iam.ListGroupsInput{})) - for p.Next(context.Background()) { - for _, group := range p.CurrentPage().Groups { - resourceName := aws.StringValue(group.GroupName) + p := iam.NewListGroupsPaginator(svc, &iam.ListGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, group := range page.Groups { + resourceName := StringValue(group.GroupName) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -251,13 +280,18 @@ func (g *IamGenerator) getGroups(svc *iam.Client) error { g.getAttachedGroupPolicies(svc, group) } } - return p.Err() + return nil } -func (g *IamGenerator) getGroupPolicies(svc *iam.Client, group iam.Group) { - groupPoliciesPage := iam.NewListGroupPoliciesPaginator(svc.ListGroupPoliciesRequest(&iam.ListGroupPoliciesInput{GroupName: group.GroupName})) - for groupPoliciesPage.Next(context.Background()) { - for _, policy := range groupPoliciesPage.CurrentPage().PolicyNames { +func (g *IamGenerator) getGroupPolicies(svc *iam.Client, group types.Group) { + groupPoliciesPage := iam.NewListGroupPoliciesPaginator(svc, &iam.ListGroupPoliciesInput{GroupName: group.GroupName}) + for groupPoliciesPage.HasMorePages() { + groupPoliciesNextPage, err := groupPoliciesPage.NextPage(context.TODO()) + if err != nil { + log.Println(err) + continue + } + for _, policy := range groupPoliciesNextPage.PolicyNames { id := *group.GroupName + ":" + policy groupPolicyName := *group.GroupName + "_" + policy g.Resources = append(g.Resources, terraformutils.NewResource( @@ -270,16 +304,18 @@ func (g *IamGenerator) getGroupPolicies(svc *iam.Client, group iam.Group) { IamAdditionalFields)) } } - if err := groupPoliciesPage.Err(); err != nil { - log.Println(err) - } } -func (g *IamGenerator) getAttachedGroupPolicies(svc *iam.Client, group iam.Group) { - groupAttachedPoliciesPage := iam.NewListAttachedGroupPoliciesPaginator(svc.ListAttachedGroupPoliciesRequest( - &iam.ListAttachedGroupPoliciesInput{GroupName: group.GroupName})) - for groupAttachedPoliciesPage.Next(context.Background()) { - for _, attachedPolicy := range groupAttachedPoliciesPage.CurrentPage().AttachedPolicies { +func (g *IamGenerator) getAttachedGroupPolicies(svc *iam.Client, group types.Group) { + groupAttachedPoliciesPage := iam.NewListAttachedGroupPoliciesPaginator(svc, + &iam.ListAttachedGroupPoliciesInput{GroupName: group.GroupName}) + for groupAttachedPoliciesPage.HasMorePages() { + groupAttachedPoliciesNextPage, err := groupAttachedPoliciesPage.NextPage(context.TODO()) + if err != nil { + log.Println(err) + continue + } + for _, attachedPolicy := range groupAttachedPoliciesNextPage.AttachedPolicies { if !strings.Contains(*attachedPolicy.PolicyArn, "arn:aws:iam::aws") { continue // map only AWS managed policies since others should be managed by } @@ -297,15 +333,16 @@ func (g *IamGenerator) getAttachedGroupPolicies(svc *iam.Client, group iam.Group IamAdditionalFields)) } } - if err := groupAttachedPoliciesPage.Err(); err != nil { - log.Println(err) - } } func (g *IamGenerator) getInstanceProfiles(svc *iam.Client) error { - p := iam.NewListInstanceProfilesPaginator(svc.ListInstanceProfilesRequest(&iam.ListInstanceProfilesInput{})) - for p.Next(context.Background()) { - for _, instanceProfile := range p.CurrentPage().InstanceProfiles { + p := iam.NewListInstanceProfilesPaginator(svc, &iam.ListInstanceProfilesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, instanceProfile := range page.InstanceProfiles { resourceName := *instanceProfile.InstanceProfileName g.Resources = append(g.Resources, terraformutils.NewResource( @@ -320,7 +357,7 @@ func (g *IamGenerator) getInstanceProfiles(svc *iam.Client) error { IamAdditionalFields)) } } - return p.Err() + return nil } // PostGenerateHook for add policy json as heredoc diff --git a/providers/aws/igw.go b/providers/aws/igw.go index 127d54cd16..b1a05bda95 100644 --- a/providers/aws/igw.go +++ b/providers/aws/igw.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -33,14 +32,14 @@ type IgwGenerator struct { // from each Internet gateway create 1 TerraformResource. // Need InternetGatewayId as ID for terraform resource func (g *IgwGenerator) createResources(igws *ec2.DescribeInternetGatewaysOutput) []terraformutils.Resource { - resources := []terraformutils.Resource{} + var resources []terraformutils.Resource for _, internetGateway := range igws.InternetGateways { if len(internetGateway.Attachments) == 0 { continue } resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(internetGateway.InternetGatewayId), - aws.StringValue(internetGateway.InternetGatewayId), + StringValue(internetGateway.InternetGatewayId), + StringValue(internetGateway.InternetGatewayId), "aws_internet_gateway", "aws", IgwAllowEmptyValues, @@ -54,10 +53,14 @@ func (g *IgwGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - p := ec2.NewDescribeInternetGatewaysPaginator(svc.DescribeInternetGatewaysRequest(&ec2.DescribeInternetGatewaysInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage())...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeInternetGatewaysPaginator(svc, &ec2.DescribeInternetGatewaysInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(page)...) } - return p.Err() + return nil } diff --git a/providers/aws/iot.go b/providers/aws/iot.go index cc14557df2..98cfb00794 100644 --- a/providers/aws/iot.go +++ b/providers/aws/iot.go @@ -32,7 +32,7 @@ func (g *IotGenerator) InitResources() error { if e != nil { return e } - svc := iot.New(config) + svc := iot.NewFromConfig(config) if err := g.loadThingTypes(svc); err != nil { return err @@ -51,7 +51,7 @@ func (g *IotGenerator) InitResources() error { } func (g *IotGenerator) loadThingTypes(svc *iot.Client) error { - output, err := svc.ListThingTypesRequest(&iot.ListThingTypesInput{}).Send(context.Background()) + output, err := svc.ListThingTypes(context.TODO(), &iot.ListThingTypesInput{}) if err != nil { return err } @@ -72,7 +72,7 @@ func (g *IotGenerator) loadThingTypes(svc *iot.Client) error { } func (g *IotGenerator) loadThings(svc *iot.Client) error { - output, err := svc.ListThingsRequest(&iot.ListThingsInput{}).Send(context.Background()) + output, err := svc.ListThings(context.TODO(), &iot.ListThingsInput{}) if err != nil { return err } @@ -93,7 +93,7 @@ func (g *IotGenerator) loadThings(svc *iot.Client) error { } func (g *IotGenerator) loadTopicRules(svc *iot.Client) error { - output, err := svc.ListTopicRulesRequest(&iot.ListTopicRulesInput{}).Send(context.Background()) + output, err := svc.ListTopicRules(context.TODO(), &iot.ListTopicRulesInput{}) if err != nil { return err } @@ -109,7 +109,7 @@ func (g *IotGenerator) loadTopicRules(svc *iot.Client) error { } func (g *IotGenerator) loadRoleAliases(svc *iot.Client) error { - output, err := svc.ListRoleAliasesRequest(&iot.ListRoleAliasesInput{}).Send(context.Background()) + output, err := svc.ListRoleAliases(context.TODO(), &iot.ListRoleAliasesInput{}) if err != nil { return err } diff --git a/providers/aws/kinesis.go b/providers/aws/kinesis.go index 9e110dbda1..410721790b 100644 --- a/providers/aws/kinesis.go +++ b/providers/aws/kinesis.go @@ -47,10 +47,22 @@ func (g *KinesisGenerator) InitResources() error { if e != nil { return e } - svc := kinesis.New(config) - p := kinesis.NewListStreamsPaginator(svc.ListStreamsRequest(&kinesis.ListStreamsInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage().StreamNames)...) + svc := kinesis.NewFromConfig(config) + + var results *kinesis.ListStreamsOutput + var request = kinesis.ListStreamsInput{} + var err error + + for results == nil || *results.HasMoreStreams { + results, err = svc.ListStreams(context.TODO(), &request) + if err != nil { + return err + } + if len(results.StreamNames) > 0 { + request = kinesis.ListStreamsInput{ + ExclusiveStartStreamName: &results.StreamNames[len(results.StreamNames)-1], + } + } } - return p.Err() + return nil } From 7e420df9f00b56216849b3518f7747f382a1c39b Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 21 Feb 2021 17:27:42 +0800 Subject: [PATCH 101/276] #549 refactored another batch of services --- providers/aws/kms.go | 26 +++++++---- providers/aws/lambda.go | 68 +++++++++++++++++------------ providers/aws/logs.go | 20 +++++---- providers/aws/media_package.go | 17 +++++--- providers/aws/media_store.go | 17 +++++--- providers/aws/msk.go | 19 ++++---- providers/aws/nacl.go | 19 ++++---- providers/aws/nat_gateway.go | 21 +++++---- providers/aws/organization.go | 73 ++++++++++++++++--------------- providers/aws/qldb.go | 17 +++++--- providers/aws/rds.go | 74 ++++++++++++++++++++------------ providers/aws/resourcegroups.go | 17 +++++--- providers/aws/route53.go | 55 +++++++++++++----------- providers/aws/route_table.go | 41 +++++++++--------- providers/aws/s3.go | 20 ++++----- providers/aws/secretsmanager.go | 19 ++++---- providers/aws/securityhub.go | 27 +++++++----- providers/aws/servicecatalog.go | 19 ++++---- providers/aws/ses.go | 51 ++++++++++++---------- providers/aws/sfn.go | 30 ++++++------- providers/aws/sg.go | 61 +++++++++++++------------- providers/aws/sg_test.go | 56 ++++++++++++------------ providers/aws/sns.go | 42 ++++++++++-------- providers/aws/sqs.go | 4 +- providers/aws/subnet.go | 19 ++++---- providers/aws/swf.go | 15 ++++--- providers/aws/transit_gateway.go | 53 ++++++++++++++--------- providers/aws/vgw.go | 13 +++--- providers/aws/vpc.go | 19 ++++---- providers/aws/vpc_peering.go | 21 +++++---- 30 files changed, 537 insertions(+), 416 deletions(-) diff --git a/providers/aws/kms.go b/providers/aws/kms.go index 61f44e2f59..15c4b4659b 100644 --- a/providers/aws/kms.go +++ b/providers/aws/kms.go @@ -32,7 +32,7 @@ func (g *KmsGenerator) InitResources() error { if e != nil { return e } - client := kms.New(config) + client := kms.NewFromConfig(config) err := g.addKeys(client) if err != nil { @@ -43,9 +43,13 @@ func (g *KmsGenerator) InitResources() error { } func (g *KmsGenerator) addKeys(client *kms.Client) error { - p := kms.NewListKeysPaginator(client.ListKeysRequest(&kms.ListKeysInput{})) - for p.Next(context.Background()) { - for _, key := range p.CurrentPage().Keys { + p := kms.NewListKeysPaginator(client, &kms.ListKeysInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, key := range page.Keys { resource := terraformutils.NewResource( *key.KeyId, *key.KeyId, @@ -61,13 +65,17 @@ func (g *KmsGenerator) addKeys(client *kms.Client) error { g.Resources = append(g.Resources, resource) } } - return p.Err() + return nil } func (g *KmsGenerator) addAliases(client *kms.Client) error { - p := kms.NewListAliasesPaginator(client.ListAliasesRequest(&kms.ListAliasesInput{})) - for p.Next(context.Background()) { - for _, alias := range p.CurrentPage().Aliases { + p := kms.NewListAliasesPaginator(client, &kms.ListAliasesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, alias := range page.Aliases { resource := terraformutils.NewSimpleResource( *alias.AliasName, *alias.AliasName, @@ -79,5 +87,5 @@ func (g *KmsGenerator) addAliases(client *kms.Client) error { g.Resources = append(g.Resources, resource) } } - return p.Err() + return nil } diff --git a/providers/aws/lambda.go b/providers/aws/lambda.go index 9169d36ac0..6852f3835c 100644 --- a/providers/aws/lambda.go +++ b/providers/aws/lambda.go @@ -32,7 +32,7 @@ func (g *LambdaGenerator) InitResources() error { if e != nil { return e } - svc := lambda.New(config) + svc := lambda.NewFromConfig(config) err := g.addFunctions(svc) if err != nil { @@ -70,9 +70,13 @@ func (g *LambdaGenerator) PostConvertHook() error { } func (g *LambdaGenerator) addFunctions(svc *lambda.Client) error { - p := lambda.NewListFunctionsPaginator(svc.ListFunctionsRequest(&lambda.ListFunctionsInput{})) - for p.Next(context.Background()) { - for _, function := range p.CurrentPage().Functions { + p := lambda.NewListFunctionsPaginator(svc, &lambda.ListFunctionsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, function := range page.Functions { g.Resources = append(g.Resources, terraformutils.NewResource( *function.FunctionArn, *function.FunctionName, @@ -85,12 +89,16 @@ func (g *LambdaGenerator) addFunctions(svc *lambda.Client) error { map[string]interface{}{}, )) - pi := lambda.NewListFunctionEventInvokeConfigsPaginator(svc.ListFunctionEventInvokeConfigsRequest( + pi := lambda.NewListFunctionEventInvokeConfigsPaginator(svc, &lambda.ListFunctionEventInvokeConfigsInput{ FunctionName: function.FunctionName, - })) - for pi.Next(context.Background()) { - for _, functionEventInvokeConfig := range pi.CurrentPage().FunctionEventInvokeConfigs { + }) + for pi.HasMorePages() { + piage, err := pi.NextPage(context.TODO()) + if err != nil { + return err + } + for _, functionEventInvokeConfig := range piage.FunctionEventInvokeConfigs { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *function.FunctionArn, "feic_"+*functionEventInvokeConfig.FunctionArn, @@ -100,18 +108,19 @@ func (g *LambdaGenerator) addFunctions(svc *lambda.Client) error { )) } } - if err := pi.Err(); err != nil { - return err - } } } - return p.Err() + return nil } func (g *LambdaGenerator) addEventSourceMappings(svc *lambda.Client) error { - p := lambda.NewListEventSourceMappingsPaginator(svc.ListEventSourceMappingsRequest(&lambda.ListEventSourceMappingsInput{})) - for p.Next(context.Background()) { - for _, mapping := range p.CurrentPage().EventSourceMappings { + p := lambda.NewListEventSourceMappingsPaginator(svc, &lambda.ListEventSourceMappingsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, mapping := range page.EventSourceMappings { g.Resources = append(g.Resources, terraformutils.NewResource( *mapping.UUID, *mapping.UUID, @@ -126,18 +135,26 @@ func (g *LambdaGenerator) addEventSourceMappings(svc *lambda.Client) error { )) } } - return p.Err() + return nil } func (g *LambdaGenerator) addLayerVersions(svc *lambda.Client) error { - pl := lambda.NewListLayersPaginator(svc.ListLayersRequest(&lambda.ListLayersInput{})) - for pl.Next(context.Background()) { - for _, layer := range pl.CurrentPage().Layers { - pv := lambda.NewListLayerVersionsPaginator(svc.ListLayerVersionsRequest(&lambda.ListLayerVersionsInput{ + pl := lambda.NewListLayersPaginator(svc, &lambda.ListLayersInput{}) + for pl.HasMorePages() { + plage, err := pl.NextPage(context.TODO()) + if err != nil { + return err + } + for _, layer := range plage.Layers { + pv := lambda.NewListLayerVersionsPaginator(svc, &lambda.ListLayerVersionsInput{ LayerName: layer.LayerName, - })) - for pv.Next(context.Background()) { - for _, layerVersion := range pv.CurrentPage().LayerVersions { + }) + for pv.HasMorePages() { + pvage, err := pv.NextPage(context.TODO()) + if err != nil { + return err + } + for _, layerVersion := range pvage.LayerVersions { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *layerVersion.LayerVersionArn, *layerVersion.LayerVersionArn, @@ -147,10 +164,7 @@ func (g *LambdaGenerator) addLayerVersions(svc *lambda.Client) error { )) } } - if err := pv.Err(); err != nil { - return err - } } } - return pl.Err() + return nil } diff --git a/providers/aws/logs.go b/providers/aws/logs.go index 20185f07a9..9ea8c37b5d 100644 --- a/providers/aws/logs.go +++ b/providers/aws/logs.go @@ -19,7 +19,6 @@ import ( "strconv" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs" ) @@ -29,15 +28,15 @@ type LogsGenerator struct { AWSService } -func (g *LogsGenerator) createResources(logGroups *cloudwatchlogs.DescribeLogGroupsResponse) []terraformutils.Resource { +func (g *LogsGenerator) createResources(logGroups *cloudwatchlogs.DescribeLogGroupsOutput) []terraformutils.Resource { resources := []terraformutils.Resource{} for _, logGroup := range logGroups.LogGroups { - resourceName := aws.StringValue(logGroup.LogGroupName) + resourceName := StringValue(logGroup.LogGroupName) attributes := map[string]string{} if logGroup.RetentionInDays != nil { - attributes["retention_in_days"] = strconv.FormatInt(*logGroup.RetentionInDays, 10) + attributes["retention_in_days"] = strconv.FormatInt(int64(*logGroup.RetentionInDays), 10) } if logGroup.KmsKeyId != nil { @@ -62,13 +61,16 @@ func (g *LogsGenerator) InitResources() error { if e != nil { return e } - svc := cloudwatchlogs.New(config) + svc := cloudwatchlogs.NewFromConfig(config) - logGroups, err := svc.DescribeLogGroupsRequest(&cloudwatchlogs.DescribeLogGroupsInput{}).Send(context.Background()) - if err != nil { - return err + p := cloudwatchlogs.NewDescribeLogGroupsPaginator(svc, &cloudwatchlogs.DescribeLogGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(page)...) } - g.Resources = g.createResources(logGroups) return nil } diff --git a/providers/aws/media_package.go b/providers/aws/media_package.go index 64b6046ff3..93b830841c 100644 --- a/providers/aws/media_package.go +++ b/providers/aws/media_package.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mediapackage" ) @@ -33,12 +32,16 @@ func (g *MediaPackageGenerator) InitResources() error { if e != nil { return e } - svc := mediapackage.New(config) - p := mediapackage.NewListChannelsPaginator(svc.ListChannelsRequest(&mediapackage.ListChannelsInput{})) + svc := mediapackage.NewFromConfig(config) + p := mediapackage.NewListChannelsPaginator(svc, &mediapackage.ListChannelsInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, channel := range p.CurrentPage().Channels { - channelID := aws.StringValue(channel.Id) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, channel := range page.Channels { + channelID := StringValue(channel.Id) resources = append(resources, terraformutils.NewSimpleResource( channelID, channelID, @@ -48,5 +51,5 @@ func (g *MediaPackageGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/media_store.go b/providers/aws/media_store.go index 239c4374e1..f1e4fd77ef 100644 --- a/providers/aws/media_store.go +++ b/providers/aws/media_store.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mediastore" ) @@ -33,12 +32,16 @@ func (g *MediaStoreGenerator) InitResources() error { if e != nil { return e } - svc := mediastore.New(config) - p := mediastore.NewListContainersPaginator(svc.ListContainersRequest(&mediastore.ListContainersInput{})) + svc := mediastore.NewFromConfig(config) + p := mediastore.NewListContainersPaginator(svc, &mediastore.ListContainersInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, container := range p.CurrentPage().Containers { - containerName := aws.StringValue(container.Name) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, container := range page.Containers { + containerName := StringValue(container.Name) resources = append(resources, terraformutils.NewSimpleResource( containerName, containerName, @@ -48,5 +51,5 @@ func (g *MediaStoreGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/msk.go b/providers/aws/msk.go index f7f7c266ff..3fde0d119f 100644 --- a/providers/aws/msk.go +++ b/providers/aws/msk.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/kafka" ) @@ -33,13 +32,17 @@ func (g *MskGenerator) InitResources() error { if e != nil { return e } - svc := kafka.New(config) - p := kafka.NewListClustersPaginator(svc.ListClustersRequest(&kafka.ListClustersInput{})) - for p.Next(context.Background()) { - for _, clusterInfo := range p.CurrentPage().ClusterInfoList { + svc := kafka.NewFromConfig(config) + p := kafka.NewListClustersPaginator(svc, &kafka.ListClustersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, clusterInfo := range page.ClusterInfoList { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(clusterInfo.ClusterArn), - aws.StringValue(clusterInfo.ClusterName), + StringValue(clusterInfo.ClusterArn), + StringValue(clusterInfo.ClusterName), "aws_msk_cluster", "aws", mskAllowEmptyValues, @@ -47,7 +50,7 @@ func (g *MskGenerator) InitResources() error { } } - return p.Err() + return nil } func (g *MskGenerator) PostConvertHook() error { diff --git a/providers/aws/nacl.go b/providers/aws/nacl.go index fe1b52a831..798f468c0c 100644 --- a/providers/aws/nacl.go +++ b/providers/aws/nacl.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -32,8 +31,8 @@ func (NaclGenerator) createResources(nacls *ec2.DescribeNetworkAclsOutput) []ter resources := []terraformutils.Resource{} for _, nacl := range nacls.NetworkAcls { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(nacl.NetworkAclId), - aws.StringValue(nacl.NetworkAclId), + StringValue(nacl.NetworkAclId), + StringValue(nacl.NetworkAclId), "aws_network_acl", "aws", NaclAllowEmptyValues)) @@ -49,10 +48,14 @@ func (g *NaclGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - p := ec2.NewDescribeNetworkAclsPaginator(svc.DescribeNetworkAclsRequest(&ec2.DescribeNetworkAclsInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage())...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeNetworkAclsPaginator(svc, &ec2.DescribeNetworkAclsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(page)...) } - return p.Err() + return nil } diff --git a/providers/aws/nat_gateway.go b/providers/aws/nat_gateway.go index fbedcc0bb0..f1cfd55706 100644 --- a/providers/aws/nat_gateway.go +++ b/providers/aws/nat_gateway.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -30,11 +29,11 @@ type NatGatewayGenerator struct { } func (g *NatGatewayGenerator) createResources(ngws *ec2.DescribeNatGatewaysOutput) []terraformutils.Resource { - resources := []terraformutils.Resource{} + var resources []terraformutils.Resource for _, ngw := range ngws.NatGateways { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(ngw.NatGatewayId), - aws.StringValue(ngw.NatGatewayId), + StringValue(ngw.NatGatewayId), + StringValue(ngw.NatGatewayId), "aws_nat_gateway", "aws", ngwAllowEmptyValues, @@ -51,10 +50,14 @@ func (g *NatGatewayGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - p := ec2.NewDescribeNatGatewaysPaginator(svc.DescribeNatGatewaysRequest(&ec2.DescribeNatGatewaysInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage())...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeNatGatewaysPaginator(svc, &ec2.DescribeNatGatewaysInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(page)...) } - return p.Err() + return nil } diff --git a/providers/aws/organization.go b/providers/aws/organization.go index 6029014202..7097f0a5cd 100644 --- a/providers/aws/organization.go +++ b/providers/aws/organization.go @@ -22,6 +22,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/organizations" + "github.com/aws/aws-sdk-go-v2/service/organizations/types" ) var organizationAllowEmptyValues = []string{"tags."} @@ -31,57 +32,57 @@ type OrganizationGenerator struct { } func (g *OrganizationGenerator) traverseNode(svc *organizations.Client, parentID string) { - accountsForParent, err := svc.ListAccountsForParentRequest( - &organizations.ListAccountsForParentInput{ParentId: aws.String(parentID)}).Send(context.Background()) + accountsForParent, err := svc.ListAccountsForParent(context.TODO(), + &organizations.ListAccountsForParentInput{ParentId: aws.String(parentID)}) if err != nil { return } for _, account := range accountsForParent.Accounts { g.Resources = append(g.Resources, terraformutils.NewResource( - aws.StringValue(account.Id), - aws.StringValue(account.Name), + StringValue(account.Id), + StringValue(account.Name), "aws_organizations_organization", "aws", map[string]string{ - "id": aws.StringValue(account.Id), - "arn": aws.StringValue(account.Arn), + "id": StringValue(account.Id), + "arn": StringValue(account.Arn), }, organizationAllowEmptyValues, map[string]interface{}{}, )) g.Resources = append(g.Resources, terraformutils.NewResource( - aws.StringValue(account.Id), - aws.StringValue(account.Name), + StringValue(account.Id), + StringValue(account.Name), "aws_organizations_account", "aws", map[string]string{ - "id": aws.StringValue(account.Id), - "arn": aws.StringValue(account.Arn), + "id": StringValue(account.Id), + "arn": StringValue(account.Arn), }, organizationAllowEmptyValues, map[string]interface{}{}, )) } - unitsForParent, err := svc.ListOrganizationalUnitsForParentRequest( - &organizations.ListOrganizationalUnitsForParentInput{ParentId: aws.String(parentID)}).Send(context.Background()) + unitsForParent, err := svc.ListOrganizationalUnitsForParent(context.TODO(), + &organizations.ListOrganizationalUnitsForParentInput{ParentId: aws.String(parentID)}) if err != nil { return } for _, unit := range unitsForParent.OrganizationalUnits { g.Resources = append(g.Resources, terraformutils.NewResource( - aws.StringValue(unit.Id), - aws.StringValue(unit.Name), + StringValue(unit.Id), + StringValue(unit.Name), "aws_organizations_organizational_unit", "aws", map[string]string{ - "id": aws.StringValue(unit.Id), - "arn": aws.StringValue(unit.Arn), + "id": StringValue(unit.Id), + "arn": StringValue(unit.Arn), }, organizationAllowEmptyValues, map[string]interface{}{}, )) - g.traverseNode(svc, aws.StringValue(unit.Id)) + g.traverseNode(svc, StringValue(unit.Id)) } } @@ -90,25 +91,29 @@ func (g *OrganizationGenerator) InitResources() error { if e != nil { return e } - svc := organizations.New(config) + svc := organizations.NewFromConfig(config) - roots, err := svc.ListRootsRequest(&organizations.ListRootsInput{}).Send(context.Background()) + roots, err := svc.ListRoots(context.TODO(), &organizations.ListRootsInput{}) if err != nil { return err } for _, root := range roots.Roots { - nodeID := aws.StringValue(root.Id) + nodeID := StringValue(root.Id) g.traverseNode(svc, nodeID) } - p := organizations.NewListPoliciesPaginator(svc.ListPoliciesRequest(&organizations.ListPoliciesInput{ - Filter: organizations.PolicyTypeServiceControlPolicy, - })) - for p.Next(context.Background()) { - for _, policy := range p.CurrentPage().Policies { - policyID := aws.StringValue(policy.Id) - policyName := aws.StringValue(policy.Name) + p := organizations.NewListPoliciesPaginator(svc, &organizations.ListPoliciesInput{ + Filter: types.PolicyTypeServiceControlPolicy, + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, policy := range page.Policies { + policyID := StringValue(policy.Id) + policyName := StringValue(policy.Name) g.Resources = append(g.Resources, terraformutils.NewResource( policyID, policyName, @@ -116,27 +121,27 @@ func (g *OrganizationGenerator) InitResources() error { "aws", map[string]string{ "id": policyID, - "arn": aws.StringValue(policy.Arn), + "arn": StringValue(policy.Arn), }, organizationAllowEmptyValues, map[string]interface{}{}, )) - targetsForPolicy, err := svc.ListTargetsForPolicyRequest( - &organizations.ListTargetsForPolicyInput{PolicyId: policy.Id}).Send(context.Background()) + targetsForPolicy, err := svc.ListTargetsForPolicy(context.TODO(), + &organizations.ListTargetsForPolicyInput{PolicyId: policy.Id}) if err != nil { fmt.Println(err.Error()) continue } for _, target := range targetsForPolicy.Targets { g.Resources = append(g.Resources, terraformutils.NewResource( - aws.StringValue(target.TargetId)+":"+policyID, - "pa-"+aws.StringValue(target.TargetId)+":"+policyName, + StringValue(target.TargetId)+":"+policyID, + "pa-"+StringValue(target.TargetId)+":"+policyName, "aws_organizations_policy_attachment", "aws", map[string]string{ "policy_id": policyID, - "target_id": aws.StringValue(target.TargetId), + "target_id": StringValue(target.TargetId), }, organizationAllowEmptyValues, map[string]interface{}{}, @@ -145,5 +150,5 @@ func (g *OrganizationGenerator) InitResources() error { } } - return p.Err() + return nil } diff --git a/providers/aws/qldb.go b/providers/aws/qldb.go index dccb6ed874..752e760c17 100644 --- a/providers/aws/qldb.go +++ b/providers/aws/qldb.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/qldb" ) @@ -33,12 +32,16 @@ func (g *QLDBGenerator) InitResources() error { if e != nil { return e } - svc := qldb.New(config) - p := qldb.NewListLedgersPaginator(svc.ListLedgersRequest(&qldb.ListLedgersInput{})) + svc := qldb.NewFromConfig(config) + p := qldb.NewListLedgersPaginator(svc, &qldb.ListLedgersInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, ledger := range p.CurrentPage().Ledgers { - ledgerName := aws.StringValue(ledger.Name) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, ledger := range page.Ledgers { + ledgerName := StringValue(ledger.Name) resources = append(resources, terraformutils.NewSimpleResource( ledgerName, ledgerName, @@ -48,5 +51,5 @@ func (g *QLDBGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/rds.go b/providers/aws/rds.go index dc696a5ceb..b97fa90794 100644 --- a/providers/aws/rds.go +++ b/providers/aws/rds.go @@ -21,8 +21,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/rds" - - "github.com/aws/aws-sdk-go-v2/aws" ) var RDSAllowEmptyValues = []string{"tags."} @@ -32,10 +30,14 @@ type RDSGenerator struct { } func (g *RDSGenerator) loadDBInstances(svc *rds.Client) error { - p := rds.NewDescribeDBInstancesPaginator(svc.DescribeDBInstancesRequest(&rds.DescribeDBInstancesInput{})) - for p.Next(context.Background()) { - for _, db := range p.CurrentPage().DBInstances { - resourceName := aws.StringValue(db.DBInstanceIdentifier) + p := rds.NewDescribeDBInstancesPaginator(svc, &rds.DescribeDBInstancesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, db := range page.DBInstances { + resourceName := StringValue(db.DBInstanceIdentifier) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -45,14 +47,18 @@ func (g *RDSGenerator) loadDBInstances(svc *rds.Client) error { )) } } - return p.Err() + return nil } func (g *RDSGenerator) loadDBParameterGroups(svc *rds.Client) error { - p := rds.NewDescribeDBParameterGroupsPaginator(svc.DescribeDBParameterGroupsRequest(&rds.DescribeDBParameterGroupsInput{})) - for p.Next(context.Background()) { - for _, parameterGroup := range p.CurrentPage().DBParameterGroups { - resourceName := aws.StringValue(parameterGroup.DBParameterGroupName) + p := rds.NewDescribeDBParameterGroupsPaginator(svc, &rds.DescribeDBParameterGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, parameterGroup := range page.DBParameterGroups { + resourceName := StringValue(parameterGroup.DBParameterGroupName) if strings.Contains(resourceName, ".") { continue // skip default Default ParameterGroups like default.mysql5.6 } @@ -65,14 +71,18 @@ func (g *RDSGenerator) loadDBParameterGroups(svc *rds.Client) error { )) } } - return p.Err() + return nil } func (g *RDSGenerator) loadDBSubnetGroups(svc *rds.Client) error { - p := rds.NewDescribeDBSubnetGroupsPaginator(svc.DescribeDBSubnetGroupsRequest(&rds.DescribeDBSubnetGroupsInput{})) - for p.Next(context.Background()) { - for _, subnet := range p.CurrentPage().DBSubnetGroups { - resourceName := aws.StringValue(subnet.DBSubnetGroupName) + p := rds.NewDescribeDBSubnetGroupsPaginator(svc, &rds.DescribeDBSubnetGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, subnet := range page.DBSubnetGroups { + resourceName := StringValue(subnet.DBSubnetGroupName) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -82,14 +92,18 @@ func (g *RDSGenerator) loadDBSubnetGroups(svc *rds.Client) error { )) } } - return p.Err() + return nil } func (g *RDSGenerator) loadOptionGroups(svc *rds.Client) error { - p := rds.NewDescribeOptionGroupsPaginator(svc.DescribeOptionGroupsRequest(&rds.DescribeOptionGroupsInput{})) - for p.Next(context.Background()) { - for _, optionGroup := range p.CurrentPage().OptionGroupsList { - resourceName := aws.StringValue(optionGroup.OptionGroupName) + p := rds.NewDescribeOptionGroupsPaginator(svc, &rds.DescribeOptionGroupsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, optionGroup := range page.OptionGroupsList { + resourceName := StringValue(optionGroup.OptionGroupName) if strings.Contains(resourceName, ".") || strings.Contains(resourceName, ":") { continue // skip default Default OptionGroups like default.mysql5.6 } @@ -102,14 +116,18 @@ func (g *RDSGenerator) loadOptionGroups(svc *rds.Client) error { )) } } - return p.Err() + return nil } func (g *RDSGenerator) loadEventSubscription(svc *rds.Client) error { - p := rds.NewDescribeEventSubscriptionsPaginator(svc.DescribeEventSubscriptionsRequest(&rds.DescribeEventSubscriptionsInput{})) - for p.Next(context.Background()) { - for _, eventSubscription := range p.CurrentPage().EventSubscriptionsList { - resourceName := aws.StringValue(eventSubscription.CustomerAwsId) + p := rds.NewDescribeEventSubscriptionsPaginator(svc, &rds.DescribeEventSubscriptionsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, eventSubscription := range page.EventSubscriptionsList { + resourceName := StringValue(eventSubscription.CustomerAwsId) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, @@ -119,7 +137,7 @@ func (g *RDSGenerator) loadEventSubscription(svc *rds.Client) error { )) } } - return p.Err() + return nil } // Generate TerraformResources from AWS API, @@ -131,7 +149,7 @@ func (g *RDSGenerator) InitResources() error { if e != nil { return e } - svc := rds.New(config) + svc := rds.NewFromConfig(config) if err := g.loadDBInstances(svc); err != nil { return err diff --git a/providers/aws/resourcegroups.go b/providers/aws/resourcegroups.go index cf526234a0..d8993ee1c9 100644 --- a/providers/aws/resourcegroups.go +++ b/providers/aws/resourcegroups.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/resourcegroups" ) @@ -33,12 +32,16 @@ func (g *ResourceGroupsGenerator) InitResources() error { if e != nil { return e } - svc := resourcegroups.New(config) - p := resourcegroups.NewListGroupsPaginator(svc.ListGroupsRequest(&resourcegroups.ListGroupsInput{})) + svc := resourcegroups.NewFromConfig(config) + p := resourcegroups.NewListGroupsPaginator(svc, &resourcegroups.ListGroupsInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, group := range p.CurrentPage().Groups { - groupName := aws.StringValue(group.Name) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, groupIdentifier := range page.GroupIdentifiers { + groupName := StringValue(groupIdentifier.GroupName) resources = append(resources, terraformutils.NewSimpleResource( groupName, groupName, @@ -48,5 +51,5 @@ func (g *ResourceGroupsGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/route53.go b/providers/aws/route53.go index 9fdcb147d5..508be717ac 100644 --- a/providers/aws/route53.go +++ b/providers/aws/route53.go @@ -35,18 +35,23 @@ type Route53Generator struct { } func (g *Route53Generator) createZonesResources(svc *route53.Client) []terraformutils.Resource { - resources := []terraformutils.Resource{} - p := route53.NewListHostedZonesPaginator(svc.ListHostedZonesRequest(&route53.ListHostedZonesInput{})) - for p.Next(context.Background()) { - for _, zone := range p.CurrentPage().HostedZones { - zoneID := cleanZoneID(aws.StringValue(zone.Id)) + var resources []terraformutils.Resource + p := route53.NewListHostedZonesPaginator(svc, &route53.ListHostedZonesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + log.Println(err) + return resources + } + for _, zone := range page.HostedZones { + zoneID := cleanZoneID(StringValue(zone.Id)) resources = append(resources, terraformutils.NewResource( zoneID, - zoneID+"_"+strings.TrimSuffix(aws.StringValue(zone.Name), "."), + zoneID+"_"+strings.TrimSuffix(StringValue(zone.Name), "."), "aws_route53_zone", "aws", map[string]string{ - "name": aws.StringValue(zone.Name), + "name": StringValue(zone.Name), "force_destroy": "false", }, route53AllowEmptyValues, @@ -56,43 +61,45 @@ func (g *Route53Generator) createZonesResources(svc *route53.Client) []terraform resources = append(resources, records...) } } - if err := p.Err(); err != nil { - log.Println(err) - } return resources } func (Route53Generator) createRecordsResources(svc *route53.Client, zoneID string) []terraformutils.Resource { var resources []terraformutils.Resource + var startRecordIdentifier *string + var sets *route53.ListResourceRecordSetsOutput + var err error listParams := &route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String(zoneID), + HostedZoneId: aws.String(zoneID), + StartRecordIdentifier: startRecordIdentifier, } - p := route53.NewListResourceRecordSetsPaginator(svc.ListResourceRecordSetsRequest(listParams)) - for p.Next(context.Background()) { - for _, record := range p.CurrentPage().ResourceRecordSets { - recordName := wildcardUnescape(aws.StringValue(record.Name)) - typeString, _ := record.Type.MarshalValue() + sets, err = svc.ListResourceRecordSets(context.TODO(), listParams) + if err != nil { + log.Println(err) + return resources + } + + for sets == nil || sets.NextRecordIdentifier != nil { + for _, record := range sets.ResourceRecordSets { + recordName := wildcardUnescape(StringValue(record.Name)) + typeString := string(record.Type) resources = append(resources, terraformutils.NewResource( - fmt.Sprintf("%s_%s_%s_%s", zoneID, recordName, typeString, aws.StringValue(record.SetIdentifier)), - fmt.Sprintf("%s_%s_%s_%s", zoneID, recordName, typeString, aws.StringValue(record.SetIdentifier)), + fmt.Sprintf("%s_%s_%s_%s", zoneID, recordName, typeString, StringValue(record.SetIdentifier)), + fmt.Sprintf("%s_%s_%s_%s", zoneID, recordName, typeString, StringValue(record.SetIdentifier)), "aws_route53_record", "aws", map[string]string{ "name": strings.TrimSuffix(recordName, "."), "zone_id": zoneID, "type": typeString, - "set_identifier": aws.StringValue(record.SetIdentifier), + "set_identifier": StringValue(record.SetIdentifier), }, route53AllowEmptyValues, route53AdditionalFields, )) } } - if err := p.Err(); err != nil { - log.Println(err) - return []terraformutils.Resource{} - } return resources } @@ -103,7 +110,7 @@ func (g *Route53Generator) InitResources() error { if e != nil { return e } - svc := route53.New(config) + svc := route53.NewFromConfig(config) g.Resources = g.createZonesResources(svc) return nil diff --git a/providers/aws/route_table.go b/providers/aws/route_table.go index 6f61655ebe..83eb73a1cf 100644 --- a/providers/aws/route_table.go +++ b/providers/aws/route_table.go @@ -20,7 +20,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -31,30 +30,35 @@ type RouteTableGenerator struct { } func (g *RouteTableGenerator) createRouteTablesResources(svc *ec2.Client) []terraformutils.Resource { - resources := []terraformutils.Resource{} - p := ec2.NewDescribeRouteTablesPaginator(svc.DescribeRouteTablesRequest(&ec2.DescribeRouteTablesInput{})) - for p.Next(context.Background()) { - for _, table := range p.CurrentPage().RouteTables { + var resources []terraformutils.Resource + p := ec2.NewDescribeRouteTablesPaginator(svc, &ec2.DescribeRouteTablesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + log.Println(err) + return resources + } + for _, table := range page.RouteTables { // route table resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(table.RouteTableId), - aws.StringValue(table.RouteTableId), + StringValue(table.RouteTableId), + StringValue(table.RouteTableId), "aws_route_table", "aws", rtbAllowEmptyValues, )) for _, assoc := range table.Associations { - if aws.BoolValue(assoc.Main) { + if assoc.Main { // main route table association resources = append(resources, terraformutils.NewResource( - aws.StringValue(assoc.RouteTableAssociationId), - aws.StringValue(table.VpcId), + StringValue(assoc.RouteTableAssociationId), + StringValue(table.VpcId), "aws_main_route_table_association", "aws", map[string]string{ - "vpc_id": aws.StringValue(table.VpcId), - "route_table_id": aws.StringValue(table.RouteTableId), + "vpc_id": StringValue(table.VpcId), + "route_table_id": StringValue(table.RouteTableId), }, rtbAllowEmptyValues, map[string]interface{}{}, @@ -62,13 +66,13 @@ func (g *RouteTableGenerator) createRouteTablesResources(svc *ec2.Client) []terr } else { // subnet-specific route table association resources = append(resources, terraformutils.NewResource( - aws.StringValue(assoc.RouteTableAssociationId), - aws.StringValue(assoc.SubnetId), + StringValue(assoc.RouteTableAssociationId), + StringValue(assoc.SubnetId), "aws_route_table_association", "aws", map[string]string{ - "subnet_id": aws.StringValue(assoc.SubnetId), - "route_table_id": aws.StringValue(table.RouteTableId), + "subnet_id": StringValue(assoc.SubnetId), + "route_table_id": StringValue(table.RouteTableId), }, rtbAllowEmptyValues, map[string]interface{}{}, @@ -77,9 +81,6 @@ func (g *RouteTableGenerator) createRouteTablesResources(svc *ec2.Client) []terr } } } - if err := p.Err(); err != nil { - log.Println(err) - } return resources } @@ -90,7 +91,7 @@ func (g *RouteTableGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) + svc := ec2.NewFromConfig(config) g.Resources = g.createRouteTablesResources(svc) return nil diff --git a/providers/aws/s3.go b/providers/aws/s3.go index 0076adc8ca..1dbd245b6d 100644 --- a/providers/aws/s3.go +++ b/providers/aws/s3.go @@ -17,12 +17,11 @@ package aws import ( "context" "fmt" + "github.com/IBM/ibm-cos-sdk-go/aws/awserr" "log" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws/awserr" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/s3" ) @@ -39,26 +38,26 @@ type S3Generator struct { // for each bucket we check region and choose only bucket from set region // for each bucket try get bucket policy, if policy exist create additional NewTerraformResource for policy func (g *S3Generator) createResources(config aws.Config, buckets *s3.ListBucketsOutput, region string) []terraformutils.Resource { - resources := []terraformutils.Resource{} - svc := s3.New(config) + var resources []terraformutils.Resource + svc := s3.NewFromConfig(config) for _, bucket := range buckets.Buckets { - resourceName := aws.StringValue(bucket.Name) - location, err := svc.GetBucketLocationRequest(&s3.GetBucketLocationInput{Bucket: bucket.Name}).Send(context.Background()) + resourceName := StringValue(bucket.Name) + location, err := svc.GetBucketLocation(context.TODO(), &s3.GetBucketLocationInput{Bucket: bucket.Name}) if err != nil { log.Println(err) continue } // check if bucket in region - constraintString, _ := s3.NormalizeBucketLocation(location.LocationConstraint).MarshalValue() + constraintString := string(location.LocationConstraint) if constraintString == region { attributes := map[string]string{ "force_destroy": "false", "acl": "private", } // try get policy - policy, err := svc.GetBucketPolicyRequest(&s3.GetBucketPolicyInput{ + policy, err := svc.GetBucketPolicy(context.TODO(), &s3.GetBucketPolicyInput{ Bucket: bucket.Name, - }).Send(context.Background()) + }) if err != nil { if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() != "NoSuchBucketPolicy" { @@ -82,7 +81,6 @@ func (g *S3Generator) createResources(config aws.Config, buckets *s3.ListBuckets } // Generate TerraformResources from AWS API, -// from each s3 bucket create 2 TerraformResource(bucket and bucket policy) // Need bucket name as ID for terraform resource func (g *S3Generator) InitResources() error { config, e := g.generateConfig() @@ -91,7 +89,7 @@ func (g *S3Generator) InitResources() error { } svc := s3.NewFromConfig(config) - buckets, err := svc.ListBucketsRequest(&s3.ListBucketsInput{}).Send(context.Background()) + buckets, err := svc.ListBuckets(context.TODO(), &s3.ListBucketsInput{}) if err != nil { return err } diff --git a/providers/aws/secretsmanager.go b/providers/aws/secretsmanager.go index aeed35f3c6..b897fb0b5d 100644 --- a/providers/aws/secretsmanager.go +++ b/providers/aws/secretsmanager.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/secretsmanager" ) @@ -33,13 +32,17 @@ func (g *SecretsManagerGenerator) InitResources() error { if e != nil { return e } - svc := secretsmanager.New(config) - p := secretsmanager.NewListSecretsPaginator(svc.ListSecretsRequest(&secretsmanager.ListSecretsInput{})) + svc := secretsmanager.NewFromConfig(config) + p := secretsmanager.NewListSecretsPaginator(svc, &secretsmanager.ListSecretsInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, secret := range p.CurrentPage().SecretList { - secretArn := aws.StringValue(secret.ARN) - secretName := aws.StringValue(secret.Name) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, secret := range page.SecretList { + secretArn := StringValue(secret.ARN) + secretName := StringValue(secret.Name) resources = append(resources, terraformutils.NewSimpleResource( secretArn, secretName, @@ -49,5 +52,5 @@ func (g *SecretsManagerGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/securityhub.go b/providers/aws/securityhub.go index cb243c7cdf..6742e06e5e 100644 --- a/providers/aws/securityhub.go +++ b/providers/aws/securityhub.go @@ -33,7 +33,7 @@ func (g *SecurityhubGenerator) InitResources() error { if e != nil { return e } - client := securityhub.New(config) + client := securityhub.NewFromConfig(config) account, err := g.getAccountNumber(config) if err != nil { @@ -56,7 +56,7 @@ func (g *SecurityhubGenerator) InitResources() error { } func (g *SecurityhubGenerator) addAccount(client *securityhub.Client, accountNumber string) (bool, error) { - _, err := client.GetEnabledStandardsRequest(&securityhub.GetEnabledStandardsInput{}).Send(context.Background()) + _, err := client.GetEnabledStandards(context.TODO(), &securityhub.GetEnabledStandardsInput{}) if err != nil { errorMsg := err.Error() @@ -76,10 +76,13 @@ func (g *SecurityhubGenerator) addAccount(client *securityhub.Client, accountNum } func (g *SecurityhubGenerator) addMembers(svc *securityhub.Client, accountNumber string) error { - p := securityhub.NewListMembersPaginator(svc.ListMembersRequest(&securityhub.ListMembersInput{})) + p := securityhub.NewListMembersPaginator(svc, &securityhub.ListMembersInput{}) - for p.Next(context.Background()) { - page := p.CurrentPage() + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } for _, member := range page.Members { id := *member.AccountId g.Resources = append(g.Resources, terraformutils.NewResource( @@ -98,15 +101,17 @@ func (g *SecurityhubGenerator) addMembers(svc *securityhub.Client, accountNumber )) } } - return p.Err() + return nil } func (g *SecurityhubGenerator) addStandardsSubscription(svc *securityhub.Client, accountNumber string) error { - p := securityhub.NewGetEnabledStandardsPaginator( - svc.GetEnabledStandardsRequest(&securityhub.GetEnabledStandardsInput{})) + p := securityhub.NewGetEnabledStandardsPaginator(svc, &securityhub.GetEnabledStandardsInput{}) - for p.Next(context.Background()) { - page := p.CurrentPage() + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } for _, standardsSubscription := range page.StandardsSubscriptions { id := *standardsSubscription.StandardsSubscriptionArn g.Resources = append(g.Resources, terraformutils.NewResource( @@ -124,5 +129,5 @@ func (g *SecurityhubGenerator) addStandardsSubscription(svc *securityhub.Client, )) } } - return p.Err() + return nil } diff --git a/providers/aws/servicecatalog.go b/providers/aws/servicecatalog.go index 2ec5c5a62b..427449e4b0 100644 --- a/providers/aws/servicecatalog.go +++ b/providers/aws/servicecatalog.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/servicecatalog" ) @@ -33,13 +32,17 @@ func (g *ServiceCatalogGenerator) InitResources() error { if e != nil { return e } - svc := servicecatalog.New(config) - p := servicecatalog.NewListPortfoliosPaginator(svc.ListPortfoliosRequest(&servicecatalog.ListPortfoliosInput{})) + svc := servicecatalog.NewFromConfig(config) + p := servicecatalog.NewListPortfoliosPaginator(svc, &servicecatalog.ListPortfoliosInput{}) var resources []terraformutils.Resource - for p.Next(context.Background()) { - for _, portfolio := range p.CurrentPage().PortfolioDetails { - portfolioID := aws.StringValue(portfolio.Id) - portfolioName := aws.StringValue(portfolio.DisplayName) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, portfolio := range page.PortfolioDetails { + portfolioID := StringValue(portfolio.Id) + portfolioName := StringValue(portfolio.DisplayName) resources = append(resources, terraformutils.NewSimpleResource( portfolioID, portfolioName, @@ -49,5 +52,5 @@ func (g *ServiceCatalogGenerator) InitResources() error { } } g.Resources = resources - return p.Err() + return nil } diff --git a/providers/aws/ses.go b/providers/aws/ses.go index fb82afe97d..15f16d0846 100644 --- a/providers/aws/ses.go +++ b/providers/aws/ses.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/ses" - "github.com/aws/aws-sdk-go/aws" ) var sesAllowEmptyValues = []string{"tags."} @@ -33,7 +32,7 @@ func (g *SesGenerator) InitResources() error { if e != nil { return e } - svc := ses.New(config) + svc := ses.NewFromConfig(config) if err := g.loadDomainIdentities(svc); err != nil { return err @@ -55,11 +54,15 @@ func (g *SesGenerator) InitResources() error { } func (g *SesGenerator) loadDomainIdentities(svc *ses.Client) error { - p := ses.NewListIdentitiesPaginator(svc.ListIdentitiesRequest(&ses.ListIdentitiesInput{ + p := ses.NewListIdentitiesPaginator(svc, &ses.ListIdentitiesInput{ IdentityType: "Domain", - })) - for p.Next(context.Background()) { - for _, identity := range p.CurrentPage().Identities { + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, identity := range page.Identities { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( identity, identity, @@ -68,15 +71,19 @@ func (g *SesGenerator) loadDomainIdentities(svc *ses.Client) error { sesAllowEmptyValues)) } } - return p.Err() + return nil } func (g *SesGenerator) loadMailIdentities(svc *ses.Client) error { - p := ses.NewListIdentitiesPaginator(svc.ListIdentitiesRequest(&ses.ListIdentitiesInput{ + p := ses.NewListIdentitiesPaginator(svc, &ses.ListIdentitiesInput{ IdentityType: "EmailAddress", - })) - for p.Next(context.Background()) { - for _, identity := range p.CurrentPage().Identities { + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, identity := range page.Identities { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( identity, identity, @@ -85,19 +92,19 @@ func (g *SesGenerator) loadMailIdentities(svc *ses.Client) error { sesAllowEmptyValues)) } } - return p.Err() + return nil } func (g *SesGenerator) loadTemplates(svc *ses.Client) error { - templates, err := svc.ListTemplatesRequest(&ses.ListTemplatesInput{}).Send(context.Background()) + templates, err := svc.ListTemplates(context.TODO(), &ses.ListTemplatesInput{}) if err != nil { return err } for _, templateMetadata := range templates.TemplatesMetadata { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(templateMetadata.Name), - aws.StringValue(templateMetadata.Name), + StringValue(templateMetadata.Name), + StringValue(templateMetadata.Name), "aws_ses_template", "aws", sesAllowEmptyValues)) @@ -106,15 +113,15 @@ func (g *SesGenerator) loadTemplates(svc *ses.Client) error { } func (g *SesGenerator) loadConfigurationSets(svc *ses.Client) error { - configurationSets, err := svc.ListConfigurationSetsRequest(&ses.ListConfigurationSetsInput{}).Send(context.Background()) + configurationSets, err := svc.ListConfigurationSets(context.TODO(), &ses.ListConfigurationSetsInput{}) if err != nil { return err } for _, configurationSet := range configurationSets.ConfigurationSets { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(configurationSet.Name), - aws.StringValue(configurationSet.Name), + StringValue(configurationSet.Name), + StringValue(configurationSet.Name), "aws_ses_configuration_set", "aws", sesAllowEmptyValues)) @@ -123,22 +130,22 @@ func (g *SesGenerator) loadConfigurationSets(svc *ses.Client) error { } func (g *SesGenerator) loadRuleSets(svc *ses.Client) error { - ruleSets, err := svc.ListReceiptRuleSetsRequest(&ses.ListReceiptRuleSetsInput{}).Send(context.Background()) + ruleSets, err := svc.ListReceiptRuleSets(context.TODO(), &ses.ListReceiptRuleSetsInput{}) if err != nil { return err } for _, ruleSet := range ruleSets.RuleSets { - ruleSetName := aws.StringValue(ruleSet.Name) + ruleSetName := StringValue(ruleSet.Name) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( ruleSetName, ruleSetName, "aws_ses_receipt_rule_set", "aws", sesAllowEmptyValues)) - rules, err := svc.DescribeReceiptRuleSetRequest(&ses.DescribeReceiptRuleSetInput{ + rules, err := svc.DescribeReceiptRuleSet(context.TODO(), &ses.DescribeReceiptRuleSetInput{ RuleSetName: ruleSet.Name, - }).Send(context.Background()) + }) if err != nil { return err } diff --git a/providers/aws/sfn.go b/providers/aws/sfn.go index 324f249f7a..1a873df639 100644 --- a/providers/aws/sfn.go +++ b/providers/aws/sfn.go @@ -18,11 +18,15 @@ func (g *SfnGenerator) InitResources() error { if e != nil { return e } - svc := sfn.New(config) + svc := sfn.NewFromConfig(config) - p := sfn.NewListStateMachinesPaginator(svc.ListStateMachinesRequest(&sfn.ListStateMachinesInput{})) - for p.Next(context.Background()) { - for _, stateMachine := range p.CurrentPage().StateMachines { + p := sfn.NewListStateMachinesPaginator(svc, &sfn.ListStateMachinesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, stateMachine := range page.StateMachines { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *stateMachine.StateMachineArn, *stateMachine.Name, @@ -30,16 +34,16 @@ func (g *SfnGenerator) InitResources() error { "aws", sfnAllowEmptyValues, )) - - if err := p.Err(); err != nil { - return err - } } } - pActivity := sfn.NewListActivitiesPaginator(svc.ListActivitiesRequest(&sfn.ListActivitiesInput{})) - for pActivity.Next(context.Background()) { - for _, stateMachine := range pActivity.CurrentPage().Activities { + pActivity := sfn.NewListActivitiesPaginator(svc, &sfn.ListActivitiesInput{}) + for pActivity.HasMorePages() { + pActivityNextPage, err := pActivity.NextPage(context.TODO()) + if err != nil { + return err + } + for _, stateMachine := range pActivityNextPage.Activities { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *stateMachine.ActivityArn, *stateMachine.Name, @@ -47,10 +51,6 @@ func (g *SfnGenerator) InitResources() error { "aws", sfnAllowEmptyValues, )) - - if err := pActivity.Err(); err != nil { - return err - } } } diff --git a/providers/aws/sg.go b/providers/aws/sg.go index 048086d853..6d2993c952 100644 --- a/providers/aws/sg.go +++ b/providers/aws/sg.go @@ -23,8 +23,8 @@ import ( "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/hashicorp/terraform/flatmap" "gonum.org/v1/gonum/graph" simplegraph "gonum.org/v1/gonum/graph/simple" @@ -41,7 +41,7 @@ type SecurityGenerator struct { AWSService } -type ByGroupPair []ec2.UserIdGroupPair +type ByGroupPair []types.UserIdGroupPair func (b ByGroupPair) Len() int { return len(b) } func (b ByGroupPair) Swap(i, j int) { b[i], b[j] = b[j], b[i] } @@ -56,7 +56,7 @@ func (b ByGroupPair) Less(i, j int) bool { panic("mismatched security group rules, may be a terraform bug") } -func (SecurityGenerator) createResources(securityGroups []ec2.SecurityGroup) []terraformutils.Resource { +func (SecurityGenerator) createResources(securityGroups []types.SecurityGroup) []terraformutils.Resource { var sgIDsToMoveOut []string _, shouldSplitRules := os.LookupEnv("SPLIT_SG_RULES") if shouldSplitRules { @@ -87,8 +87,8 @@ func (SecurityGenerator) createResources(securityGroups []ec2.SecurityGroup) []t } resources = append(resources, terraformutils.NewResource( - aws.StringValue(sg.GroupId), - strings.Trim(aws.StringValue(sg.GroupName)+"_"+aws.StringValue(sg.GroupId), " "), + StringValue(sg.GroupId), + strings.Trim(StringValue(sg.GroupName)+"_"+StringValue(sg.GroupId), " "), "aws_security_group", "aws", map[string]string{}, @@ -98,7 +98,7 @@ func (SecurityGenerator) createResources(securityGroups []ec2.SecurityGroup) []t return resources } -func processRule(rule ec2.IpPermission, ruleType string, sg ec2.SecurityGroup, resources []terraformutils.Resource) []terraformutils.Resource { +func processRule(rule types.IpPermission, ruleType string, sg types.SecurityGroup, resources []terraformutils.Resource) []terraformutils.Resource { if rule.UserIdGroupPairs != nil && len(rule.UserIdGroupPairs) > 0 { if len(rule.IpRanges) > 0 { // we must unwind coupled CIDR IPv4 range + security group rules attributes := baseRuleAttributes(ruleType, rule, sg) @@ -155,7 +155,7 @@ func processRule(rule ec2.IpPermission, ruleType string, sg ec2.SecurityGroup, r return resources } -func baseRuleAttributes(ruleType string, rule ec2.IpPermission, sg ec2.SecurityGroup) map[string]interface{} { +func baseRuleAttributes(ruleType string, rule types.IpPermission, sg types.SecurityGroup) map[string]interface{} { attributes := map[string]interface{}{ "type": ruleType, "cidr_blocks": ipRange(rule), @@ -171,15 +171,15 @@ func baseRuleAttributes(ruleType string, rule ec2.IpPermission, sg ec2.SecurityG // Let's try to find all cycles by applying Johnson's method on the directed graph // We cannot build a line graph and move out only rules because of hashicorp/terraform#11011 -func findSgsToMoveOut(securityGroups []ec2.SecurityGroup) []string { +func findSgsToMoveOut(securityGroups []types.SecurityGroup) []string { // Vertexes are security groups, edges are rules. The task is to find correct set of rule definitions, so that we // won't have cycles sourceGraph := simplegraph.NewDirectedGraph() - idToSg := make(map[int]ec2.SecurityGroup) + idToSg := make(map[int]types.SecurityGroup) sgToIdx := make(map[string]int64) for idx, sg := range securityGroups { idToSg[idx] = sg - sgToIdx[aws.StringValue(sg.GroupId)] = int64(idx) + sgToIdx[StringValue(sg.GroupId)] = int64(idx) sourceGraph.AddNode(sourceGraph.NewNode()) } for idx, sg := range securityGroups { @@ -188,7 +188,7 @@ func findSgsToMoveOut(securityGroups []ec2.SecurityGroup) []string { for _, pair := range pairs { if pair.GroupId != nil { fromNode := sourceGraph.Node(int64(idx)) - toNode := sourceGraph.Node(sgToIdx[aws.StringValue(pair.GroupId)]) + toNode := sourceGraph.Node(sgToIdx[StringValue(pair.GroupId)]) if fromNode.ID() != toNode.ID() { sourceGraph.SetEdge(sourceGraph.NewEdge(fromNode, toNode)) } @@ -227,7 +227,7 @@ func findSgsToMoveOut(securityGroups []ec2.SecurityGroup) []string { return result } -func elementAlreadyFound(resultingSet map[string]void, v []graph.Node, idToSg map[int]ec2.SecurityGroup) bool { +func elementAlreadyFound(resultingSet map[string]void, v []graph.Node, idToSg map[int]types.SecurityGroup) bool { for k := range resultingSet { for _, vi := range v { viGroupID := *idToSg[int(vi.ID())].GroupId @@ -244,20 +244,21 @@ func (g *SecurityGenerator) InitResources() error { if err != nil { return err } - svc := ec2.New(config) - p := ec2.NewDescribeSecurityGroupsPaginator(svc.DescribeSecurityGroupsRequest(&ec2.DescribeSecurityGroupsInput{})) - var resourcesToFilter []ec2.SecurityGroup - for p.Next(context.Background()) { - resourcesToFilter = append(resourcesToFilter, p.CurrentPage().SecurityGroups...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeSecurityGroupsPaginator(svc, &ec2.DescribeSecurityGroupsInput{}) + var resourcesToFilter []types.SecurityGroup + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + resourcesToFilter = append(resourcesToFilter, page.SecurityGroups...) } sort.Slice(resourcesToFilter, func(i, j int) bool { return *resourcesToFilter[i].GroupId < *resourcesToFilter[j].GroupId }) g.Resources = g.createResources(resourcesToFilter) - if err := p.Err(); err != nil { - return err - } return nil } @@ -306,7 +307,7 @@ func (g *SecurityGenerator) sortIfExist(attribute string, ruleMap map[string]int } } -func permissionID(sgID, ruleType, groupID string, ip ec2.IpPermission) string { +func permissionID(sgID, ruleType, groupID string, ip types.IpPermission) string { var buf bytes.Buffer buf.WriteString(fmt.Sprintf("%s_%s_%s_%d_%d_", sgID, ruleType, *ip.IpProtocol, fromPort(ip), toPort(ip))) @@ -354,29 +355,29 @@ func permissionID(sgID, ruleType, groupID string, ip ec2.IpPermission) string { return idPreformatted[:len(idPreformatted)-1] } -func fromPort(ip ec2.IpPermission) int { +func fromPort(ip types.IpPermission) int { switch { case *ip.IpProtocol == "icmp": return -1 - case ip.FromPort != nil && *ip.FromPort > 0: - return int(*ip.FromPort) + case ip.FromPort > 0: + return int(ip.FromPort) default: return 0 } } -func toPort(ip ec2.IpPermission) int { +func toPort(ip types.IpPermission) int { switch { case *ip.IpProtocol == "icmp": return -1 - case ip.ToPort != nil && *ip.ToPort > 0: - return int(*ip.ToPort) + case ip.ToPort > 0: + return int(ip.ToPort) default: return 65536 } } -func ipRange(rule ec2.IpPermission) []string { +func ipRange(rule types.IpPermission) []string { result := make([]string, len(rule.IpRanges)) for idx, rule := range rule.IpRanges { result[idx] = *rule.CidrIp @@ -384,7 +385,7 @@ func ipRange(rule ec2.IpPermission) []string { return result } -func ip6Range(rule ec2.IpPermission) []string { +func ip6Range(rule types.IpPermission) []string { result := make([]string, len(rule.Ipv6Ranges)) for idx, rule := range rule.Ipv6Ranges { result[idx] = *rule.CidrIpv6 @@ -392,7 +393,7 @@ func ip6Range(rule ec2.IpPermission) []string { return result } -func prefixes(rule ec2.IpPermission) []string { +func prefixes(rule types.IpPermission) []string { result := make([]string, len(rule.PrefixListIds)) for idx, rule := range rule.PrefixListIds { result[idx] = *rule.PrefixListId diff --git a/providers/aws/sg_test.go b/providers/aws/sg_test.go index 34988340c9..33b516ea26 100644 --- a/providers/aws/sg_test.go +++ b/providers/aws/sg_test.go @@ -19,11 +19,11 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) func TestEmptySgs(t *testing.T) { - var securityGroups []ec2.SecurityGroup + var securityGroups []types.SecurityGroup rulesToMoveOut := findSgsToMoveOut(securityGroups) @@ -33,11 +33,11 @@ func TestEmptySgs(t *testing.T) { } func Test1CycleReference(t *testing.T) { - sgA := ec2.SecurityGroup{ + sgA := types.SecurityGroup{ GroupId: aws.String("aaaa"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("aaaa"), }, @@ -46,7 +46,7 @@ func Test1CycleReference(t *testing.T) { {}, }, } - securityGroups := []ec2.SecurityGroup{ + securityGroups := []types.SecurityGroup{ sgA, } @@ -58,11 +58,11 @@ func Test1CycleReference(t *testing.T) { } func Test2CycleReference(t *testing.T) { - sgA := ec2.SecurityGroup{ + sgA := types.SecurityGroup{ GroupId: aws.String("aaaa"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("bbbb"), }, @@ -70,12 +70,12 @@ func Test2CycleReference(t *testing.T) { }, }, } - securityGroups := []ec2.SecurityGroup{ + securityGroups := []types.SecurityGroup{ { GroupId: aws.String("bbbb"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("aaaa"), }, @@ -95,11 +95,11 @@ func Test2CycleReference(t *testing.T) { } func TestNoCycleReference(t *testing.T) { - sgA := ec2.SecurityGroup{ + sgA := types.SecurityGroup{ GroupId: aws.String("aaaa"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("bbbb"), }, @@ -107,10 +107,10 @@ func TestNoCycleReference(t *testing.T) { }, }, } - securityGroups := []ec2.SecurityGroup{ + securityGroups := []types.SecurityGroup{ { GroupId: aws.String("bbbb"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ {}, {}, }, @@ -126,18 +126,18 @@ func TestNoCycleReference(t *testing.T) { } func Test3Cycle1CycleReference(t *testing.T) { - sgA := ec2.SecurityGroup{ + sgA := types.SecurityGroup{ GroupId: aws.String("aaaa"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("aaaa"), }, }, }, { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("bbbb"), }, @@ -145,13 +145,13 @@ func Test3Cycle1CycleReference(t *testing.T) { }, }, } - securityGroups := []ec2.SecurityGroup{ + securityGroups := []types.SecurityGroup{ sgA, { GroupId: aws.String("bbbb"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("cccc"), }, @@ -162,9 +162,9 @@ func Test3Cycle1CycleReference(t *testing.T) { }, { GroupId: aws.String("cccc"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("aaaa"), }, @@ -175,9 +175,9 @@ func Test3Cycle1CycleReference(t *testing.T) { }, { GroupId: aws.String("dddd"), - IpPermissions: []ec2.IpPermission{ + IpPermissions: []types.IpPermission{ { - UserIdGroupPairs: []ec2.UserIdGroupPair{ + UserIdGroupPairs: []types.UserIdGroupPair{ { GroupId: aws.String("aaaa"), }, diff --git a/providers/aws/sns.go b/providers/aws/sns.go index 1578544eb6..8fa5d839b0 100644 --- a/providers/aws/sns.go +++ b/providers/aws/sns.go @@ -21,8 +21,6 @@ import ( "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/sns" ) @@ -42,32 +40,41 @@ func (g *SnsGenerator) InitResources() error { if e != nil { return e } - svc := sns.New(config) - p := sns.NewListTopicsPaginator(svc.ListTopicsRequest(&sns.ListTopicsInput{})) - for p.Next(context.Background()) { - for _, topic := range p.CurrentPage().Topics { - arnParts := strings.Split(aws.StringValue(topic.TopicArn), ":") + svc := sns.NewFromConfig(config) + p := sns.NewListTopicsPaginator(svc, &sns.ListTopicsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, topic := range page.Topics { + arnParts := strings.Split(StringValue(topic.TopicArn), ":") topicName := arnParts[len(arnParts)-1] g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(topic.TopicArn), + StringValue(topic.TopicArn), topicName, "aws_sns_topic", "aws", snsAllowEmptyValues, )) - topicSubsPage := sns.NewListSubscriptionsByTopicPaginator(svc.ListSubscriptionsByTopicRequest(&sns.ListSubscriptionsByTopicInput{ + topicSubsPage := sns.NewListSubscriptionsByTopicPaginator(svc, &sns.ListSubscriptionsByTopicInput{ TopicArn: topic.TopicArn, - })) - for topicSubsPage.Next(context.Background()) { - for _, subscription := range topicSubsPage.CurrentPage().Subscriptions { - subscriptionArnParts := strings.Split(aws.StringValue(subscription.SubscriptionArn), ":") + }) + for topicSubsPage.HasMorePages() { + topicSubsNextPage, err := topicSubsPage.NextPage(context.TODO()) + if err != nil { + log.Println(err) + continue + } + for _, subscription := range topicSubsNextPage.Subscriptions { + subscriptionArnParts := strings.Split(StringValue(subscription.SubscriptionArn), ":") subscriptionID := subscriptionArnParts[len(subscriptionArnParts)-1] - if g.isSupportedSubscription(aws.StringValue(subscription.Protocol), subscriptionID) { + if g.isSupportedSubscription(StringValue(subscription.Protocol), subscriptionID) { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(subscription.SubscriptionArn), + StringValue(subscription.SubscriptionArn), "subscription-"+subscriptionID, "aws_sns_topic_subscription", "aws", @@ -76,12 +83,9 @@ func (g *SnsGenerator) InitResources() error { } } } - if err := topicSubsPage.Err(); err != nil { - log.Println(err) - } } } - return p.Err() + return nil } // PostConvertHook for add policy json as heredoc diff --git a/providers/aws/sqs.go b/providers/aws/sqs.go index db729c8ab3..559f370815 100644 --- a/providers/aws/sqs.go +++ b/providers/aws/sqs.go @@ -37,7 +37,7 @@ func (g *SqsGenerator) InitResources() error { if e != nil { return e } - svc := sqs.New(config) + svc := sqs.NewFromConfig(config) listQueuesInput := sqs.ListQueuesInput{} @@ -46,7 +46,7 @@ func (g *SqsGenerator) InitResources() error { listQueuesInput.QueueNamePrefix = aws.String(sqsPrefix) } - queuesList, err := svc.ListQueuesRequest(&listQueuesInput).Send(context.Background()) + queuesList, err := svc.ListQueues(context.TODO(), &listQueuesInput) if err != nil { return err diff --git a/providers/aws/subnet.go b/providers/aws/subnet.go index e2a6a9225b..c31583c9bc 100644 --- a/providers/aws/subnet.go +++ b/providers/aws/subnet.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -32,8 +31,8 @@ func (SubnetGenerator) createResources(subnets *ec2.DescribeSubnetsOutput) []ter var resources []terraformutils.Resource for _, subnet := range subnets.Subnets { resource := terraformutils.NewSimpleResource( - aws.StringValue(subnet.SubnetId), - aws.StringValue(subnet.SubnetId), + StringValue(subnet.SubnetId), + StringValue(subnet.SubnetId), "aws_subnet", "aws", SubnetAllowEmptyValues, @@ -52,10 +51,14 @@ func (g *SubnetGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - p := ec2.NewDescribeSubnetsPaginator(svc.DescribeSubnetsRequest(&ec2.DescribeSubnetsInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage())...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeSubnetsPaginator(svc, &ec2.DescribeSubnetsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(page)...) } - return p.Err() + return nil } diff --git a/providers/aws/swf.go b/providers/aws/swf.go index 6ad3831c01..6a4a016355 100644 --- a/providers/aws/swf.go +++ b/providers/aws/swf.go @@ -5,6 +5,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/swf" + "github.com/aws/aws-sdk-go-v2/service/swf/types" ) type SWFGenerator struct { @@ -12,16 +13,20 @@ type SWFGenerator struct { } func (g *SWFGenerator) InitResources() error { - regStatuses := []swf.RegistrationStatus{swf.RegistrationStatusRegistered, swf.RegistrationStatusDeprecated} + regStatuses := []types.RegistrationStatus{types.RegistrationStatusRegistered, types.RegistrationStatusDeprecated} config, e := g.generateConfig() if e != nil { return e } - svc := swf.New(config) + svc := swf.NewFromConfig(config) for _, status := range regStatuses { - p := swf.NewListDomainsPaginator(svc.ListDomainsRequest(&swf.ListDomainsInput{RegistrationStatus: status})) - for p.Next(context.Background()) { - for _, domain := range p.CurrentPage().DomainInfos { + p := swf.NewListDomainsPaginator(svc, &swf.ListDomainsInput{RegistrationStatus: status}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, domain := range page.DomainInfos { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( *domain.Name, *domain.Name, diff --git a/providers/aws/transit_gateway.go b/providers/aws/transit_gateway.go index f8a8a78fba..c129870a76 100644 --- a/providers/aws/transit_gateway.go +++ b/providers/aws/transit_gateway.go @@ -20,7 +20,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -31,32 +30,40 @@ type TransitGatewayGenerator struct { } func (g *TransitGatewayGenerator) getTransitGateways(svc *ec2.Client) error { - p := ec2.NewDescribeTransitGatewaysPaginator(svc.DescribeTransitGatewaysRequest(&ec2.DescribeTransitGatewaysInput{})) - for p.Next(context.Background()) { - for _, tgw := range p.CurrentPage().TransitGateways { + p := ec2.NewDescribeTransitGatewaysPaginator(svc, &ec2.DescribeTransitGatewaysInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, tgw := range page.TransitGateways { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(tgw.TransitGatewayId), - aws.StringValue(tgw.TransitGatewayId), + StringValue(tgw.TransitGatewayId), + StringValue(tgw.TransitGatewayId), "aws_ec2_transit_gateway", "aws", tgwAllowEmptyValues, )) } } - return p.Err() + return nil } func (g *TransitGatewayGenerator) getTransitGatewayRouteTables(svc *ec2.Client) error { - p := ec2.NewDescribeTransitGatewayRouteTablesPaginator(svc.DescribeTransitGatewayRouteTablesRequest(&ec2.DescribeTransitGatewayRouteTablesInput{})) - for p.Next(context.Background()) { - for _, tgwrt := range p.CurrentPage().TransitGatewayRouteTables { + p := ec2.NewDescribeTransitGatewayRouteTablesPaginator(svc, &ec2.DescribeTransitGatewayRouteTablesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, tgwrt := range page.TransitGatewayRouteTables { // Default route table are automatically created on the tgw creation - if *tgwrt.DefaultAssociationRouteTable { + if tgwrt.DefaultAssociationRouteTable { continue } else { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(tgwrt.TransitGatewayRouteTableId), - aws.StringValue(tgwrt.TransitGatewayRouteTableId), + StringValue(tgwrt.TransitGatewayRouteTableId), + StringValue(tgwrt.TransitGatewayRouteTableId), "aws_ec2_transit_gateway_route_table", "aws", tgwAllowEmptyValues, @@ -64,23 +71,27 @@ func (g *TransitGatewayGenerator) getTransitGatewayRouteTables(svc *ec2.Client) } } } - return p.Err() + return nil } func (g *TransitGatewayGenerator) getTransitGatewayVpcAttachments(svc *ec2.Client) error { - p := ec2.NewDescribeTransitGatewayVpcAttachmentsPaginator(svc.DescribeTransitGatewayVpcAttachmentsRequest(&ec2.DescribeTransitGatewayVpcAttachmentsInput{})) - for p.Next(context.Background()) { - for _, tgwa := range p.CurrentPage().TransitGatewayVpcAttachments { + p := ec2.NewDescribeTransitGatewayVpcAttachmentsPaginator(svc, &ec2.DescribeTransitGatewayVpcAttachmentsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, tgwa := range page.TransitGatewayVpcAttachments { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(tgwa.TransitGatewayAttachmentId), - aws.StringValue(tgwa.TransitGatewayAttachmentId), + StringValue(tgwa.TransitGatewayAttachmentId), + StringValue(tgwa.TransitGatewayAttachmentId), "aws_ec2_transit_gateway_vpc_attachment", "aws", tgwAllowEmptyValues, )) } } - return p.Err() + return nil } // Generate TerraformResources from AWS API, @@ -91,7 +102,7 @@ func (g *TransitGatewayGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) + svc := ec2.NewFromConfig(config) g.Resources = []terraformutils.Resource{} err := g.getTransitGateways(svc) if err != nil { diff --git a/providers/aws/vgw.go b/providers/aws/vgw.go index 354b305a87..be2a9b9d6b 100644 --- a/providers/aws/vgw.go +++ b/providers/aws/vgw.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -29,12 +28,12 @@ type VpnGatewayGenerator struct { AWSService } -func (VpnGatewayGenerator) createResources(vpnGws *ec2.DescribeVpnGatewaysResponse) []terraformutils.Resource { - resources := []terraformutils.Resource{} +func (VpnGatewayGenerator) createResources(vpnGws *ec2.DescribeVpnGatewaysOutput) []terraformutils.Resource { + var resources []terraformutils.Resource for _, vpnGw := range vpnGws.VpnGateways { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(vpnGw.VpnGatewayId), - aws.StringValue(vpnGw.VpnGatewayId), + StringValue(vpnGw.VpnGatewayId), + StringValue(vpnGw.VpnGatewayId), "aws_vpn_gateway", "aws", VpnAllowEmptyValues, @@ -51,8 +50,8 @@ func (g *VpnGatewayGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - vpnGws, err := svc.DescribeVpnGatewaysRequest(&ec2.DescribeVpnGatewaysInput{}).Send(context.Background()) + svc := ec2.NewFromConfig(config) + vpnGws, err := svc.DescribeVpnGateways(context.TODO(), &ec2.DescribeVpnGatewaysInput{}) if err != nil { return err } diff --git a/providers/aws/vpc.go b/providers/aws/vpc.go index b3a5f63f7b..d37501349a 100644 --- a/providers/aws/vpc.go +++ b/providers/aws/vpc.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -33,8 +32,8 @@ func (VpcGenerator) createResources(vpcs *ec2.DescribeVpcsOutput) []terraformuti var resources []terraformutils.Resource for _, vpc := range vpcs.Vpcs { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(vpc.VpcId), - aws.StringValue(vpc.VpcId), + StringValue(vpc.VpcId), + StringValue(vpc.VpcId), "aws_vpc", "aws", VpcAllowEmptyValues, @@ -51,10 +50,14 @@ func (g *VpcGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - p := ec2.NewDescribeVpcsPaginator(svc.DescribeVpcsRequest(&ec2.DescribeVpcsInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage())...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeVpcsPaginator(svc, &ec2.DescribeVpcsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(page)...) } - return p.Err() + return nil } diff --git a/providers/aws/vpc_peering.go b/providers/aws/vpc_peering.go index d8272527ca..c28104db60 100644 --- a/providers/aws/vpc_peering.go +++ b/providers/aws/vpc_peering.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -30,11 +29,11 @@ type VpcPeeringConnectionGenerator struct { } func (g *VpcPeeringConnectionGenerator) createResources(peerings *ec2.DescribeVpcPeeringConnectionsOutput) []terraformutils.Resource { - resources := []terraformutils.Resource{} + var resources []terraformutils.Resource for _, peering := range peerings.VpcPeeringConnections { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(peering.VpcPeeringConnectionId), - aws.StringValue(peering.VpcPeeringConnectionId), + StringValue(peering.VpcPeeringConnectionId), + StringValue(peering.VpcPeeringConnectionId), "aws_vpc_peering_connection", "aws", peeringAllowEmptyValues, @@ -51,10 +50,14 @@ func (g *VpcPeeringConnectionGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - p := ec2.NewDescribeVpcPeeringConnectionsPaginator(svc.DescribeVpcPeeringConnectionsRequest(&ec2.DescribeVpcPeeringConnectionsInput{})) - for p.Next(context.Background()) { - g.Resources = append(g.Resources, g.createResources(p.CurrentPage())...) + svc := ec2.NewFromConfig(config) + p := ec2.NewDescribeVpcPeeringConnectionsPaginator(svc, &ec2.DescribeVpcPeeringConnectionsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(page)...) } - return p.Err() + return nil } From ca95b1d72291b45205f46b1434ceb85fefb2e34f Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Mon, 22 Feb 2021 01:07:21 +0800 Subject: [PATCH 102/276] #549 finished refactoring, started adjusting auth configuration and MFA+role verification --- go.mod | 1 + providers/aws/aws_service.go | 11 ++++++++--- providers/aws/vpn_connection.go | 13 ++++++------- providers/aws/waf.go | 26 +++++++++++++------------- providers/aws/waf_regional.go | 26 +++++++++++++------------- providers/aws/workspaces.go | 23 +++++++++++++---------- providers/aws/xray.go | 16 ++++++++-------- tests/aws/main.go | 2 +- 8 files changed, 63 insertions(+), 55 deletions(-) diff --git a/go.mod b/go.mod index 5bdd49c3c7..85a9233f93 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 github.com/aws/aws-sdk-go-v2 v1.2.0 github.com/aws/aws-sdk-go-v2/config v1.1.1 + github.com/aws/aws-sdk-go-v2/credentials v1.1.1 github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 github.com/aws/aws-sdk-go-v2/service/acm v1.1.1 github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1 diff --git a/providers/aws/aws_service.go b/providers/aws/aws_service.go index fc0cb28177..a4ebd76e49 100644 --- a/providers/aws/aws_service.go +++ b/providers/aws/aws_service.go @@ -16,6 +16,7 @@ package aws import ( "context" + "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "os" "regexp" @@ -64,13 +65,17 @@ func (s *AWSService) generateConfig() (aws.Config, error) { } func (s *AWSService) buildBaseConfig() (aws.Config, error) { + var loadOptions []func(*config.LoadOptions) error if s.GetArgs()["profile"].(string) != "" { - os.Setenv("AWS_PROFILE", s.GetArgs()["profile"].(string)) + loadOptions = append(loadOptions, config.WithSharedConfigProfile(s.GetArgs()["profile"].(string))) } if s.GetArgs()["region"].(string) != "" { - return config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-west-2")) + os.Setenv("AWS_REGION", s.GetArgs()["region"].(string)) } - return config.LoadDefaultConfig(context.TODO()) + loadOptions = append(loadOptions, config.WithAssumeRoleCredentialOptions(func(options *stscreds.AssumeRoleOptions) { + options.TokenProvider = stscreds.StdinTokenProvider + })) + return config.LoadDefaultConfig(context.TODO(), loadOptions...) } // for CF interpolation and IAM Policy variables diff --git a/providers/aws/vpn_connection.go b/providers/aws/vpn_connection.go index 750efafd25..d9f2e4163e 100644 --- a/providers/aws/vpn_connection.go +++ b/providers/aws/vpn_connection.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ec2" ) @@ -29,12 +28,12 @@ type VpnConnectionGenerator struct { AWSService } -func (VpnConnectionGenerator) createResources(vpncs *ec2.DescribeVpnConnectionsResponse) []terraformutils.Resource { - resources := []terraformutils.Resource{} +func (VpnConnectionGenerator) createResources(vpncs *ec2.DescribeVpnConnectionsOutput) []terraformutils.Resource { + var resources []terraformutils.Resource for _, vpnc := range vpncs.VpnConnections { resources = append(resources, terraformutils.NewSimpleResource( - aws.StringValue(vpnc.ConnectionId), - aws.StringValue(vpnc.ConnectionId), + StringValue(vpnc.VpnConnectionId), + StringValue(vpnc.VpnConnectionId), "aws_vpn_connection", "aws", VpnConnectionAllowEmptyValues, @@ -51,8 +50,8 @@ func (g *VpnConnectionGenerator) InitResources() error { if e != nil { return e } - svc := ec2.New(config) - vpncs, err := svc.DescribeVpnConnectionsRequest(&ec2.DescribeVpnConnectionsInput{}).Send(context.Background()) + svc := ec2.NewFromConfig(config) + vpncs, err := svc.DescribeVpnConnections(context.TODO(), &ec2.DescribeVpnConnectionsInput{}) if err != nil { return err } diff --git a/providers/aws/waf.go b/providers/aws/waf.go index 6245ddaf63..a8c087bde5 100644 --- a/providers/aws/waf.go +++ b/providers/aws/waf.go @@ -32,7 +32,7 @@ func (g *WafGenerator) InitResources() error { if e != nil { return e } - svc := waf.New(config) + svc := waf.NewFromConfig(config) if err := g.loadWebACL(svc); err != nil { return err @@ -75,7 +75,7 @@ func (g *WafGenerator) InitResources() error { } func (g *WafGenerator) loadWebACL(svc *waf.Client) error { - output, err := svc.ListWebACLsRequest(&waf.ListWebACLsInput{}).Send(context.Background()) + output, err := svc.ListWebACLs(context.TODO(), &waf.ListWebACLsInput{}) if err != nil { return err } @@ -91,7 +91,7 @@ func (g *WafGenerator) loadWebACL(svc *waf.Client) error { } func (g *WafGenerator) loadByteMatchSet(svc *waf.Client) error { - output, err := svc.ListByteMatchSetsRequest(&waf.ListByteMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListByteMatchSets(context.TODO(), &waf.ListByteMatchSetsInput{}) if err != nil { return err } @@ -107,7 +107,7 @@ func (g *WafGenerator) loadByteMatchSet(svc *waf.Client) error { } func (g *WafGenerator) loadGeoMatchSet(svc *waf.Client) error { - output, err := svc.ListGeoMatchSetsRequest(&waf.ListGeoMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListGeoMatchSets(context.TODO(), &waf.ListGeoMatchSetsInput{}) if err != nil { return err } @@ -123,7 +123,7 @@ func (g *WafGenerator) loadGeoMatchSet(svc *waf.Client) error { } func (g *WafGenerator) loadIPSet(svc *waf.Client) error { - output, err := svc.ListIPSetsRequest(&waf.ListIPSetsInput{}).Send(context.Background()) + output, err := svc.ListIPSets(context.TODO(), &waf.ListIPSetsInput{}) if err != nil { return err } @@ -139,7 +139,7 @@ func (g *WafGenerator) loadIPSet(svc *waf.Client) error { } func (g *WafGenerator) loadRateBasedRules(svc *waf.Client) error { - output, err := svc.ListRateBasedRulesRequest(&waf.ListRateBasedRulesInput{}).Send(context.Background()) + output, err := svc.ListRateBasedRules(context.TODO(), &waf.ListRateBasedRulesInput{}) if err != nil { return err } @@ -155,7 +155,7 @@ func (g *WafGenerator) loadRateBasedRules(svc *waf.Client) error { } func (g *WafGenerator) loadRegexMatchSets(svc *waf.Client) error { - output, err := svc.ListRegexMatchSetsRequest(&waf.ListRegexMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListRegexMatchSets(context.TODO(), &waf.ListRegexMatchSetsInput{}) if err != nil { return err } @@ -171,7 +171,7 @@ func (g *WafGenerator) loadRegexMatchSets(svc *waf.Client) error { } func (g *WafGenerator) loadRegexPatternSets(svc *waf.Client) error { - output, err := svc.ListRegexPatternSetsRequest(&waf.ListRegexPatternSetsInput{}).Send(context.Background()) + output, err := svc.ListRegexPatternSets(context.TODO(), &waf.ListRegexPatternSetsInput{}) if err != nil { return err } @@ -187,7 +187,7 @@ func (g *WafGenerator) loadRegexPatternSets(svc *waf.Client) error { } func (g *WafGenerator) loadWafRules(svc *waf.Client) error { - output, err := svc.ListRulesRequest(&waf.ListRulesInput{}).Send(context.Background()) + output, err := svc.ListRules(context.TODO(), &waf.ListRulesInput{}) if err != nil { return err } @@ -203,7 +203,7 @@ func (g *WafGenerator) loadWafRules(svc *waf.Client) error { } func (g *WafGenerator) loadWafRuleGroups(svc *waf.Client) error { - output, err := svc.ListRuleGroupsRequest(&waf.ListRuleGroupsInput{}).Send(context.Background()) + output, err := svc.ListRuleGroups(context.TODO(), &waf.ListRuleGroupsInput{}) if err != nil { return err } @@ -219,7 +219,7 @@ func (g *WafGenerator) loadWafRuleGroups(svc *waf.Client) error { } func (g *WafGenerator) loadSizeConstraintSets(svc *waf.Client) error { - output, err := svc.ListSizeConstraintSetsRequest(&waf.ListSizeConstraintSetsInput{}).Send(context.Background()) + output, err := svc.ListSizeConstraintSets(context.TODO(), &waf.ListSizeConstraintSetsInput{}) if err != nil { return err } @@ -235,7 +235,7 @@ func (g *WafGenerator) loadSizeConstraintSets(svc *waf.Client) error { } func (g *WafGenerator) loadSQLInjectionMatchSets(svc *waf.Client) error { - output, err := svc.ListSqlInjectionMatchSetsRequest(&waf.ListSqlInjectionMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListSqlInjectionMatchSets(context.TODO(), &waf.ListSqlInjectionMatchSetsInput{}) if err != nil { return err } @@ -251,7 +251,7 @@ func (g *WafGenerator) loadSQLInjectionMatchSets(svc *waf.Client) error { } func (g *WafGenerator) loadXSSMatchSet(svc *waf.Client) error { - output, err := svc.ListXssMatchSetsRequest(&waf.ListXssMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListXssMatchSets(context.TODO(), &waf.ListXssMatchSetsInput{}) if err != nil { return err } diff --git a/providers/aws/waf_regional.go b/providers/aws/waf_regional.go index ac39b01bd0..abdcc16751 100644 --- a/providers/aws/waf_regional.go +++ b/providers/aws/waf_regional.go @@ -30,7 +30,7 @@ func (g *WafRegionalGenerator) InitResources() error { if e != nil { return e } - svc := wafregional.New(config) + svc := wafregional.NewFromConfig(config) if err := g.loadWebACL(svc); err != nil { return err @@ -74,7 +74,7 @@ func (g *WafRegionalGenerator) InitResources() error { } func (g *WafRegionalGenerator) loadWebACL(svc *wafregional.Client) error { - output, err := svc.ListWebACLsRequest(&wafregional.ListWebACLsInput{}).Send(context.Background()) + output, err := svc.ListWebACLs(context.TODO(), &wafregional.ListWebACLsInput{}) if err != nil { return err } @@ -90,7 +90,7 @@ func (g *WafRegionalGenerator) loadWebACL(svc *wafregional.Client) error { } func (g *WafRegionalGenerator) loadByteMatchSet(svc *wafregional.Client) error { - output, err := svc.ListByteMatchSetsRequest(&wafregional.ListByteMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListByteMatchSets(context.TODO(), &wafregional.ListByteMatchSetsInput{}) if err != nil { return err } @@ -106,7 +106,7 @@ func (g *WafRegionalGenerator) loadByteMatchSet(svc *wafregional.Client) error { } func (g *WafRegionalGenerator) loadGeoMatchSet(svc *wafregional.Client) error { - output, err := svc.ListGeoMatchSetsRequest(&wafregional.ListGeoMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListGeoMatchSets(context.TODO(), &wafregional.ListGeoMatchSetsInput{}) if err != nil { return err } @@ -122,7 +122,7 @@ func (g *WafRegionalGenerator) loadGeoMatchSet(svc *wafregional.Client) error { } func (g *WafRegionalGenerator) loadIPSet(svc *wafregional.Client) error { - output, err := svc.ListIPSetsRequest(&wafregional.ListIPSetsInput{}).Send(context.Background()) + output, err := svc.ListIPSets(context.TODO(), &wafregional.ListIPSetsInput{}) if err != nil { return err } @@ -138,7 +138,7 @@ func (g *WafRegionalGenerator) loadIPSet(svc *wafregional.Client) error { } func (g *WafRegionalGenerator) loadRateBasedRules(svc *wafregional.Client) error { - output, err := svc.ListRateBasedRulesRequest(&wafregional.ListRateBasedRulesInput{}).Send(context.Background()) + output, err := svc.ListRateBasedRules(context.TODO(), &wafregional.ListRateBasedRulesInput{}) if err != nil { return err } @@ -154,7 +154,7 @@ func (g *WafRegionalGenerator) loadRateBasedRules(svc *wafregional.Client) error } func (g *WafRegionalGenerator) loadRegexMatchSets(svc *wafregional.Client) error { - output, err := svc.ListRegexMatchSetsRequest(&wafregional.ListRegexMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListRegexMatchSets(context.TODO(), &wafregional.ListRegexMatchSetsInput{}) if err != nil { return err } @@ -170,7 +170,7 @@ func (g *WafRegionalGenerator) loadRegexMatchSets(svc *wafregional.Client) error } func (g *WafRegionalGenerator) loadRegexPatternSets(svc *wafregional.Client) error { - output, err := svc.ListRegexPatternSetsRequest(&wafregional.ListRegexPatternSetsInput{}).Send(context.Background()) + output, err := svc.ListRegexPatternSets(context.TODO(), &wafregional.ListRegexPatternSetsInput{}) if err != nil { return err } @@ -186,7 +186,7 @@ func (g *WafRegionalGenerator) loadRegexPatternSets(svc *wafregional.Client) err } func (g *WafRegionalGenerator) loadWafRules(svc *wafregional.Client) error { - output, err := svc.ListRulesRequest(&wafregional.ListRulesInput{}).Send(context.Background()) + output, err := svc.ListRules(context.TODO(), &wafregional.ListRulesInput{}) if err != nil { return err } @@ -202,7 +202,7 @@ func (g *WafRegionalGenerator) loadWafRules(svc *wafregional.Client) error { } func (g *WafRegionalGenerator) loadWafRuleGroups(svc *wafregional.Client) error { - output, err := svc.ListRuleGroupsRequest(&wafregional.ListRuleGroupsInput{}).Send(context.Background()) + output, err := svc.ListRuleGroups(context.TODO(), &wafregional.ListRuleGroupsInput{}) if err != nil { return err } @@ -218,7 +218,7 @@ func (g *WafRegionalGenerator) loadWafRuleGroups(svc *wafregional.Client) error } func (g *WafRegionalGenerator) loadSizeConstraintSets(svc *wafregional.Client) error { - output, err := svc.ListSizeConstraintSetsRequest(&wafregional.ListSizeConstraintSetsInput{}).Send(context.Background()) + output, err := svc.ListSizeConstraintSets(context.TODO(), &wafregional.ListSizeConstraintSetsInput{}) if err != nil { return err } @@ -234,7 +234,7 @@ func (g *WafRegionalGenerator) loadSizeConstraintSets(svc *wafregional.Client) e } func (g *WafRegionalGenerator) loadSQLInjectionMatchSets(svc *wafregional.Client) error { - output, err := svc.ListSqlInjectionMatchSetsRequest(&wafregional.ListSqlInjectionMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListSqlInjectionMatchSets(context.TODO(), &wafregional.ListSqlInjectionMatchSetsInput{}) if err != nil { return err } @@ -250,7 +250,7 @@ func (g *WafRegionalGenerator) loadSQLInjectionMatchSets(svc *wafregional.Client } func (g *WafRegionalGenerator) loadXSSMatchSet(svc *wafregional.Client) error { - output, err := svc.ListXssMatchSetsRequest(&wafregional.ListXssMatchSetsInput{}).Send(context.Background()) + output, err := svc.ListXssMatchSets(context.TODO(), &wafregional.ListXssMatchSetsInput{}) if err != nil { return err } diff --git a/providers/aws/workspaces.go b/providers/aws/workspaces.go index bd44f9d50b..ed5412e268 100644 --- a/providers/aws/workspaces.go +++ b/providers/aws/workspaces.go @@ -18,7 +18,6 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/workspaces" ) @@ -33,7 +32,7 @@ func (g *WorkspacesGenerator) InitResources() error { if e != nil { return e } - svc := workspaces.New(config) + svc := workspaces.NewFromConfig(config) if err := g.loadWorkspaces(svc); err != nil { return err } @@ -44,11 +43,15 @@ func (g *WorkspacesGenerator) InitResources() error { } func (g *WorkspacesGenerator) loadWorkspaces(svc *workspaces.Client) error { - p := workspaces.NewDescribeWorkspacesPaginator(svc.DescribeWorkspacesRequest(&workspaces.DescribeWorkspacesInput{})) - for p.Next(context.Background()) { - for _, workspace := range p.CurrentPage().Workspaces { - directoryID := aws.StringValue(workspace.DirectoryId) - workspaceID := aws.StringValue(workspace.WorkspaceId) + p := workspaces.NewDescribeWorkspacesPaginator(svc, &workspaces.DescribeWorkspacesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, workspace := range page.Workspaces { + directoryID := StringValue(workspace.DirectoryId) + workspaceID := StringValue(workspace.WorkspaceId) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( directoryID, directoryID, @@ -63,18 +66,18 @@ func (g *WorkspacesGenerator) loadWorkspaces(svc *workspaces.Client) error { workspacesAllowEmptyValues)) } } - return p.Err() + return nil } func (g *WorkspacesGenerator) loadWorkspacesIPGroup(svc *workspaces.Client) error { var nextToken *string for { - response, err := svc.DescribeIpGroupsRequest(&workspaces.DescribeIpGroupsInput{NextToken: nextToken}).Send(context.Background()) + response, err := svc.DescribeIpGroups(context.TODO(), &workspaces.DescribeIpGroupsInput{NextToken: nextToken}) if err != nil { return err } for _, ipGroup := range response.Result { - groupID := aws.StringValue(ipGroup.GroupId) + groupID := StringValue(ipGroup.GroupId) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( groupID, groupID, diff --git a/providers/aws/xray.go b/providers/aws/xray.go index a670f5a064..bc4a278939 100644 --- a/providers/aws/xray.go +++ b/providers/aws/xray.go @@ -18,11 +18,15 @@ func (g *XrayGenerator) InitResources() error { if e != nil { return e } - svc := xray.New(config) + svc := xray.NewFromConfig(config) - p := xray.NewGetSamplingRulesPaginator(svc.GetSamplingRulesRequest(&xray.GetSamplingRulesInput{})) - for p.Next(context.Background()) { - for _, samplingRule := range p.CurrentPage().SamplingRuleRecords { + p := xray.NewGetSamplingRulesPaginator(svc, &xray.GetSamplingRulesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, samplingRule := range page.SamplingRuleRecords { // NOTE: Builtin rule with unmodifiable name and 10000 prirority (lowest) if *samplingRule.SamplingRule.RuleName != "Default" { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( @@ -31,10 +35,6 @@ func (g *XrayGenerator) InitResources() error { "aws_xray_sampling_rule", "aws", xrayAllowEmptyValues)) - - if err := p.Err(); err != nil { - return err - } } } } diff --git a/tests/aws/main.go b/tests/aws/main.go index d30c4a0f53..5464bba699 100644 --- a/tests/aws/main.go +++ b/tests/aws/main.go @@ -32,7 +32,7 @@ func main() { "aws", "--regions=ap-southeast-1", "--resources=vpc,sg", - "--profile=personal", + "--profile=personal_diagrams", "--compact", "--path-pattern=" + pathPattern, }) From e502396964c1939e989de6cb277931350a7318e0 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 22 Feb 2021 11:10:10 -0500 Subject: [PATCH 103/276] docs: add homebrew badge Signed-off-by: Rui Chen --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d728344090..839035adf2 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://travis-ci.com/GoogleCloudPlatform/terraformer.svg?branch=master)](https://travis-ci.com/GoogleCloudPlatform/terraformer) [![Go Report Card](https://goreportcard.com/badge/github.com/GoogleCloudPlatform/terraformer)](https://goreportcard.com/report/github.com/GoogleCloudPlatform/terraformer) [![AUR package](https://img.shields.io/aur/version/terraformer)](https://aur.archlinux.org/packages/terraformer/) +[![Homebrew](https://img.shields.io/badge/dynamic/json.svg?url=https://formulae.brew.sh/api/formula/terraformer.json&query=$.versions.stable&label=homebrew)](https://formulae.brew.sh/formula/terraformer) A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infrastructure (reverse Terraform). From 45527b4095a5e83f347eaed67ac2f61d6293be1d Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 22 Feb 2021 11:17:39 -0500 Subject: [PATCH 104/276] doc: add stargazers chart Signed-off-by: Rui Chen --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index d728344090..b0803f39c3 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr - [Contributing](#contributing) - [Developing](#developing) - [Infrastructure](#infrastructure) +- [Stargazers over time](#stargazers-over-time) ## Capabilities @@ -1812,3 +1813,7 @@ Terraforming lacks full coverage for resources - as an example you can see that * terraforming - https://github.com/dtan4/terraforming/blob/master/lib/terraforming/template/tf/s3.erb * official S3 support - https://www.terraform.io/docs/providers/aws/r/s3_bucket.html + +## Stargazers over time + +[![Stargazers over time](https://starchart.cc/GoogleCloudPlatform/terraformer.svg)](https://starchart.cc/GoogleCloudPlatform/terraformer) From 106ab51e70933a2feebae63898788d51f9997d75 Mon Sep 17 00:00:00 2001 From: rui Date: Mon, 22 Feb 2021 11:21:46 -0500 Subject: [PATCH 105/276] fix: sync version to 0.8.11 --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 1cc085752e..6ecdbc764a 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.10" +const version = "v0.8.11" var versionCmd = &cobra.Command{ Use: "version", From e9566fb4f0c9e1e1b35f9519e5786f89f437a6ef Mon Sep 17 00:00:00 2001 From: Sherzod K Date: Mon, 22 Feb 2021 21:09:40 -0500 Subject: [PATCH 106/276] lint --- providers/datadog/integration_pagerduty.go | 1 + 1 file changed, 1 insertion(+) diff --git a/providers/datadog/integration_pagerduty.go b/providers/datadog/integration_pagerduty.go index 93cdfbd973..7b2b91d329 100644 --- a/providers/datadog/integration_pagerduty.go +++ b/providers/datadog/integration_pagerduty.go @@ -16,6 +16,7 @@ package datadog import ( "fmt" + datadogCommunity "github.com/zorkian/go-datadog-api" "github.com/GoogleCloudPlatform/terraformer/terraformutils" From 0e1d4645f0af8f1d8a0d7b03fbdba05817786be1 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Wed, 24 Feb 2021 00:53:38 +0800 Subject: [PATCH 107/276] #549 fixed linting errors, added config cache, fixing S3 policy issue --- go.mod | 1 + go.sum | 156 ++--------------------------------- providers/aws/api_gateway.go | 3 +- providers/aws/aws_service.go | 10 ++- providers/aws/ecs.go | 5 +- providers/aws/elasticache.go | 3 +- providers/aws/s3.go | 16 ++-- tests/aws/main.go | 5 +- 8 files changed, 29 insertions(+), 170 deletions(-) diff --git a/go.mod b/go.mod index 85a9233f93..a77ff4aefc 100644 --- a/go.mod +++ b/go.mod @@ -88,6 +88,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1 github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1 github.com/aws/aws-sdk-go-v2/service/xray v1.1.1 + github.com/aws/smithy-go v1.1.0 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect diff --git a/go.sum b/go.sum index 502e56f88d..f8ccf80408 100644 --- a/go.sum +++ b/go.sum @@ -170,298 +170,158 @@ github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA= -github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= -github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= -github.com/aws/aws-sdk-go-v2 v0.31.0 h1:TNTDsz+Xq80nYzZPUFS4a2Oyjz9jKHKcTuNAXtcW8b8= -github.com/aws/aws-sdk-go-v2 v0.31.0/go.mod h1:IQw4KL7QIoaNDT3WoEBV1fDlVRhp/WTRteoaplV3SHo= +github.com/aws/aws-sdk-go-v2 v1.1.0/go.mod h1:smfAbmpW+tcRVuNUjo3MOArSZmW72t62rkCzc2i0TWM= github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v0.4.0 h1:16lwnZRhleaPbDesZgEJbHxuOv4wy12A372mkhmiktc= -github.com/aws/aws-sdk-go-v2/config v0.4.0/go.mod h1:5uxQPUBCF+TwwWYo2xau4N+rSOS47ZH+QvLbae1Cckc= github.com/aws/aws-sdk-go-v2/config v1.1.1 h1:ZAoq32boMzcaTW9bcUacBswAmHTbvlvDJICgHFZuECo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v0.2.0 h1:YDv/0/8BzaZtpS4jfptcyIPh5zlhmIhbM2RtNscn/bo= -github.com/aws/aws-sdk-go-v2/credentials v0.2.0/go.mod h1:U81m6Xb5IpJ66ZnotiG7/6JJFuwrc8q8rWpXQxYP0hI= github.com/aws/aws-sdk-go-v2/credentials v1.1.1 h1:NbvWIM1Mx6sNPTxowHgS2ewXCRp+NGTzUYb/96FZJbY= github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v0.1.0 h1:zwhJDxNht/+a0QGy3RCveUFf6REXcmaQIHcYS11m5KY= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v0.1.0/go.mod h1:d3o/QBgbYw2OYmbv/EGYs0zFH47qsCKCTDbaOgdQGH8= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 h1:EtEU7WRaWliitZh2nmuxEXrN0Cb8EgPUFGIoTMeqbzI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v0.31.0 h1:peKA1aNVZWGhxYItXwaMFtjFf1F4T3IyzjpoFTHWH6w= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v0.31.0/go.mod h1:ftbIDjS8x5ownQD9INfL3xg/3Cpd8xn22RN65/S8jX0= github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 h1:6ocrUoJHmXBa0/oCoWYN2nK+UrETpA0zUxCV990nRl0= github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1/go.mod h1:+JkwIyrURCsjBdb3M6PdF+LAQ3TPvZAfH+gJ7AI3JT0= -github.com/aws/aws-sdk-go-v2/service/acm v0.31.0 h1:QkipbLwq20gcDPLZW9QH6cwdkR4Ui2yKDvZfLx+VXKo= -github.com/aws/aws-sdk-go-v2/service/acm v0.31.0/go.mod h1:5CAGx34bxJi7+dwLi0OW2vNiM2m641zDZDIxyy3KGkY= github.com/aws/aws-sdk-go-v2/service/acm v1.1.1 h1:LAr7oTwfOZdfJN1GrZnU05yf2aOO3HVeGv2KjJKp8d4= github.com/aws/aws-sdk-go-v2/service/acm v1.1.1/go.mod h1:LPzlCt4j2TSsD9P6NtruMhkOf0Ke7uxEHaxRCI5D1x4= -github.com/aws/aws-sdk-go-v2/service/apigateway v0.31.0 h1:yNG6u4Ea8hDM/b+NCOPxNhyfi4164Gub1A72TB+D58A= -github.com/aws/aws-sdk-go-v2/service/apigateway v0.31.0/go.mod h1:equnPApvqFNpI2Q55GOg+hNeJOMnqZqzrnnlkvckcbk= github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1 h1:G2JpxWOpTyeLgTbh5gfiESvvm6B3lu/6kQNEhAS8Tvk= github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1/go.mod h1:wmgrgVgNP96iRTgbY+Qd3UdqVvmlOCd46tY2P6sOTfs= -github.com/aws/aws-sdk-go-v2/service/appsync v0.31.0 h1:O3UX2/Eop1Z7YkVFdl4z3KAY8xlxHMc7oOLpA7gzzdM= -github.com/aws/aws-sdk-go-v2/service/appsync v0.31.0/go.mod h1:SJtL4QwIL7hUvvtdui2PL52v2QHgJ4aDPRjL+DqKJA0= github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1 h1:NYPqPq18/WvalPPowYG0laum27pdEXq5gnrTp1ppVF4= github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1/go.mod h1:uhccc+JDGc1Ck0q8F3iI0+PPIP1N+yTZEfuMPp2Achw= -github.com/aws/aws-sdk-go-v2/service/autoscaling v0.31.0 h1:BmpZDHFn1QhsLZ2lI7wMhRRK28rcYTmN7W9QY22aoqk= -github.com/aws/aws-sdk-go-v2/service/autoscaling v0.31.0/go.mod h1:VYp/EgnDckBH0wdfkaNvjXsyU11OzDrQ4zXYEHoZoFY= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1 h1:O0iefEPzxDdVVBtY7o0Hyj4SUre27QRh5mthCU+HYDA= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1/go.mod h1:lmXoX7IIO5yAHRCmHlqda9tFfsbkY3IO3rt85VvXmIQ= -github.com/aws/aws-sdk-go-v2/service/budgets v0.31.0 h1:kBxisypqFiXnLj9QZpep8lV8FeNgH314scX1Q6I5mjs= -github.com/aws/aws-sdk-go-v2/service/budgets v0.31.0/go.mod h1:8xObAwrQOsYomRBytI8EdHhuwC4aCdjpUvU/tDOi0YE= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1 h1:ZVgyQqcfkXmz8VLA/R0j0FdqMBwPYNs52Ho2DzwY8zo= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1/go.mod h1:/v+APBnOBPy/NpPFS1lH5qJ9BfEQVfPAEnBm5XV1870= -github.com/aws/aws-sdk-go-v2/service/cloud9 v0.31.0 h1:uUVDtGnFdnrjvVD+wMlRZi8/feJtq18zwSv1uNQHKyg= -github.com/aws/aws-sdk-go-v2/service/cloud9 v0.31.0/go.mod h1:lvUm57SVAWTqSPeJw/jRt8clIxQPhYV/2idGW9namqI= github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1 h1:WblDVlnxgdvuZNwBw3UX3JaO7hdVuvaLNK4P0XK1gKM= github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1/go.mod h1:InGDFYVeG6/bfb5KRB2n5qTFWZ/vp483zdUE1EPbDM0= -github.com/aws/aws-sdk-go-v2/service/cloudformation v0.31.0 h1:Xcr9L5Q+X5jlofHanupgEpF+2wAIulF5N67Oso92Pvw= -github.com/aws/aws-sdk-go-v2/service/cloudformation v0.31.0/go.mod h1:ScoIqiowvOH6AUbGPrNAoOhan43UjUGyBItoXKlOfks= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1 h1:cRw6t1ZAqc0fG2CFtWnXXdBwgREo6B06X63lDlpGPlI= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1/go.mod h1:Fq3q5X0gHcCCldZx+ibAo0HRo2xbVi9LFoFj2Pp9nl0= -github.com/aws/aws-sdk-go-v2/service/cloudfront v0.31.0 h1:QACFlH/uvFYqhsSRn2c05DkiEZsBeCWY5cZFpN57GMI= -github.com/aws/aws-sdk-go-v2/service/cloudfront v0.31.0/go.mod h1:E+HPxVl87/GlUTmxM+tbuynZdqUG+VmSO++W61RmRnE= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1 h1:Qhi6EdWHqYvqKXZBZ55YHNR6RL9JJTi65ndbqPKRdpM= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1/go.mod h1:xNq//oorX26+SRydd//Rqk3iPLoKzoYmAGDm6p3wpzc= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v0.31.0 h1:pE0bkNXb+L/b6eaVIz0GTUUsLCz/tEhy9QS+pYZbagA= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v0.31.0/go.mod h1:Xet4o/3wZwXSKZ6XqPQB6S8Rw2eQ6wLzDLEGuHElpZ0= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1 h1:jso38tIYjMhe0i5uBD2sG/nmgODmh8ZCKFvaejqlIQ8= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1/go.mod h1:e6vwvVG3CrANic49hz9SG2bkKnSujNy8r+S6MZ21oEE= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v0.31.0 h1:Vk3Y9dgetwZFz0kW2u8+8USjy4c3OORohYXhidwKOKw= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v0.31.0/go.mod h1:/ijKLSMyzLwTesSbGLu2tgvh8ET2GYmLdvSiMvMtzkU= github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1 h1:MNQmQJZNCAlPqkWP01/7YptslcAbVmLNyqac+W/Q5oY= github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1/go.mod h1:gI/6WuEdSe7fWiBOMVPJfaonzq9mSA2E7h85CZNXzuI= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v0.31.0 h1:XDX1BX3+My/dVVbgnXbLB7mm3xj5Lr9FmuPP4wfQ3P4= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v0.31.0/go.mod h1:T4hENhAKLIeFlFRkYYnQm0bHIuVbOTpOaJjbVw/odS0= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1 h1:wvmvsbvJw/ml/PtdvqbcJnpu/GZLA5dERO0pqpcvyw0= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1/go.mod h1:HFCCrSEnP3mVyR8zOmcbLSQJW4DGRKoz1hjJxh4d/tw= -github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v0.31.0 h1:fZC2McQzpsbw7JpFzzvmKYPzTJjDb3QQOayaXXLy90I= -github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v0.31.0/go.mod h1:yZPu7NACE3dv2Ro8cmef9p6GxfwTi6lzEQkSYPq4TUM= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1 h1:abNETLBP3ShOHUBocGFBHqbP3D9Ho2vKhG8soWId4js= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1/go.mod h1:rtyMQxf1ahZkyvpcwnHGR7goHPJC4WRUmazENZsbjas= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v0.31.0 h1:own7MF26XAyY/Kvmga2xhLIbWqUNrZU36oGMPUt3yB4= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v0.31.0/go.mod h1:FLbWTw3O8K6njSXyGco8nczBt4Spm5W/CISNIeJDki4= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1 h1:9McrdB/9iGpEZw2xZdRdCYQlNuCHFFYjvROkO5yo1RM= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1/go.mod h1:IB6HamJdrHbUjbWEgWkGX1Lrp8mZzxoBLXHOTAmoXFA= -github.com/aws/aws-sdk-go-v2/service/codebuild v0.31.0 h1:AoVHRL1iTWU7bKpBeKZM3a1s3jZKBzM/gzOpXxSX1/o= -github.com/aws/aws-sdk-go-v2/service/codebuild v0.31.0/go.mod h1:nTGmHi8VC+/Mfh78NVLQR09sQkRyU0SXEAaNcKE1VOU= github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1 h1:5Ku1ITd/Epk23vIwq/2NU1F0gUKlUcjyk5gOrsXPZIA= github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1/go.mod h1:Hc+1mcfi7yTl5Qtrn7PRwazVWblIIWCfhqwaj8M6vAw= -github.com/aws/aws-sdk-go-v2/service/codecommit v0.31.0 h1:GSf9yEw+WndSnar+gEUfrnhIvg+5plQjN7v3NDULgfQ= -github.com/aws/aws-sdk-go-v2/service/codecommit v0.31.0/go.mod h1:3TriU8VIcjWgQY/HMABqVIsijgNIBkc/HY01uzTN4NA= github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1 h1:7WUEimiBFjeo0x/K8JNhPc61oho7TPhXyfrpYxpEMN0= github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1/go.mod h1:JUViTUm6ZiAJOwKItWf/lN5KeBRdidcjfZnAhgKTc0Y= -github.com/aws/aws-sdk-go-v2/service/codedeploy v0.31.0 h1:zKIUYrNJv2cf6ZiWQ7LlckmZhgH8HBK4yVg2+Eswkks= -github.com/aws/aws-sdk-go-v2/service/codedeploy v0.31.0/go.mod h1:d1DGaVPwCyhIgj9ERcW7to8bL/CXC4DIYfE4uRiK1Mg= github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1 h1:nCv1/hV+E3kMUJVwgUzw5zNvcHzP9cQqVmcVZXlcmiE= github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1/go.mod h1:ktnHZmgGlqoJkUjyzR4RHDlGhfSxQV+AQY7Xx3nPNPw= -github.com/aws/aws-sdk-go-v2/service/codepipeline v0.31.0 h1:/Y0F6/uIEblN9JNoH5dLocFw45ptt4iSzVmsOYJhddU= -github.com/aws/aws-sdk-go-v2/service/codepipeline v0.31.0/go.mod h1:TQaBBV5p4+6FIZgt8tlS3dtjHPuULXnzoFH7zRMgfUo= github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1 h1:FbzagBHyTmKk4DbXJOx4l/a+k0y49TgWoyzCc04YwAk= github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1/go.mod h1:7pc2jReqY0EvHa5ReuVBIwmRlW8yQV5O3ptw4T+OS80= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v0.31.0 h1:SEEPDaPAz3jIwWO8njlZtM/sH7B+IsSG3sYz/U0tM7k= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v0.31.0/go.mod h1:aTe0yGYoQqJWzs4phFv4UkXQMQLEhbw9fZGd2er4zOM= github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1 h1:A/ZhwplRVmY3cSM5NfW/3lp0PBJFAhWvHD5+sYo7oxI= github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1/go.mod h1:85mUFI4DMZiUYpQzTfUvDaFf/TL/pd419Elk5FOCVtY= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v0.31.0 h1:TL0DhwAi4OQjgfefBuk53YbHKoezpOsKnL4oDRR0Ep0= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v0.31.0/go.mod h1:JW5h2Bp0WeFLSeE5Tt8tLZtHQ3g7uvh62y5iQ+oju6s= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1 h1:HoHckIJOdxpS4RSEqnPXp9+gFjixFH97pT46Q4buxhA= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1/go.mod h1:/yhD37TwPeVuZZ8qx1n7H65O0+a2Mh3gEF4TTB4Sn24= -github.com/aws/aws-sdk-go-v2/service/configservice v0.31.0 h1:s6DLkiGUG3DmxJsWnTs68n7S5L9h/2zkrweU+bM84hI= -github.com/aws/aws-sdk-go-v2/service/configservice v0.31.0/go.mod h1:bA5PyBxggow3OQISPS6+VNVT1atsF5pEGAunKY2TQ8c= github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1 h1:2PU0yT1crQJ08BJOF8Flq8j962NpiU3QltBaKg4NI0c= github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1/go.mod h1:d8io9sMSzJBqxJrNABjaDuFH6t02btWR2ZQtDTGF35A= -github.com/aws/aws-sdk-go-v2/service/datapipeline v0.31.0 h1:JpF06tBWFVD7PuE0ztLOwKzG2KDxC3tRk0orU7CKYOU= -github.com/aws/aws-sdk-go-v2/service/datapipeline v0.31.0/go.mod h1:npbHJr/KbtmsXCATTMpnzFBsp0cSUNTcy0cBilLQKyg= github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1 h1:iBj0PYHYe7Po52v8fAcMEH0RRLbgN0XkJ+dux63lKD8= github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1/go.mod h1:f+FK6B06DiJnhr8Ba6rnN8SSPITHG3et63y8NORbbsk= -github.com/aws/aws-sdk-go-v2/service/devicefarm v0.31.0 h1:6S7IolSJLZ7VR4vJF/+Y2l9tWFzIpS3Evhj0IoYnZA0= -github.com/aws/aws-sdk-go-v2/service/devicefarm v0.31.0/go.mod h1:Prxq85+6vG+1/8eXtM1KDWianLM1VaQvL49cspoV98I= github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1 h1:NSFZm6LIFbASAv833Bm4+Ea/GiaWr2NvTalswFtOTj4= github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1/go.mod h1:UMb/XuyQ0X/Gr+GVwCwL5qYvPE5vWwUOYHooaa4WhzQ= -github.com/aws/aws-sdk-go-v2/service/dynamodb v0.31.0 h1:sqdT+stp7NlYs/cOtLMSMXj0WrGXSj4gWmIiPFrpNX8= -github.com/aws/aws-sdk-go-v2/service/dynamodb v0.31.0/go.mod h1:3gJdaC23NGEM57Zm9L5CZzKGOfuvoclmAZu8ZFLNQKI= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1 h1:rs3qt8vsrOXgm3qfVdjVkwnPiBXI2M7qN1nExoZmJfI= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1/go.mod h1:0xGVqnX5hK8bd/Qnqklpdellx5/6KPSPV7vfno3i1Sk= -github.com/aws/aws-sdk-go-v2/service/ec2 v0.31.0 h1:WFmkmj3SBb74ahh3/M1FHS6GgQ7uyJKNoUorIWXyYLI= -github.com/aws/aws-sdk-go-v2/service/ec2 v0.31.0/go.mod h1:l0pwXTelza2kR5KczSC7f0HJcgXpROUY+oJ+KvfVkH4= github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1 h1:xZYDtbub5yhn+ASvD26m76Cgb0k+0+ShE+nZwK9djUQ= github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1/go.mod h1:L7nNXGNEV0lkTauKM/KcEIZkT262pckC0YNykwAtX20= -github.com/aws/aws-sdk-go-v2/service/ecr v0.31.0 h1:wJaZLmT5FJvUdlQfq1rNHyFj2WS5tpPqpLEMDp2avXE= -github.com/aws/aws-sdk-go-v2/service/ecr v0.31.0/go.mod h1:57qetkcAXkGAsoRsxPUpK/ZuTj9A1b6vq7wnig/q7ac= github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1 h1:idXCsD7Rl3LtE/MFFw81a1C1tVRSP3AOnv96U0TsRUo= github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1/go.mod h1:NGFCwbEd03lj5kwG8vO5qS5m4CfvHE4ir3pA5ozrlUM= -github.com/aws/aws-sdk-go-v2/service/ecs v0.31.0 h1:QFs/Ta5qq79BFXkbqSWW/iOg4w4ZIhksxk5KLau86DY= -github.com/aws/aws-sdk-go-v2/service/ecs v0.31.0/go.mod h1:Y7b7BL883bwUY1yFQQv0Zo0/yLi1YewcVpjHs63jQdA= github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1 h1:McBGvH3M7n8s6SGuS+UNm8+q5BEmE30cNH/81qy0B4Q= github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1/go.mod h1:HHh+ZaGFQVK16XijQFZKaJdTpeOdxWK894pn9vY2Tgo= -github.com/aws/aws-sdk-go-v2/service/efs v0.31.0 h1:DYMjNVmLPQ5V7zlRBW77l1ZcXpI0I6KZpDqPMqiotms= -github.com/aws/aws-sdk-go-v2/service/efs v0.31.0/go.mod h1:ZkkoEcVW2QhiRHfIqjvX7FzU06+sA0gCCWvIs6jyxmI= github.com/aws/aws-sdk-go-v2/service/efs v1.1.1 h1:UnjpU4x5bCWhJn43C+FXSjRs4fh8z8YjN8AsjxkEFW8= github.com/aws/aws-sdk-go-v2/service/efs v1.1.1/go.mod h1:fJbRgAwIrq3LyqphCXgJs6bVYfMlLZ9G6vepkPvAJsw= -github.com/aws/aws-sdk-go-v2/service/eks v0.31.0 h1:T1H3oyZwfmm88N2QFEUPpxZasL76bv8KQrZ8Z1PCtXw= -github.com/aws/aws-sdk-go-v2/service/eks v0.31.0/go.mod h1:6dzei1oFWmVBcjD5J/n2WoYe3w90gwUuO5GLIxQfY3M= github.com/aws/aws-sdk-go-v2/service/eks v1.1.1 h1:nK/Kl0TIfwaHUkcCj9+L6td2Xds7QNYMODJKWG1wPOY= github.com/aws/aws-sdk-go-v2/service/eks v1.1.1/go.mod h1:9SVAH9Cu/e1iQOu7VIBp7DhqTq3Dr5cAooCzoh61mEc= -github.com/aws/aws-sdk-go-v2/service/elasticache v0.31.0 h1:u+4Ix+UmE5UqiWDa3VXS6nvVN5vtnt5HND8F3Q0Z9+k= -github.com/aws/aws-sdk-go-v2/service/elasticache v0.31.0/go.mod h1:qgPiENzy2GQMGsbAbGHzbZfe4HBkhxlQUxSoqrfsyO4= github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1 h1:/1VLazyWVSYTzl3CmmfjT2g3jc9krekNcTyGiW09AYY= github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1/go.mod h1:DfEntnpXu52dWWWGCjrx2RNMsHWHXuyI2LOpn+XkFFY= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v0.31.0 h1:YxBOJFbViSncZCTQcXzZ3yZrU8qf9spaXx2VGGgVhoI= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v0.31.0/go.mod h1:wVFJNTewEFohF6/cV260zlty6bP2fueQr9YhCetPCMo= github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1 h1:xLqpXaLCUtHJuJiOASwPIPLAJMt1v+6h8phzma1haT8= github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1/go.mod h1:9Klmao5OCdCMYyXPNy+skSx6c4LoKsbPL8IcEqV5wVU= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v0.31.0 h1:53+EY9rDKKDAJ0cTuD/v+drY29k7IN8pCqaNvVsC3+s= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v0.31.0/go.mod h1:I+GNxv9WaxS3zV7J30UVTMdTb2cyC3K8yrNWddmGoqc= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1 h1:YyPHbW33NvSfUVVYIHVdMQX/BVnkdiJcgGdpjFqU64s= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1/go.mod h1:Gqg2Xf3BaVCDXPjNgkTwM3Q1zN7OSrOszkJ8s9xuYXU= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v0.31.0 h1:AOnDS+K8ipnxkUgqQMhm/rXnzgb9UiPpf6hbwQWivjQ= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v0.31.0/go.mod h1:zLAVHFVrJOY+++w+Epq5gPIQ3Z6UaLPvmf3uBqloBR8= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1 h1:ARoh9oSYV0QwcenklgpagsW+fI0xx5STB31yn3BtcPE= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1/go.mod h1:DP/R8CgrCb5TFyP3GIM5FcDWcrSl0sTZWHQSxXMtrEk= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v0.31.0 h1:ya+ScQTQdOqxc97UrFLNGlEQfV0eJjwigsaLthdxNw0= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v0.31.0/go.mod h1:v8BaK1/o2HLjNUrZqEmFO5JBm/CfGLyNRIXbxrqOR1U= github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1 h1:Kz5PZgEUnzh3134+b8/kLmA6XrkSLD/qBV5YhUAlP0U= github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1/go.mod h1:LtpgnMWYTwd6oasEo9HsE8dPDyeOnnU4A8at3LkyI6g= -github.com/aws/aws-sdk-go-v2/service/emr v0.31.0 h1:6c5rreRHuOAX4GA+yo7AeFk7fkEb9UZbVfB0GyR4oJM= -github.com/aws/aws-sdk-go-v2/service/emr v0.31.0/go.mod h1:GqUjZLHbrUG8zlJWhSt0Jt9KMN1ZMowyyyR+gGPr8x0= github.com/aws/aws-sdk-go-v2/service/emr v1.1.1 h1:Al6w3GqqFKUmBjrQK+RWYNT7t7REiZ52GQL0ew/LSds= github.com/aws/aws-sdk-go-v2/service/emr v1.1.1/go.mod h1:hgkNhB3DJRxLgFjL84KMXQ1c6XNRZQla4qiU1foMdbw= -github.com/aws/aws-sdk-go-v2/service/firehose v0.31.0 h1:SoGU4Bke3Jr77AaxHTTDGKDoltDcqb8BLgVMQs6o6sQ= -github.com/aws/aws-sdk-go-v2/service/firehose v0.31.0/go.mod h1:Hj98m/b7VARqwovXTixJD9VkQs1+mTQh7r4XlNf+AiY= github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1 h1:RDEx0S3iyLDCK4/Y2TH4kXo53vJeSNeNyCdVzSwLR4g= github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1/go.mod h1:mIQsr8OSwIu5DgdTeEimmQN6nld0TxfLfIW+aqTEX68= -github.com/aws/aws-sdk-go-v2/service/glue v0.31.0 h1:YNTMJKEn/PtJP1Vwycu3D5GTZrjNCH6G9EhtLeAI91g= -github.com/aws/aws-sdk-go-v2/service/glue v0.31.0/go.mod h1:TQUg6oZ2nZ2WySThFURRYmzmKhfmFfgyxPOXXF2wa4Y= github.com/aws/aws-sdk-go-v2/service/glue v1.1.1 h1:O0mpo0QQXcsjr9lhLpQFKHjBJVY2XXkv5c/nWsZ0zgw= github.com/aws/aws-sdk-go-v2/service/glue v1.1.1/go.mod h1:TegWq2QgDYYk6v6JD8POmo4gWwJhn4Ar6KoCyNxdyC0= -github.com/aws/aws-sdk-go-v2/service/iam v0.31.0 h1:1MgHdHe1VMoputD7JA3q6CkfyULtwvXAjkeqOIjpJTM= -github.com/aws/aws-sdk-go-v2/service/iam v0.31.0/go.mod h1:uqLp4cqedOQNNICBvmGhDLm9pJmN7E4gt0M0w5yFS2Y= github.com/aws/aws-sdk-go-v2/service/iam v1.1.1 h1:dfpLUOEtz+DlRpeAA9vg/tM/VjAcDGBE47m2ZbdXrZU= github.com/aws/aws-sdk-go-v2/service/iam v1.1.1/go.mod h1:vBPRxb7qWfonEjDJR+ckM+1b1z2gXOogQjmTIPw15L4= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.4.0 h1:osjGuGbk/aVW8u2yhOijPhxLU1ardwPDsga5HHyQMbw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.4.0/go.mod h1:Pjv1Z+nRaluwWCMuB6OQeqGRyiGk2WTrKG8RHs5wZug= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0/go.mod h1:cZbnzYflIuoRkuKp4BB4q/R4xklYIwpLYs26vS3/Sac= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1 h1:q+3dVb1s3piv/Q/Ft0+OjU5iKItBRfCvU5wNLQUyIbA= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1/go.mod h1:zurGx7QI3Bk2OFwswSXl3PtJDdgD3QzjkfskiukJ2Mg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v0.2.0 h1:xeqwfWQGg3hjLMs61PlixdxhU+qqrd7S50j/3kV1j/0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v0.2.0/go.mod h1:Ef71w/O9Ulhxj8gD9Pq2S0lXMvyNzFLMRuIxWpDRQxk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.1/go.mod h1:PISaKWylTYAyruocNk4Lr9miOOJjOcVBd7twCPbydDk= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 h1:4AH9fFjUlVktQMznF+YN33aWNXaR4VgDXyP28qokJC0= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.4.0 h1:OiRO8lneLP7wJ80dqAwHpIRcMInUO04HzcQUVtPwk3U= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.4.0/go.mod h1:fMsE4Rr6OkxQUmZxi4Amj8LS0BakLZw05Rog0jYStQM= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.1 h1:U78TX1VNmbtb7Mea2LdXQXNtLJ6wWZ0yDJgEYeRX0wg= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.1/go.mod h1:IQF5AljyiiUz/CnLbe1FeE3hZZ/Kr87gJ1+/yEYel3I= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0 h1:6yUvdqgAAWoKAotui7AI4QvJASrjI6rkJtweSyjH6M4= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0/go.mod h1:q+4U7Z1uD6Iimym8uPQp0Ong/XICxInhzIKVSwn7bUU= -github.com/aws/aws-sdk-go-v2/service/iot v0.31.0 h1:z2tS0bxsJsdVaxvyS+g/T/AtIqvSzNVAfuk9wnHO/DE= -github.com/aws/aws-sdk-go-v2/service/iot v0.31.0/go.mod h1:KARNdH4vq80q6Ck2LKswlmDRbP8B1CtjK8b7z3AiDe0= github.com/aws/aws-sdk-go-v2/service/iot v1.1.1 h1:D7cWw8QZTkOEoF5uCnCUMYcNA1uo+yD+XuZXnZLcS+k= github.com/aws/aws-sdk-go-v2/service/iot v1.1.1/go.mod h1:LM7v3TvBIu+R+UZ4QKQzoDS94lzJ3XLLFLN4wsbnbVM= -github.com/aws/aws-sdk-go-v2/service/kafka v0.31.0 h1:Wr3HdFFaMGY63Oii7BTFbXc9rWexg/MBDwFEsoj5JQ0= -github.com/aws/aws-sdk-go-v2/service/kafka v0.31.0/go.mod h1:M/dlYC+IZJj5HLVUta0xusgSsx8VYJllhWGQphMdSPg= github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1 h1:FrFngpnVCdYW+lUljqqj9CLfY7xzRrGdY7/AkSOG5EE= github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1/go.mod h1:VqHOqKal4FUR6PfZDazxEcI/IBxyXOwOKKYzmUu4kC8= -github.com/aws/aws-sdk-go-v2/service/kinesis v0.31.0 h1:px/xTjNQ1XMNuYvrszMtinJ9HhoK7/A5QzgtU02g3us= -github.com/aws/aws-sdk-go-v2/service/kinesis v0.31.0/go.mod h1:OYBQZvaQy8tR59aqEYerLKGbdfkbxTOgqLpQWvlg6Oc= github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1 h1:w6pCp3eYLGhIH+mkNVZkR2KdpMXulXLzkQhmXbHeHTE= github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1/go.mod h1:7GLbfWUWm4KRU04QHvxkZGIQDiUjLFD+nVZW8joexTo= -github.com/aws/aws-sdk-go-v2/service/kms v0.31.0 h1:ju4tqKfhT+6AG39E+bUsZcaqkLhEW573RKbvwJo8G9M= -github.com/aws/aws-sdk-go-v2/service/kms v0.31.0/go.mod h1:NcamFVUaE0JeTLqM9GbDL03yoUWrXCufXQ4gMrCT0Lc= github.com/aws/aws-sdk-go-v2/service/kms v1.1.1 h1:rK1edW1dLtSGr1551ttHqQopajK4Pv9C4ez70dVMQaI= github.com/aws/aws-sdk-go-v2/service/kms v1.1.1/go.mod h1:6K5oOoDdnkW/h+Jv+xOA+tvgI6lwGBT9igkJGL1ypaY= -github.com/aws/aws-sdk-go-v2/service/lambda v0.31.0 h1:68fZwWzwVBpdvlQNMVU5b4eKjtZW+IowjwAEWfNGS/I= -github.com/aws/aws-sdk-go-v2/service/lambda v0.31.0/go.mod h1:TNMkaS9maTfsI4lmf54tgVKWjcHoxSIvldhsRwR0UuE= github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1 h1:ptubVb1eLQgZh7U4i+k2vpf3PlL4ZoTmGdTj+VowqqM= github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1/go.mod h1:iSHLnnmJNKoAUdzKnUFh4rIGM3V58fxa+XCYtRpeFX8= -github.com/aws/aws-sdk-go-v2/service/mediapackage v0.31.0 h1:67T7C98ZxPh88ZOCAlR3fzLr7MBP9vIGK3bS81MDOgM= -github.com/aws/aws-sdk-go-v2/service/mediapackage v0.31.0/go.mod h1:5Cv4ncfrAoUhoOrLS4UHR3f8t/3cI00Ue+Vrbj+phI8= github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1 h1:lIftsFn6TsByMl+v32Y4ztGLIz/C4Rq7gat5AihCpdw= github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1/go.mod h1:9YtJbicAA2/uNt2VsIMWd6eapsIJn2o/0u0VJMAtrXo= -github.com/aws/aws-sdk-go-v2/service/mediastore v0.31.0 h1:qoZnd4arRiWOFQuMTOzfmtxGEabOgVblQy4P8rDTmTg= -github.com/aws/aws-sdk-go-v2/service/mediastore v0.31.0/go.mod h1:2uJryReEzOxrpktUKyB1u5B2+AcqoC2g7iLsqd/Sh30= github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1 h1:tl/58Fn+6E9VTEmconNpPqDWSZM+aeV1DjI/sahJYLQ= github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1/go.mod h1:gevnsX8qzzxtNcZoSab72+PNtrfFmgb1n1Z4GKbgkxU= -github.com/aws/aws-sdk-go-v2/service/organizations v0.31.0 h1:UIpKsOP4LYR32M6hhHY5MhKF5guBSrNZ71pcFWF74LE= -github.com/aws/aws-sdk-go-v2/service/organizations v0.31.0/go.mod h1:C6LkUy13It4YU6/0SZcKz0WxjGPrwGXdmhpQc9ppz/A= github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1 h1:JPmFEmO4ycVquOwChmPJtC8Ct4oM1r3qEHwBdHZ4y3w= github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1/go.mod h1:goX7wNhH+gPuyYZX0AEJWm7cegEHyKnRLvZW4T4ZTgg= -github.com/aws/aws-sdk-go-v2/service/qldb v0.31.0 h1:3GwwI1ojlKYq9Z4AQpxMrNIiR6hoeaFCRc2Y2Bc6Rig= -github.com/aws/aws-sdk-go-v2/service/qldb v0.31.0/go.mod h1:fa+gF6o0Y09CgmJ4OF0NDos/WnUWfZpswswYOHFwI+M= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1 h1:2yUiwjSgEdMO2zRvbFkMVB5+qIw33o+1uvsS+Vwt3LU= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1/go.mod h1:PdAF531U/qcXoTn4/Ay+RCTXAiim7Z4zPPiJMSY0P+w= -github.com/aws/aws-sdk-go-v2/service/rds v0.31.0 h1:9QnLjHZGNMR73qWhWQjbLd3Rg1b/UE9XmWNRWpcoypk= -github.com/aws/aws-sdk-go-v2/service/rds v0.31.0/go.mod h1:QR1y6Z2xttVeN5/Ka1qI5nNy5QNh3iMHBEx97R+EP3w= github.com/aws/aws-sdk-go-v2/service/rds v1.1.1 h1:bA0wFJBnOiEa5ZcNHt9vHlTjjjj/rFvCcQq7nqE36WI= github.com/aws/aws-sdk-go-v2/service/rds v1.1.1/go.mod h1:5KthKjThUjPkKAfTTtqEreCr5Lu5zYu78xfiSxo9KF4= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v0.31.0 h1:Om4H0ZDKWIhRDcVXSO5PQpWs8nuFg2qS39I9w8BD0Wg= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v0.31.0/go.mod h1:MBMdPulWDqlGeRIMt9KjAqJxhM69clkLz/cOrpCb3QY= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1 h1:uDSFv0UmCcrrqhRrTlP9l/YTSESnZkZIHdJVdVDYY/4= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1/go.mod h1:21JHC8cArZT+J7hgQZgS+4kx8s9SdSFIqxOmiR+sGto= -github.com/aws/aws-sdk-go-v2/service/route53 v0.31.0 h1:0qVkvLk5bfNwpV7jbWFeTNzwibf5UQox18t4OZRSGuM= -github.com/aws/aws-sdk-go-v2/service/route53 v0.31.0/go.mod h1:pAjhJw+tl3oKqX/SzArjU2KSKZs3qLzfG39rqAxM9w8= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 h1:cKr6St+CtC3/dl/rEBJvlk7A/IN5D5F02GNkGzfbtVU= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/s3 v0.31.0 h1:KDBpodyszhL8F83QYv36qBzDj99oPlt1coZNGSFKTXU= -github.com/aws/aws-sdk-go-v2/service/s3 v0.31.0/go.mod h1:KnvsmhsdHaJJZatMeNscBKaEmz0V5oXe1N5ZaLmGDBs= +github.com/aws/aws-sdk-go-v2/service/s3 v1.1.0 h1:d3PK2s3MB8ikznU/tChWoWQM2EVHo+4ZymURcl9WVE4= +github.com/aws/aws-sdk-go-v2/service/s3 v1.1.0/go.mod h1:FunhqiuImyH0bxYm3xESmYTwq4dcESZQeaSAO4GjnTc= github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 h1:p20kkvl+DwV3wYsnLGcmsspBzWGD6EsWKi/W+09Z1NI= github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0/go.mod h1:nHAD0aOk81kN3xdNYzKg4g9JISKSwRdUUDEXOgIojf4= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v0.31.0 h1:RPlRz535UVwpXtj7lWAL2HW7Lv8S0y/Jy+9sZHxtkdw= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v0.31.0/go.mod h1:C/lUWjIxMClzBE33jWymfvA9x5hb3busK6cuLg+0KT8= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 h1:tOZVE/wpwnCH6zMCvDi8WsuXLV1p5PG/WOhHu8LWphE= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1/go.mod h1:ytf+Mop8BTUFmWJSCI/U33FawS9A8UWwybOdNOXU6zE= -github.com/aws/aws-sdk-go-v2/service/securityhub v0.31.0 h1:Q3qiz1RVn+yRukseTf5j7OS/+66CQ7ig5DMOdWBGRtc= -github.com/aws/aws-sdk-go-v2/service/securityhub v0.31.0/go.mod h1:jLS1JPpsUrsrm2mdI6sOVJYdEoeBX/JwmKVE5C6+yxY= github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1 h1:80QYiUXqf6EHmxhW3wk9VGaGuem7GAeW2TcJj7hc0Do= github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1/go.mod h1:M/Eb/iVz5QLNeFxNP10Ww6uYarHvm8X1SaTc23NhoYw= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v0.31.0 h1:H9BTjvHO5WVURQgxaF4TYA/5JPnV/oGv/3dwgZTGqkY= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v0.31.0/go.mod h1:hJAjGj2cz8HMandRgfte82mGHBsZH7JCn4G2OyeDrLo= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1 h1:5qx3KZq6WyQnX+gvLuU6sLBBWJulFrVn7sZoe+9GpJQ= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1/go.mod h1:AxJdVkbAHbnhUhUP3cFgMGEe288M8+YDXW7gbcdqOtQ= -github.com/aws/aws-sdk-go-v2/service/ses v0.31.0 h1:LGG/StZLR73+UlY2HDklSkj8hP3qm0Zod8Z90iQG+44= -github.com/aws/aws-sdk-go-v2/service/ses v0.31.0/go.mod h1:A/++wHjcpV2TKYvmLhrQkZwmyI/GfShxefgvM35zUJ8= github.com/aws/aws-sdk-go-v2/service/ses v1.1.1 h1:ZCT1HdrWSIt8014g2Wia7B1SpytNh9EGZ/qKpZvRVgA= github.com/aws/aws-sdk-go-v2/service/ses v1.1.1/go.mod h1:U9bdibu41007uBclE2QUdURjHU6SzQKqxY5GKppL7gE= -github.com/aws/aws-sdk-go-v2/service/sfn v0.31.0 h1:CPy3AD5FJyqP3s3npH02N/786tyG1/hHwk9M0qTz5vY= -github.com/aws/aws-sdk-go-v2/service/sfn v0.31.0/go.mod h1:lOKatGV5faT6PowqlJUUCsk9MlAl2MLPB+r0dEs5lm8= github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1 h1:GexTkfjidovrPhnvLrX2ggMo7pooiZJfZw/K1MOwe/o= github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1/go.mod h1:e1kcDzRmGL4UoKqMcyJT344yqMivOXIftV+O1H6fixY= -github.com/aws/aws-sdk-go-v2/service/sns v0.31.0 h1:wbuobXnoDBp5R8tLcK6INVWqiyedymFReSBoEsfI3VQ= -github.com/aws/aws-sdk-go-v2/service/sns v0.31.0/go.mod h1:z2sDp3+VSVK29ymUSY23ECKpKgUjePTDoBGDWa2s8t8= github.com/aws/aws-sdk-go-v2/service/sns v1.1.1 h1:5Js3R6coB5uI/h/Gua2Vm+uyuZrgmXs80zqtkOBumxk= github.com/aws/aws-sdk-go-v2/service/sns v1.1.1/go.mod h1:V2HdUZQcKhcF58AwYU78fkQ5Drfw3qAGMUd9o1uvrf8= -github.com/aws/aws-sdk-go-v2/service/sqs v0.31.0 h1:KWDgaC5RRb8ind8+b1+EveN7ywQ+2+KgQP8UJN9ao/c= -github.com/aws/aws-sdk-go-v2/service/sqs v0.31.0/go.mod h1:fl3rAHxyXa29C+IDaKxR2C1nxw6bKIIoPm45pKBubcs= github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1 h1:T1fzWyfSgTNfFwpePwG9l0re3HWHprjUId/zy1Q4YvM= github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1/go.mod h1:vT8RRjBL5Z9KBZGGhjLcG6pngVLeq7MqySFsNdGFjSc= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 h1:37QubsarExl5ZuCBlnRP+7l1tNwZPBSTqpTBrPH98RU= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v0.31.0 h1:iJwlIyswoW4VM8RUmhC3397jdGa6QhMUtUf5daX+/a0= -github.com/aws/aws-sdk-go-v2/service/sts v0.31.0/go.mod h1:gliVu4/DZsKINvBoEcMIlxMIQft/yPYQhnSLxwiWqFM= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 h1:TJoIfnIFubCX0ACVeJ0w46HEH5MwjwYN4iFhuYIhfIY= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/aws-sdk-go-v2/service/swf v0.31.0 h1:SWpbVzSVgBkL+7nBVLBliqSs61THNR1z85zihiJzCR0= -github.com/aws/aws-sdk-go-v2/service/swf v0.31.0/go.mod h1:1rgCDRbQ1Yc9NsAXrjbAeu6oUhgn0lpnv235Ul/tRUs= github.com/aws/aws-sdk-go-v2/service/swf v1.1.1 h1:EStZ7gUWjg5++OVEZu3xjfIkD8hD4dGqV+9EwHtjfDo= github.com/aws/aws-sdk-go-v2/service/swf v1.1.1/go.mod h1:bbRKpQC4O12+BLlo6k67OyXWeJB8jWQwcmmKLrJgQVQ= -github.com/aws/aws-sdk-go-v2/service/waf v0.31.0 h1:XV0dF9pK9dnh7zHvloULsGsGE/3B3/3jXqkQct3PEDw= -github.com/aws/aws-sdk-go-v2/service/waf v0.31.0/go.mod h1:Qfq9m3y6DrrFTktcswXFo1EWCqF/kMWJBO4mYtR8dLE= github.com/aws/aws-sdk-go-v2/service/waf v1.1.1 h1:ttI5GZs4+1gUrjkO9ghNbu1TQ2jyO3DloZ8DRozl0VQ= github.com/aws/aws-sdk-go-v2/service/waf v1.1.1/go.mod h1:aSpFbfXuliA/KIQ6EfxYRXSJlnXpMfwUEPY7v5XtABw= -github.com/aws/aws-sdk-go-v2/service/wafregional v0.31.0 h1:tWZdulq3jaGxA6PmQuygBzG9GB18RZfJD9mXsgkXDz4= -github.com/aws/aws-sdk-go-v2/service/wafregional v0.31.0/go.mod h1:XIfwlh8iurBBeZZvfQ2zYRns/iftFGVu0oxZ09Uc4O4= github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1 h1:4UytI/MUBqd9Be5DgWXwWuzSRvbt6S4B5toSgbAZlEw= github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1/go.mod h1:rcc9EDUl/wpNAF+7AvKKh/r2fP6kpl8buDxwQ5Ep6ak= -github.com/aws/aws-sdk-go-v2/service/workspaces v0.31.0 h1:eZZUV8lZgxGPck/dKWC6bXxfLn1DmN3cC1dhSJc/Oso= -github.com/aws/aws-sdk-go-v2/service/workspaces v0.31.0/go.mod h1:8Q0T7Es63j2zfSaunZqBtiF8fJPwvSxHMgH/E6ic6LU= github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1 h1:QXIL9UoGbmATmspJ8v+OMp4er7K/q8ZQ5O0/iyfAG2w= github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1/go.mod h1:/EpCu/KcalvPnsyM8zYgXCQ+dStC43HbtCO0hInHZP8= -github.com/aws/aws-sdk-go-v2/service/xray v0.31.0 h1:f4TePHb8RuEUK0K5KonchrBVuE2nQPuHfzBt0tDGrTI= -github.com/aws/aws-sdk-go-v2/service/xray v0.31.0/go.mod h1:kiTKEma8t39zVRcumMkp2612YQPqIDfN0lwhSYiF/Xw= github.com/aws/aws-sdk-go-v2/service/xray v1.1.1 h1:KdBCrnM+HnMW/On4O6EQ9OhiM3Fz0hrpvMhzIRY1/eY= github.com/aws/aws-sdk-go-v2/service/xray v1.1.1/go.mod h1:yXqbCaS1hC9CrShJsTrshudAvR/pspjeIRDbMpPRrC0= -github.com/aws/smithy-go v0.5.0 h1:ArsdWUrb1n6/V/REXhuwq2TZv+kuqOBpMlGBd2EkDYM= -github.com/aws/smithy-go v0.5.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.1.0 h1:D6CSsM3gdxaGaqXnPgOBCeL6Mophqzu7KJOu7zW78sU= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= diff --git a/providers/aws/api_gateway.go b/providers/aws/api_gateway.go index 97fb1bc4eb..70b435d629 100644 --- a/providers/aws/api_gateway.go +++ b/providers/aws/api_gateway.go @@ -16,7 +16,6 @@ package aws import ( "context" - "github.com/IBM/ibm-cos-sdk-go/aws" "log" "strings" @@ -374,7 +373,7 @@ func (g *APIGatewayGenerator) loadAuthorizers(svc *apigateway.Client, restAPIID "aws", map[string]string{ "rest_api_id": *restAPIID, - "name": aws.StringValue(authorizer.Name), + "name": StringValue(authorizer.Name), }, apiGatewayAllowEmptyValues, map[string]interface{}{}, diff --git a/providers/aws/aws_service.go b/providers/aws/aws_service.go index a4ebd76e49..b561e07d42 100644 --- a/providers/aws/aws_service.go +++ b/providers/aws/aws_service.go @@ -34,14 +34,20 @@ type AWSService struct { //nolint var awsVariable = regexp.MustCompile(`(\${[0-9A-Za-z:]+})`) +var configCache *aws.Config + func (s *AWSService) generateConfig() (aws.Config, error) { + if configCache != nil { + return *configCache, nil + } + config, e := s.buildBaseConfig() if e != nil { return config, e } if s.Verbose { - config.ClientLogMode = aws.LogRequestWithBody & aws.LogResponseWithBody & aws.LogRetries + config.ClientLogMode = aws.LogRequestWithBody & aws.LogResponseWithBody } creds, e := config.Credentials.Retrieve(context.TODO()) @@ -60,7 +66,7 @@ func (s *AWSService) generateConfig() (aws.Config, error) { os.Setenv("AWS_SESSION_TOKEN", creds.SessionToken) } } - + configCache = &config return config, nil } diff --git a/providers/aws/ecs.go b/providers/aws/ecs.go index e0377376c8..e8c5e059b0 100644 --- a/providers/aws/ecs.go +++ b/providers/aws/ecs.go @@ -17,7 +17,6 @@ package aws import ( "context" "fmt" - "github.com/IBM/ibm-cos-sdk-go/aws" "strconv" "strings" @@ -73,7 +72,7 @@ func (g *EcsGenerator) InitResources() error { Services: []string{ serviceName, }, - Cluster: aws.String(clusterArn), + Cluster: &clusterArn, }) if err != nil { fmt.Println(err.Error()) @@ -87,7 +86,7 @@ func (g *EcsGenerator) InitResources() error { "aws_ecs_service", "aws", map[string]string{ - "task_definition": aws.StringValue(serviceDetails.TaskDefinition), + "task_definition": StringValue(serviceDetails.TaskDefinition), "cluster": clusterName, "name": serviceName, "id": serviceArn, diff --git a/providers/aws/elasticache.go b/providers/aws/elasticache.go index 5fa6f10cd0..d8491844e4 100644 --- a/providers/aws/elasticache.go +++ b/providers/aws/elasticache.go @@ -16,7 +16,6 @@ package aws import ( "context" - "github.com/IBM/ibm-cos-sdk-go/aws" "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -130,7 +129,7 @@ func (g *ElastiCacheGenerator) loadReplicationGroups(svc *elasticache.Client) er return err } for _, replicationGroup := range page.ReplicationGroups { - resourceName := aws.StringValue(replicationGroup.ReplicationGroupId) + resourceName := StringValue(replicationGroup.ReplicationGroupId) g.Resources = append(g.Resources, terraformutils.NewSimpleResource( resourceName, resourceName, diff --git a/providers/aws/s3.go b/providers/aws/s3.go index 1dbd245b6d..03270c3909 100644 --- a/providers/aws/s3.go +++ b/providers/aws/s3.go @@ -17,10 +17,8 @@ package aws import ( "context" "fmt" - "github.com/IBM/ibm-cos-sdk-go/aws/awserr" - "log" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "log" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/s3" @@ -55,16 +53,12 @@ func (g *S3Generator) createResources(config aws.Config, buckets *s3.ListBuckets "acl": "private", } // try get policy - policy, err := svc.GetBucketPolicy(context.TODO(), &s3.GetBucketPolicyInput{ + var policy *s3.GetBucketPolicyOutput + policy, err = svc.GetBucketPolicy(context.TODO(), &s3.GetBucketPolicyInput{ Bucket: bucket.Name, }) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() != "NoSuchBucketPolicy" { - log.Println(err) - continue - } - } else { + if err == nil && policy.Policy != nil { attributes["policy"] = *policy.Policy } resources = append(resources, terraformutils.NewResource( @@ -89,7 +83,7 @@ func (g *S3Generator) InitResources() error { } svc := s3.NewFromConfig(config) - buckets, err := svc.ListBuckets(context.TODO(), &s3.ListBucketsInput{}) + buckets, err := svc.ListBuckets(context.TODO(), nil) if err != nil { return err } diff --git a/tests/aws/main.go b/tests/aws/main.go index 5464bba699..a32bbc7f3b 100644 --- a/tests/aws/main.go +++ b/tests/aws/main.go @@ -31,8 +31,9 @@ func main() { "import", "aws", "--regions=ap-southeast-1", - "--resources=vpc,sg", - "--profile=personal_diagrams", + "--resources=s3", + "--profile=personal", + "--verbose", "--compact", "--path-pattern=" + pathPattern, }) From 88803b7da588a0111bac638fc05c737711b8055f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 06:49:29 +0000 Subject: [PATCH 108/276] Bump github.com/IBM/keyprotect-go-client from 0.5.2 to 0.6.0 Bumps [github.com/IBM/keyprotect-go-client](https://github.com/IBM/keyprotect-go-client) from 0.5.2 to 0.6.0. - [Release notes](https://github.com/IBM/keyprotect-go-client/releases) - [Commits](https://github.com/IBM/keyprotect-go-client/compare/v0.5.2...v0.6.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e5a58a98b5..e7843ddf16 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 github.com/IBM/ibm-cos-sdk-go v1.5.0 - github.com/IBM/keyprotect-go-client v0.5.2 + github.com/IBM/keyprotect-go-client v0.6.0 github.com/IBM/networking-go-sdk v0.12.1 github.com/IBM/vpc-go-sdk v0.4.1 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 diff --git a/go.sum b/go.sum index 5c15140f4a..4422ddf376 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/IBM/go-sdk-core/v4 v4.9.0 h1:OkSg5kaEfVoNuBA4IsIOz8Ur5rbGHbWxmWCZ7nK/ github.com/IBM/go-sdk-core/v4 v4.9.0/go.mod h1:DbQ+3pFoIjxGGTEiA9zQ2V0cemMNmFMkLBBnR729HKg= github.com/IBM/ibm-cos-sdk-go v1.5.0 h1:YCmAgsdtp/irQep5g+62OvjLNj35tMXLqTC5jQ+YjWo= github.com/IBM/ibm-cos-sdk-go v1.5.0/go.mod h1:4mqv/ejW1PKW+Ij6ytU+W8j1UZeLmSEsR5K+flBaWMY= -github.com/IBM/keyprotect-go-client v0.5.2 h1:A4yp2Fc7mg4dtotZErZXwJb9XKpb3ONexnVB+/JqLDM= -github.com/IBM/keyprotect-go-client v0.5.2/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI= +github.com/IBM/keyprotect-go-client v0.6.0 h1:jZExoYSaoQ5TrfEzPOmBLc1vJ0VWA0RfKC+Bx39IeGo= +github.com/IBM/keyprotect-go-client v0.6.0/go.mod h1:SVr2ylV/fhSQPDiUjWirN9fsyWFCNNbt8GIT8hPJVjE= github.com/IBM/networking-go-sdk v0.12.1 h1:GmzrRjvAyqKMfUPM8Y/R5dce0x5AXTqmseVZ3n7eZks= github.com/IBM/networking-go-sdk v0.12.1/go.mod h1:lzkGBnw5glMB7Nxawfgu19MH4Tjy3KRQ2SYMYl2ck7o= github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= @@ -832,6 +832,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= From e728bf65b8af9714995c20cbbd35a81afe6b3119 Mon Sep 17 00:00:00 2001 From: Pratik Mallya Date: Sun, 28 Feb 2021 23:19:24 -0800 Subject: [PATCH 109/276] Actually filter monitors on tags The current implementation ignores tags. This change fixes that by making the implementation respect tags specified in a filter. I tested this using: ``` terraformer import datadog --resources=monitor --filter="Name=tags;Value='team:sre'" ``` Before this change: it fetched all monitors After this change: it only fetches monitors tagged with `team:sre` --- providers/datadog/monitor.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/providers/datadog/monitor.go b/providers/datadog/monitor.go index 98a606a78d..57141f9de2 100644 --- a/providers/datadog/monitor.go +++ b/providers/datadog/monitor.go @@ -18,6 +18,7 @@ import ( "context" "fmt" "strconv" + "strings" datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" @@ -63,6 +64,7 @@ func (g *MonitorGenerator) createResource(monitorID string) terraformutils.Resou func (g *MonitorGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) + dclient := datadogClientV1.MonitorsApi.ListMonitors(authV1) resources := []terraformutils.Resource{} for _, filter := range g.Filter { @@ -81,6 +83,9 @@ func (g *MonitorGenerator) InitResources() error { resources = append(resources, g.createResource(strconv.FormatInt(monitor.GetId(), 10))) } } + if filter.FieldPath == "tags" && filter.IsApplicable("monitor") { + dclient = dclient.MonitorTags(strings.Join(filter.AcceptableValues, ",")) + } } if len(resources) > 0 { @@ -92,7 +97,7 @@ func (g *MonitorGenerator) InitResources() error { pageSize := int32(1000) pageNumber := int64(0) for { - resp, _, err := datadogClientV1.MonitorsApi.ListMonitors(authV1).PageSize(pageSize).Page(pageNumber).Execute() + resp, _, err := dclient.PageSize(pageSize).Page(pageNumber).Execute() if err != nil { return err } From d7777116780600b56c4a164f8e4551188a5f40ff Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sat, 6 Mar 2021 23:29:05 +0800 Subject: [PATCH 110/276] #800 fix security hub membership --- providers/aws/securityhub.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/providers/aws/securityhub.go b/providers/aws/securityhub.go index 6742e06e5e..d805a1451a 100644 --- a/providers/aws/securityhub.go +++ b/providers/aws/securityhub.go @@ -85,15 +85,18 @@ func (g *SecurityhubGenerator) addMembers(svc *securityhub.Client, accountNumber } for _, member := range page.Members { id := *member.AccountId + attributes := map[string]string{ + "account_id": id, + } + if member.Email != nil { + attributes["email"] = *member.Email + } g.Resources = append(g.Resources, terraformutils.NewResource( id, "securityhub_member_"+id, "aws_securityhub_member", "aws", - map[string]string{ - "account_id": id, - "email": *member.Email, - }, + attributes, securityhubAllowEmptyValues, map[string]interface{}{ "depends_on": []string{"${aws_securityhub_account.tfer--" + accountNumber + "}"}, From 2cfde3fc41e9820501096bf98d663a53c4bf7d21 Mon Sep 17 00:00:00 2001 From: Aivaras Kondrotas Date: Mon, 8 Mar 2021 06:02:05 +0200 Subject: [PATCH 111/276] Print out errors when wrong region selected --- providers/gcp/gcp_provider.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/providers/gcp/gcp_provider.go b/providers/gcp/gcp_provider.go index 656be50d70..57745dc115 100644 --- a/providers/gcp/gcp_provider.go +++ b/providers/gcp/gcp_provider.go @@ -17,6 +17,7 @@ package gcp import ( "context" "errors" + "log" "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -49,10 +50,12 @@ func GetRegions(project string) []string { func getRegion(project, regionName string) *compute.Region { computeService, err := compute.NewService(context.Background()) if err != nil { + log.Println(err) return &compute.Region{} } region, err := computeService.Regions.Get(project, regionName).Do() if err != nil { + log.Println(err) return &compute.Region{} } return region From 45df63592e2346308533a897e6aa70034d1d6ead Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 14 Mar 2021 00:11:01 +0800 Subject: [PATCH 112/276] #549 AWS SDK upgrade to v1.2.1 --- go.mod | 135 ++++++++++++++++++++++++++-------------------------- go.sum | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+), 68 deletions(-) diff --git a/go.mod b/go.mod index a77ff4aefc..af18cace95 100644 --- a/go.mod +++ b/go.mod @@ -21,74 +21,73 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go-v2 v1.2.0 - github.com/aws/aws-sdk-go-v2/config v1.1.1 - github.com/aws/aws-sdk-go-v2/credentials v1.1.1 - github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 - github.com/aws/aws-sdk-go-v2/service/acm v1.1.1 - github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1 - github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1 - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1 - github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1 - github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1 - github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1 - github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1 - github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1 - github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1 - github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1 - github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1 - github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1 - github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1 - github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1 - github.com/aws/aws-sdk-go-v2/service/efs v1.1.1 - github.com/aws/aws-sdk-go-v2/service/eks v1.1.1 - github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1 - github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1 - github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1 - github.com/aws/aws-sdk-go-v2/service/emr v1.1.1 - github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1 - github.com/aws/aws-sdk-go-v2/service/glue v1.1.1 - github.com/aws/aws-sdk-go-v2/service/iam v1.1.1 - github.com/aws/aws-sdk-go-v2/service/iot v1.1.1 - github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1 - github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1 - github.com/aws/aws-sdk-go-v2/service/kms v1.1.1 - github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1 - github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1 - github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1 - github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1 - github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1 - github.com/aws/aws-sdk-go-v2/service/rds v1.1.1 - github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1 - github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 - github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 - github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1 - github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1 - github.com/aws/aws-sdk-go-v2/service/ses v1.1.1 - github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1 - github.com/aws/aws-sdk-go-v2/service/sns v1.1.1 - github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1 - github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 - github.com/aws/aws-sdk-go-v2/service/swf v1.1.1 - github.com/aws/aws-sdk-go-v2/service/waf v1.1.1 - github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1 - github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1 - github.com/aws/aws-sdk-go-v2/service/xray v1.1.1 - github.com/aws/smithy-go v1.1.0 + github.com/aws/aws-sdk-go-v2 v1.2.1 + github.com/aws/aws-sdk-go-v2/config v1.1.2 + github.com/aws/aws-sdk-go-v2/credentials v1.1.2 + github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.2 + github.com/aws/aws-sdk-go-v2/service/acm v1.1.2 + github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.2 + github.com/aws/aws-sdk-go-v2/service/appsync v1.1.2 + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.2 + github.com/aws/aws-sdk-go-v2/service/budgets v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.2 + github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.2 + github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.2 + github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.2 + github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.2 + github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.2 + github.com/aws/aws-sdk-go-v2/service/configservice v1.1.2 + github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.2 + github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.2 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.2 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.2 + github.com/aws/aws-sdk-go-v2/service/ecr v1.1.2 + github.com/aws/aws-sdk-go-v2/service/ecs v1.1.2 + github.com/aws/aws-sdk-go-v2/service/efs v1.1.2 + github.com/aws/aws-sdk-go-v2/service/eks v1.1.2 + github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.2 + github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.2 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.2 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.2 + github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.2 + github.com/aws/aws-sdk-go-v2/service/emr v1.1.2 + github.com/aws/aws-sdk-go-v2/service/firehose v1.1.2 + github.com/aws/aws-sdk-go-v2/service/glue v1.1.2 + github.com/aws/aws-sdk-go-v2/service/iam v1.1.2 + github.com/aws/aws-sdk-go-v2/service/iot v1.1.2 + github.com/aws/aws-sdk-go-v2/service/kafka v1.1.2 + github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.2 + github.com/aws/aws-sdk-go-v2/service/kms v1.1.2 + github.com/aws/aws-sdk-go-v2/service/lambda v1.1.2 + github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.2 + github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.2 + github.com/aws/aws-sdk-go-v2/service/organizations v1.1.2 + github.com/aws/aws-sdk-go-v2/service/qldb v1.1.2 + github.com/aws/aws-sdk-go-v2/service/rds v1.1.2 + github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.2 + github.com/aws/aws-sdk-go-v2/service/route53 v1.1.2 + github.com/aws/aws-sdk-go-v2/service/s3 v1.2.1 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.2 + github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.2 + github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.2 + github.com/aws/aws-sdk-go-v2/service/ses v1.1.2 + github.com/aws/aws-sdk-go-v2/service/sfn v1.1.2 + github.com/aws/aws-sdk-go-v2/service/sns v1.1.2 + github.com/aws/aws-sdk-go-v2/service/sqs v1.1.2 + github.com/aws/aws-sdk-go-v2/service/sts v1.1.2 + github.com/aws/aws-sdk-go-v2/service/swf v1.1.2 + github.com/aws/aws-sdk-go-v2/service/waf v1.1.2 + github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.2 + github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.2 + github.com/aws/aws-sdk-go-v2/service/xray v1.1.2 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect diff --git a/go.sum b/go.sum index f8ccf80408..9d0e6efe28 100644 --- a/go.sum +++ b/go.sum @@ -173,157 +173,303 @@ github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/ github.com/aws/aws-sdk-go-v2 v1.1.0/go.mod h1:smfAbmpW+tcRVuNUjo3MOArSZmW72t62rkCzc2i0TWM= github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= +github.com/aws/aws-sdk-go-v2 v1.2.1 h1:055XAi+MtmhyYX161p+jWRibkCb9YpI2ymXZiW1dwVY= +github.com/aws/aws-sdk-go-v2 v1.2.1/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+testmuQeRY= github.com/aws/aws-sdk-go-v2/config v1.1.1 h1:ZAoq32boMzcaTW9bcUacBswAmHTbvlvDJICgHFZuECo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= +github.com/aws/aws-sdk-go-v2/config v1.1.2 h1:H2r6cwMvvINFpEC55Y7jcNaR/oc7zYIChrG2497wmBI= +github.com/aws/aws-sdk-go-v2/config v1.1.2/go.mod h1:77yIk+qmCS/94JlxbwV1d+YEyu6Z8FBlCGcSz3TdM6A= github.com/aws/aws-sdk-go-v2/credentials v1.1.1 h1:NbvWIM1Mx6sNPTxowHgS2ewXCRp+NGTzUYb/96FZJbY= github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= +github.com/aws/aws-sdk-go-v2/credentials v1.1.2 h1:YoNqfhxAJGZI+lStIbqgx30UcCqQ86fr7FjTLUvrFOc= +github.com/aws/aws-sdk-go-v2/credentials v1.1.2/go.mod h1:hofjw//lM0XLplgvzPPMA7oD0doQU1QpaIK1nweEEWg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 h1:EtEU7WRaWliitZh2nmuxEXrN0Cb8EgPUFGIoTMeqbzI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.3 h1:d3bKAGy4XdJyK8hz3Nx3WJJ4TCmYp2498G4mFY5wly0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.3/go.mod h1:Zr1Mj+KUMGVQ+WJvTT68EZJxqhjiie2PWSPGEUPaNY0= github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 h1:6ocrUoJHmXBa0/oCoWYN2nK+UrETpA0zUxCV990nRl0= github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1/go.mod h1:+JkwIyrURCsjBdb3M6PdF+LAQ3TPvZAfH+gJ7AI3JT0= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.2 h1:nRGCAKHW9y7UTmYfVK0A4gdNPiv9r9DgRAgcNdKTIiI= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.2/go.mod h1:d06PcqdTUu/DWO7VX0THiUVJQiWQCOqlKUd2+3/l7K0= github.com/aws/aws-sdk-go-v2/service/acm v1.1.1 h1:LAr7oTwfOZdfJN1GrZnU05yf2aOO3HVeGv2KjJKp8d4= github.com/aws/aws-sdk-go-v2/service/acm v1.1.1/go.mod h1:LPzlCt4j2TSsD9P6NtruMhkOf0Ke7uxEHaxRCI5D1x4= +github.com/aws/aws-sdk-go-v2/service/acm v1.1.2 h1:rtDZfCAVenmkJbXlJtiKq2qUXk3CP24dUyY0ZdfntTU= +github.com/aws/aws-sdk-go-v2/service/acm v1.1.2/go.mod h1:D6HblKOnaa8K5Pz7SCl2p3lpY0TMnfUpE/2gel3bg3A= github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1 h1:G2JpxWOpTyeLgTbh5gfiESvvm6B3lu/6kQNEhAS8Tvk= github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1/go.mod h1:wmgrgVgNP96iRTgbY+Qd3UdqVvmlOCd46tY2P6sOTfs= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.2 h1:HLLXaDntRmxE+ipJE0PaQm5s0EkxgCc2CdkjgYp+wuo= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.2/go.mod h1:tSUFOanfmaa5h3b4VhH505Bm/aO2yNk6sXUDRRfwZP4= github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1 h1:NYPqPq18/WvalPPowYG0laum27pdEXq5gnrTp1ppVF4= github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1/go.mod h1:uhccc+JDGc1Ck0q8F3iI0+PPIP1N+yTZEfuMPp2Achw= +github.com/aws/aws-sdk-go-v2/service/appsync v1.1.2 h1:ZnPjospQrreBKs/wn3YFuAycYRVMiOmwPRpxFOUHdVU= +github.com/aws/aws-sdk-go-v2/service/appsync v1.1.2/go.mod h1:MJ/f6dHpgNODy8qpr9CKP2F7ahNLcTJbfiEPubP4kzk= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1 h1:O0iefEPzxDdVVBtY7o0Hyj4SUre27QRh5mthCU+HYDA= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1/go.mod h1:lmXoX7IIO5yAHRCmHlqda9tFfsbkY3IO3rt85VvXmIQ= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.2 h1:FJDnLBh8hYdyvR+MNH4bO6dfaLUfpHt/qp7C0M9PW8E= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.2/go.mod h1:ZSwcb/G1aNBqI1sTu+ltHoyv24+rKMITwzGmOZWKu7w= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1 h1:ZVgyQqcfkXmz8VLA/R0j0FdqMBwPYNs52Ho2DzwY8zo= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1/go.mod h1:/v+APBnOBPy/NpPFS1lH5qJ9BfEQVfPAEnBm5XV1870= +github.com/aws/aws-sdk-go-v2/service/budgets v1.1.2 h1:1Y0am48Q1bG2Sp+SRblVnZ5MQegm72CfY2wcXLMKy1c= +github.com/aws/aws-sdk-go-v2/service/budgets v1.1.2/go.mod h1:hXXUg4S46AY9OLt0Z5+6FO3m+zaQ+Fs7eZ9vOs5+5HA= github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1 h1:WblDVlnxgdvuZNwBw3UX3JaO7hdVuvaLNK4P0XK1gKM= github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1/go.mod h1:InGDFYVeG6/bfb5KRB2n5qTFWZ/vp483zdUE1EPbDM0= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.2 h1:cEP6HRpSyu8Ya+R5pvoF022H5HGBhUVwILmG3b4gRvA= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.2/go.mod h1:h+/8bgq+cqn/4POUfLez6ytHJbF0ieYKIoXkzIrwIxY= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1 h1:cRw6t1ZAqc0fG2CFtWnXXdBwgREo6B06X63lDlpGPlI= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1/go.mod h1:Fq3q5X0gHcCCldZx+ibAo0HRo2xbVi9LFoFj2Pp9nl0= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.2 h1:KLfDJr7FrIBUyblZoykOkrUQcee2jG4i/h9ktrAnR2w= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.2/go.mod h1:yEU17ooXv0TOuVllG01Y9bnLpzItcdQK5WwOQ8Hx0lE= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1 h1:Qhi6EdWHqYvqKXZBZ55YHNR6RL9JJTi65ndbqPKRdpM= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1/go.mod h1:xNq//oorX26+SRydd//Rqk3iPLoKzoYmAGDm6p3wpzc= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.2 h1:AeLWpXkm6c1EsOBXWH2fCyQbQHcJvBEfKBHVKDxCIbE= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.2/go.mod h1:71I7dqlx0GqfHY5G8JfzgT9GtZiK/MIHE+rMODYhIzI= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1 h1:jso38tIYjMhe0i5uBD2sG/nmgODmh8ZCKFvaejqlIQ8= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1/go.mod h1:e6vwvVG3CrANic49hz9SG2bkKnSujNy8r+S6MZ21oEE= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.2 h1:jzPgwQXYlH3rCNr+6lAatslMaUhcGzgWk+yPKsdsBNE= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.2/go.mod h1:PHb1emsao0PBvsnH2XxSgEq+FS6ifR1da8LDh+MRrk0= github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1 h1:MNQmQJZNCAlPqkWP01/7YptslcAbVmLNyqac+W/Q5oY= github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1/go.mod h1:gI/6WuEdSe7fWiBOMVPJfaonzq9mSA2E7h85CZNXzuI= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.2 h1:TQG/DLTpnn2tOPqQ/eYA2MsDR+ALiRTEDdc02fpgTrc= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.2/go.mod h1:+mjnjZE8B5Kav2pwoc00jS36ffTYVYeC3HV9wIcbBL4= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1 h1:wvmvsbvJw/ml/PtdvqbcJnpu/GZLA5dERO0pqpcvyw0= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1/go.mod h1:HFCCrSEnP3mVyR8zOmcbLSQJW4DGRKoz1hjJxh4d/tw= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.2 h1:/deTIzCUutEJMf2M9m+kJ+NxOREzWztaZfUF44bP49A= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.2/go.mod h1:YbU+VaZkitxbGlS92bIX78fEbx2zz0XDSw/btL3iPTU= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1 h1:abNETLBP3ShOHUBocGFBHqbP3D9Ho2vKhG8soWId4js= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1/go.mod h1:rtyMQxf1ahZkyvpcwnHGR7goHPJC4WRUmazENZsbjas= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.2 h1:ORThOu2acsbFDtd6d21JMCmAQu+4X8a+H4j8T+dnCWE= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.2/go.mod h1:2l/dZr0yepiC4XOnYq4mS2pIkzV1ixc9IpNe1Qn12I0= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1 h1:9McrdB/9iGpEZw2xZdRdCYQlNuCHFFYjvROkO5yo1RM= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1/go.mod h1:IB6HamJdrHbUjbWEgWkGX1Lrp8mZzxoBLXHOTAmoXFA= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.2 h1:m+Otg1daHTlYqmG1YVrTDIejzYypSngTuH31TVRP310= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.2/go.mod h1:Nlyl4XGXgdVbzvQ+pMjqB3DX7MBl0KwAk5k0KsM3W+c= github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1 h1:5Ku1ITd/Epk23vIwq/2NU1F0gUKlUcjyk5gOrsXPZIA= github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1/go.mod h1:Hc+1mcfi7yTl5Qtrn7PRwazVWblIIWCfhqwaj8M6vAw= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.2 h1:AjbBPbHPvTfO9aJXpuq3c/iN/PjkyWny6EGKP270JVU= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.2/go.mod h1:v0j3cjX8lslcxiwaIzyp/64Z8BjpWsKgtskCb4O0Hgg= github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1 h1:7WUEimiBFjeo0x/K8JNhPc61oho7TPhXyfrpYxpEMN0= github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1/go.mod h1:JUViTUm6ZiAJOwKItWf/lN5KeBRdidcjfZnAhgKTc0Y= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.2 h1:PIAYXYIBEBFaSvCNTiXsxakePOXC2eZ+wpxWhD2J4O4= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.2/go.mod h1:9Y2XYeoa34KWUK9wae2Iuel8OLRxc00SGgIlGUCOoXE= github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1 h1:nCv1/hV+E3kMUJVwgUzw5zNvcHzP9cQqVmcVZXlcmiE= github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1/go.mod h1:ktnHZmgGlqoJkUjyzR4RHDlGhfSxQV+AQY7Xx3nPNPw= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.2 h1:o0Q+/kq8y+mEsWyFjue0DblQ/qU+wOLgzSQAzpdLY08= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.2/go.mod h1:lVkvplEz4Hv3ZdrC4+24ZFF66mDISEqaSCiwtcAylCk= github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1 h1:FbzagBHyTmKk4DbXJOx4l/a+k0y49TgWoyzCc04YwAk= github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1/go.mod h1:7pc2jReqY0EvHa5ReuVBIwmRlW8yQV5O3ptw4T+OS80= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.2 h1:EBKpfmTxPZUBXCsUtoCmaaL5KdEjano6axwtDMw23ls= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.2/go.mod h1:PPsYbVZ/U/7LfrGno9R0+pTsHOBmsWPqD/USc4cItFo= github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1 h1:A/ZhwplRVmY3cSM5NfW/3lp0PBJFAhWvHD5+sYo7oxI= github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1/go.mod h1:85mUFI4DMZiUYpQzTfUvDaFf/TL/pd419Elk5FOCVtY= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.2 h1:deWVQ8TYCvZL/NEDvjRHCvpeX78xPEGDuOKh68AJB3Y= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.2/go.mod h1:TWobMrhdOnsWrGlDEeTOe26dq2E/3zFRn2CdYjw4L5g= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1 h1:HoHckIJOdxpS4RSEqnPXp9+gFjixFH97pT46Q4buxhA= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1/go.mod h1:/yhD37TwPeVuZZ8qx1n7H65O0+a2Mh3gEF4TTB4Sn24= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.2 h1:Neqzz0qcl73aN+nIj7KEcQ7YM2AEOW+xloaMp0ge/vI= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.2/go.mod h1:s3dskZLRZHMDJl+kUAWJ7Uv5xbUWWSIkAPx36jFhCJU= github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1 h1:2PU0yT1crQJ08BJOF8Flq8j962NpiU3QltBaKg4NI0c= github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1/go.mod h1:d8io9sMSzJBqxJrNABjaDuFH6t02btWR2ZQtDTGF35A= +github.com/aws/aws-sdk-go-v2/service/configservice v1.1.2 h1:dPfOQxqBLmYgV66JX7kyrCvPLUw5KMGeGJWZN3LS9Fs= +github.com/aws/aws-sdk-go-v2/service/configservice v1.1.2/go.mod h1:Ue5OaxOjceUOvFRteflDfk1puv9p8XFtb2Ek7Uo4N+M= github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1 h1:iBj0PYHYe7Po52v8fAcMEH0RRLbgN0XkJ+dux63lKD8= github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1/go.mod h1:f+FK6B06DiJnhr8Ba6rnN8SSPITHG3et63y8NORbbsk= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.2 h1:hkPtX5dDgQVxqzljfYEo3x0pIGMpKsKkAC89VBX0ma4= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.2/go.mod h1:j+H/C6+L0lXjoAbJ9OGyT6TWFHiJtopkChYPM02xMiA= github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1 h1:NSFZm6LIFbASAv833Bm4+Ea/GiaWr2NvTalswFtOTj4= github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1/go.mod h1:UMb/XuyQ0X/Gr+GVwCwL5qYvPE5vWwUOYHooaa4WhzQ= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.2 h1:9QwBepbF6bMb71tz9etE+FsBc86mop7F4McfiFe8z+Q= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.2/go.mod h1:ylJGzdCqVTEdS6l0KMgK1DRuKO6u2+0SyHSW6E8xKe8= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1 h1:rs3qt8vsrOXgm3qfVdjVkwnPiBXI2M7qN1nExoZmJfI= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1/go.mod h1:0xGVqnX5hK8bd/Qnqklpdellx5/6KPSPV7vfno3i1Sk= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.2 h1:Ow9GseCWcUqFGI0t67OqNT+8hB45Cf3M9zRQkMYEnjU= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.2/go.mod h1:xlIykhO1SzJtiDIbIWxQAYRZFROcJUiuqfU+F3c1YoY= github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1 h1:xZYDtbub5yhn+ASvD26m76Cgb0k+0+ShE+nZwK9djUQ= github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1/go.mod h1:L7nNXGNEV0lkTauKM/KcEIZkT262pckC0YNykwAtX20= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.2 h1:/JoZ7YQX4WBJ+3+t1/cGBYLu+RLPb0pZESN0K11rK7c= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.2/go.mod h1:7oIsiYQEJ1b8Ub5uYCBIum6E2rbe1hOvFqYd2q8Rbcw= github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1 h1:idXCsD7Rl3LtE/MFFw81a1C1tVRSP3AOnv96U0TsRUo= github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1/go.mod h1:NGFCwbEd03lj5kwG8vO5qS5m4CfvHE4ir3pA5ozrlUM= +github.com/aws/aws-sdk-go-v2/service/ecr v1.1.2 h1:U9rzf/TLdiD+t4nWOhjdyznvKoRbr2telGDrzKzihcE= +github.com/aws/aws-sdk-go-v2/service/ecr v1.1.2/go.mod h1:PGXr/KFEb5dOTLc239aywXcceI59izqTn10BjnJ9EBA= github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1 h1:McBGvH3M7n8s6SGuS+UNm8+q5BEmE30cNH/81qy0B4Q= github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1/go.mod h1:HHh+ZaGFQVK16XijQFZKaJdTpeOdxWK894pn9vY2Tgo= +github.com/aws/aws-sdk-go-v2/service/ecs v1.1.2 h1:g3OpNiW1iW9euM9JL2OM6ufGe2eXU0y6nTuK4sgQX7w= +github.com/aws/aws-sdk-go-v2/service/ecs v1.1.2/go.mod h1:v0SesgZfZH39s3f/XaZH5RmT8qQ1ZSuWnYsh9eML0II= github.com/aws/aws-sdk-go-v2/service/efs v1.1.1 h1:UnjpU4x5bCWhJn43C+FXSjRs4fh8z8YjN8AsjxkEFW8= github.com/aws/aws-sdk-go-v2/service/efs v1.1.1/go.mod h1:fJbRgAwIrq3LyqphCXgJs6bVYfMlLZ9G6vepkPvAJsw= +github.com/aws/aws-sdk-go-v2/service/efs v1.1.2 h1:XVTEYxexCqNpiHOgGmsfL+TdpMKTNMde5I4L2NuDnQ0= +github.com/aws/aws-sdk-go-v2/service/efs v1.1.2/go.mod h1:usiaxuisGN8Nq83C2llX1uHGVN1J1kjtaL2iChrtn5s= github.com/aws/aws-sdk-go-v2/service/eks v1.1.1 h1:nK/Kl0TIfwaHUkcCj9+L6td2Xds7QNYMODJKWG1wPOY= github.com/aws/aws-sdk-go-v2/service/eks v1.1.1/go.mod h1:9SVAH9Cu/e1iQOu7VIBp7DhqTq3Dr5cAooCzoh61mEc= +github.com/aws/aws-sdk-go-v2/service/eks v1.1.2 h1:6dTsNRi/7zQfGlHdwQsyTM9K/7SjMb76HccIFjTZ8sY= +github.com/aws/aws-sdk-go-v2/service/eks v1.1.2/go.mod h1:pxRGZ5JOjWAjnDa219dKFwra0HpHgtNeVGku7X/XGmM= github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1 h1:/1VLazyWVSYTzl3CmmfjT2g3jc9krekNcTyGiW09AYY= github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1/go.mod h1:DfEntnpXu52dWWWGCjrx2RNMsHWHXuyI2LOpn+XkFFY= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.2 h1:lU5BpIqZcTXwktDBspHnEtubtyJ64SS8//DoAUSgZQo= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.2/go.mod h1:3OuV15Jw8bwFrDAE8mXqTjdaDDAY/p/v1mXG2EEImtE= github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1 h1:xLqpXaLCUtHJuJiOASwPIPLAJMt1v+6h8phzma1haT8= github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1/go.mod h1:9Klmao5OCdCMYyXPNy+skSx6c4LoKsbPL8IcEqV5wVU= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.2 h1:MRrQb1YVSwWX8gPUpl69a4VeCbqpNl/iDPjVjpRkJ3k= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.2/go.mod h1:yCoYDJc/WIJzItnZS0ZjdIbXhqSg/dERuv/+YH3hcSE= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1 h1:YyPHbW33NvSfUVVYIHVdMQX/BVnkdiJcgGdpjFqU64s= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1/go.mod h1:Gqg2Xf3BaVCDXPjNgkTwM3Q1zN7OSrOszkJ8s9xuYXU= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.2 h1:ZQZ/lNpm1MPz2pvqJbXoNC95S74A4g3nYgnEBSnzZuo= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.2/go.mod h1:01WwK9L3B2NCrItDsdXVxsr8oCPQBFBZb9FABnqgrUY= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1 h1:ARoh9oSYV0QwcenklgpagsW+fI0xx5STB31yn3BtcPE= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1/go.mod h1:DP/R8CgrCb5TFyP3GIM5FcDWcrSl0sTZWHQSxXMtrEk= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.2 h1:GT5cd6rUGA3bWM+6dgP7Bm3QQdsHEqfsMII+BUIPFtk= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.2/go.mod h1:n5F9MNl9cWXJoFUA6+PUoGyOGZreNBgq9ifyMJbGSwk= github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1 h1:Kz5PZgEUnzh3134+b8/kLmA6XrkSLD/qBV5YhUAlP0U= github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1/go.mod h1:LtpgnMWYTwd6oasEo9HsE8dPDyeOnnU4A8at3LkyI6g= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.2 h1:46wNdiMdwMpxJiVkTeodNmXwJykaVrCd7JdSurZPTCU= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.2/go.mod h1:kRMSbCrV9giecQRowSNMa1wBD1nkk9g6S4TOxxlMmFE= github.com/aws/aws-sdk-go-v2/service/emr v1.1.1 h1:Al6w3GqqFKUmBjrQK+RWYNT7t7REiZ52GQL0ew/LSds= github.com/aws/aws-sdk-go-v2/service/emr v1.1.1/go.mod h1:hgkNhB3DJRxLgFjL84KMXQ1c6XNRZQla4qiU1foMdbw= +github.com/aws/aws-sdk-go-v2/service/emr v1.1.2 h1:Z0U9SyMgawaHvgn/AznxADnsCO1nJNbSxPr13/j6+Ew= +github.com/aws/aws-sdk-go-v2/service/emr v1.1.2/go.mod h1:1c6TJKKigHoRbZZG4hhDvSKVPNLZHqr6H3cRE1pYpJ8= github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1 h1:RDEx0S3iyLDCK4/Y2TH4kXo53vJeSNeNyCdVzSwLR4g= github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1/go.mod h1:mIQsr8OSwIu5DgdTeEimmQN6nld0TxfLfIW+aqTEX68= +github.com/aws/aws-sdk-go-v2/service/firehose v1.1.2 h1:uqT56fpKIqEp7OiJz4qulDZjsV2VTJ0f3zZn3wolcR0= +github.com/aws/aws-sdk-go-v2/service/firehose v1.1.2/go.mod h1:8jSNvPdW16D7wXXsu76DONUzGOQNow6qOyrCfRp0jC0= github.com/aws/aws-sdk-go-v2/service/glue v1.1.1 h1:O0mpo0QQXcsjr9lhLpQFKHjBJVY2XXkv5c/nWsZ0zgw= github.com/aws/aws-sdk-go-v2/service/glue v1.1.1/go.mod h1:TegWq2QgDYYk6v6JD8POmo4gWwJhn4Ar6KoCyNxdyC0= +github.com/aws/aws-sdk-go-v2/service/glue v1.1.2 h1:V+IGXefRi9cOe3JH6UAzn+aVSuysUUBQ/yomnZofeLY= +github.com/aws/aws-sdk-go-v2/service/glue v1.1.2/go.mod h1:8AQl1dwuxkdMVluNNEH/t6Qond4/XHu/dz5SeUpvOWs= github.com/aws/aws-sdk-go-v2/service/iam v1.1.1 h1:dfpLUOEtz+DlRpeAA9vg/tM/VjAcDGBE47m2ZbdXrZU= github.com/aws/aws-sdk-go-v2/service/iam v1.1.1/go.mod h1:vBPRxb7qWfonEjDJR+ckM+1b1z2gXOogQjmTIPw15L4= +github.com/aws/aws-sdk-go-v2/service/iam v1.1.2 h1:ia0xRsYdXiV/QZLrs2Q8DU4F6jOj4qycfVtRbGVC0Fs= +github.com/aws/aws-sdk-go-v2/service/iam v1.1.2/go.mod h1:QfZ/D110t/xfKWiq74jxn6dJcJQw5BiHedJnQGvemuM= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0/go.mod h1:cZbnzYflIuoRkuKp4BB4q/R4xklYIwpLYs26vS3/Sac= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1 h1:q+3dVb1s3piv/Q/Ft0+OjU5iKItBRfCvU5wNLQUyIbA= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1/go.mod h1:zurGx7QI3Bk2OFwswSXl3PtJDdgD3QzjkfskiukJ2Mg= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.2 h1:GO0pL4QvQmA0fXJe3MHVO+emtg31MYq5/8sebSWgE6A= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.2/go.mod h1:bYl7lGFQQdHia3uMQH4p6ImnuOeDNeUoydoXM5x8Yzw= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.1/go.mod h1:PISaKWylTYAyruocNk4Lr9miOOJjOcVBd7twCPbydDk= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 h1:4AH9fFjUlVktQMznF+YN33aWNXaR4VgDXyP28qokJC0= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.3 h1:dST4y8pZKZdTPs4uwXmGCJmpycz1SHKmCSIhf3GqHEo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.3/go.mod h1:C50Z41fJaJ7WgaeeCulOGAU3q4+4se4B3uOPFdhBi2I= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.1 h1:U78TX1VNmbtb7Mea2LdXQXNtLJ6wWZ0yDJgEYeRX0wg= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.1/go.mod h1:IQF5AljyiiUz/CnLbe1FeE3hZZ/Kr87gJ1+/yEYel3I= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0 h1:6yUvdqgAAWoKAotui7AI4QvJASrjI6rkJtweSyjH6M4= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0/go.mod h1:q+4U7Z1uD6Iimym8uPQp0Ong/XICxInhzIKVSwn7bUU= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.1 h1:+WCVceRPiUsrui55mDByXOVremK1n3Hm8GnB4ZD3eco= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.1/go.mod h1:B+fb+BFbja6obFOHYmYE4iUMdej9aM2VGSpgdU1pn0M= github.com/aws/aws-sdk-go-v2/service/iot v1.1.1 h1:D7cWw8QZTkOEoF5uCnCUMYcNA1uo+yD+XuZXnZLcS+k= github.com/aws/aws-sdk-go-v2/service/iot v1.1.1/go.mod h1:LM7v3TvBIu+R+UZ4QKQzoDS94lzJ3XLLFLN4wsbnbVM= +github.com/aws/aws-sdk-go-v2/service/iot v1.1.2 h1:y43srDjpAphR0mETX5OlXZ8iQNz7uKJan3DPEoAlT2U= +github.com/aws/aws-sdk-go-v2/service/iot v1.1.2/go.mod h1:rQnyitMh5vyWlEHY0g/VzHw7UPT6c+CrFqvD1/udxYk= github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1 h1:FrFngpnVCdYW+lUljqqj9CLfY7xzRrGdY7/AkSOG5EE= github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1/go.mod h1:VqHOqKal4FUR6PfZDazxEcI/IBxyXOwOKKYzmUu4kC8= +github.com/aws/aws-sdk-go-v2/service/kafka v1.1.2 h1:eqrZIKfAq3MdMyvJqGi04BTKa0GaTb3tJ61vCxV9PZs= +github.com/aws/aws-sdk-go-v2/service/kafka v1.1.2/go.mod h1:nkoTpTd7ublMkC2cW6B8ENuzkqm2c+lPC8gUuANYcXc= github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1 h1:w6pCp3eYLGhIH+mkNVZkR2KdpMXulXLzkQhmXbHeHTE= github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1/go.mod h1:7GLbfWUWm4KRU04QHvxkZGIQDiUjLFD+nVZW8joexTo= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.2 h1:KUEcr+YtbaaZRcX3k76b0emV4eIYRyBS850rNpZmEOo= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.2/go.mod h1:eF+ZxxPk6z9suPUrY4tHB5ws7H/RrjBGhUaPc+fabmA= github.com/aws/aws-sdk-go-v2/service/kms v1.1.1 h1:rK1edW1dLtSGr1551ttHqQopajK4Pv9C4ez70dVMQaI= github.com/aws/aws-sdk-go-v2/service/kms v1.1.1/go.mod h1:6K5oOoDdnkW/h+Jv+xOA+tvgI6lwGBT9igkJGL1ypaY= +github.com/aws/aws-sdk-go-v2/service/kms v1.1.2 h1:6a+KQe3r7Wps9nJrasrEip0lWaC7W1gRUVFWZmewshs= +github.com/aws/aws-sdk-go-v2/service/kms v1.1.2/go.mod h1:+VMpFqykub/7QnLH3IGZNjBxv/r0SU/vNZAkYH0UMRU= github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1 h1:ptubVb1eLQgZh7U4i+k2vpf3PlL4ZoTmGdTj+VowqqM= github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1/go.mod h1:iSHLnnmJNKoAUdzKnUFh4rIGM3V58fxa+XCYtRpeFX8= +github.com/aws/aws-sdk-go-v2/service/lambda v1.1.2 h1:gWD2WWNzhjHxfOBnJfprdln0bfadZRVqN1XRqAaFjvs= +github.com/aws/aws-sdk-go-v2/service/lambda v1.1.2/go.mod h1:+VGeaIpjijz/BfgOYFORiXQ09YU63raqpMgUmnI/TTk= github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1 h1:lIftsFn6TsByMl+v32Y4ztGLIz/C4Rq7gat5AihCpdw= github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1/go.mod h1:9YtJbicAA2/uNt2VsIMWd6eapsIJn2o/0u0VJMAtrXo= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.2 h1:GF/6GXQm0Dc0IJ8FnPdsO+UOZbVUvAu5A1Q/k4k05kY= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.2/go.mod h1:AGGEf3XNZdEV/QAw1R7eoMrS+KQQG9st21uZDSLWmSM= github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1 h1:tl/58Fn+6E9VTEmconNpPqDWSZM+aeV1DjI/sahJYLQ= github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1/go.mod h1:gevnsX8qzzxtNcZoSab72+PNtrfFmgb1n1Z4GKbgkxU= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.2 h1:38pNoa80JakLLw+8MK2nzGKSr2nu3lF2BUR7hJEiwz0= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.2/go.mod h1:/En11w0nGq9cGyi7nT3/eDWYI09X80ehr1vSK/HXU1Y= github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1 h1:JPmFEmO4ycVquOwChmPJtC8Ct4oM1r3qEHwBdHZ4y3w= github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1/go.mod h1:goX7wNhH+gPuyYZX0AEJWm7cegEHyKnRLvZW4T4ZTgg= +github.com/aws/aws-sdk-go-v2/service/organizations v1.1.2 h1:1jPtLFCGgDp1HXr12J3F0eimT+u9905YPe3Mv7auGaE= +github.com/aws/aws-sdk-go-v2/service/organizations v1.1.2/go.mod h1:assIbGLsQCHk18EZqVmFBhaDFOOFMLimcP5m3xUPEY8= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1 h1:2yUiwjSgEdMO2zRvbFkMVB5+qIw33o+1uvsS+Vwt3LU= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1/go.mod h1:PdAF531U/qcXoTn4/Ay+RCTXAiim7Z4zPPiJMSY0P+w= +github.com/aws/aws-sdk-go-v2/service/qldb v1.1.2 h1:Q3VtZOtO3m1dI9lQoTo8sBKqL9BUgUsikmzzWKMOrOc= +github.com/aws/aws-sdk-go-v2/service/qldb v1.1.2/go.mod h1:SsP+mhnGVJ7QWlw69rF6Xyqdc+yb+djO6mywM9jxM9s= github.com/aws/aws-sdk-go-v2/service/rds v1.1.1 h1:bA0wFJBnOiEa5ZcNHt9vHlTjjjj/rFvCcQq7nqE36WI= github.com/aws/aws-sdk-go-v2/service/rds v1.1.1/go.mod h1:5KthKjThUjPkKAfTTtqEreCr5Lu5zYu78xfiSxo9KF4= +github.com/aws/aws-sdk-go-v2/service/rds v1.1.2 h1:Ar6MBK7h/v/DG7NPPhDP0r0GAt/hQ6TKirArSrOsiEY= +github.com/aws/aws-sdk-go-v2/service/rds v1.1.2/go.mod h1:Cmncpj0/MRcbTBZlVLA52uG6KLt7MS6AKLSOu8/2wyc= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1 h1:uDSFv0UmCcrrqhRrTlP9l/YTSESnZkZIHdJVdVDYY/4= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1/go.mod h1:21JHC8cArZT+J7hgQZgS+4kx8s9SdSFIqxOmiR+sGto= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.2 h1:/543Sv7iyf9v2emTiPreuQMw30cPww63p3qNAy3H424= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.2/go.mod h1:edifC1mludO1Kjyl28vavYSnKGl8uRT12d6DD8fBDzw= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 h1:cKr6St+CtC3/dl/rEBJvlk7A/IN5D5F02GNkGzfbtVU= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.2 h1:EbmfNO86YZtJq13e+/O3b53Lcc0joHa72YZmHglSpYY= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.2/go.mod h1:U5XfxTqYfmqJ0tg0nJEHJ0bUiBVNynZNHAp1iTjPLnE= github.com/aws/aws-sdk-go-v2/service/s3 v1.1.0 h1:d3PK2s3MB8ikznU/tChWoWQM2EVHo+4ZymURcl9WVE4= github.com/aws/aws-sdk-go-v2/service/s3 v1.1.0/go.mod h1:FunhqiuImyH0bxYm3xESmYTwq4dcESZQeaSAO4GjnTc= github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 h1:p20kkvl+DwV3wYsnLGcmsspBzWGD6EsWKi/W+09Z1NI= github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0/go.mod h1:nHAD0aOk81kN3xdNYzKg4g9JISKSwRdUUDEXOgIojf4= +github.com/aws/aws-sdk-go-v2/service/s3 v1.2.1 h1:3qn6YVXpOCK9seQ8ZilDyMrhpEUaZNaJG8SXNiCvk+c= +github.com/aws/aws-sdk-go-v2/service/s3 v1.2.1/go.mod h1:3xGOyhtPPD/WXJUljmb5+ZXhNyHa4h6wgL6mWOF6S0c= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 h1:tOZVE/wpwnCH6zMCvDi8WsuXLV1p5PG/WOhHu8LWphE= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1/go.mod h1:ytf+Mop8BTUFmWJSCI/U33FawS9A8UWwybOdNOXU6zE= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.2 h1:J9zvPLPGvytqa3YKGIzvehoJ621xViLT8Saohg6P73I= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.2/go.mod h1:dR9hUeYkCYyYoCpucS2v+vFsTJolTIY0tGMx9dU0ZnM= github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1 h1:80QYiUXqf6EHmxhW3wk9VGaGuem7GAeW2TcJj7hc0Do= github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1/go.mod h1:M/Eb/iVz5QLNeFxNP10Ww6uYarHvm8X1SaTc23NhoYw= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.2 h1:hg/3XqtxR8jkR4BIMQ1CNQlgH9qEOKx+W5cQX0b8hnU= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.2/go.mod h1:d/fZm2dIqyVVIcpKaA/2XNS25ptU5Gf/cxl97BlVLHo= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1 h1:5qx3KZq6WyQnX+gvLuU6sLBBWJulFrVn7sZoe+9GpJQ= github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1/go.mod h1:AxJdVkbAHbnhUhUP3cFgMGEe288M8+YDXW7gbcdqOtQ= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.2 h1:uy6kUZz0zMvGy/zbrMM3OheoJIAdta4XVgBwmBiPvOc= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.2/go.mod h1:VLwduJ5SSTiFygZ9C9nkAvZRrDwz41S6sE6QmAXbPdI= github.com/aws/aws-sdk-go-v2/service/ses v1.1.1 h1:ZCT1HdrWSIt8014g2Wia7B1SpytNh9EGZ/qKpZvRVgA= github.com/aws/aws-sdk-go-v2/service/ses v1.1.1/go.mod h1:U9bdibu41007uBclE2QUdURjHU6SzQKqxY5GKppL7gE= +github.com/aws/aws-sdk-go-v2/service/ses v1.1.2 h1:5n1KWIWnfW2wmM8EHleIMCkLy5iTNFQGb6d3ECtuChI= +github.com/aws/aws-sdk-go-v2/service/ses v1.1.2/go.mod h1:l3A3unXDxCFxL575zpT+oocWtgGWjjGlsMw1PbKoLjo= github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1 h1:GexTkfjidovrPhnvLrX2ggMo7pooiZJfZw/K1MOwe/o= github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1/go.mod h1:e1kcDzRmGL4UoKqMcyJT344yqMivOXIftV+O1H6fixY= +github.com/aws/aws-sdk-go-v2/service/sfn v1.1.2 h1:bw+seei8F3mYN8qO2XVclA2uB/Qwntg1/0OlUL3lVms= +github.com/aws/aws-sdk-go-v2/service/sfn v1.1.2/go.mod h1:LCvBsFAWOoJYpQL4JTV04yyVVR1jTReDBtIPvAknaw4= github.com/aws/aws-sdk-go-v2/service/sns v1.1.1 h1:5Js3R6coB5uI/h/Gua2Vm+uyuZrgmXs80zqtkOBumxk= github.com/aws/aws-sdk-go-v2/service/sns v1.1.1/go.mod h1:V2HdUZQcKhcF58AwYU78fkQ5Drfw3qAGMUd9o1uvrf8= +github.com/aws/aws-sdk-go-v2/service/sns v1.1.2 h1:1U/FujyBEkNwrvANUcZFuVnAQqy0EAUEGToso5Dcijs= +github.com/aws/aws-sdk-go-v2/service/sns v1.1.2/go.mod h1:/vvAGyo3/TG5CSrJQarIlwzjE6O/DjBIvJTRkpYkvwA= github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1 h1:T1fzWyfSgTNfFwpePwG9l0re3HWHprjUId/zy1Q4YvM= github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1/go.mod h1:vT8RRjBL5Z9KBZGGhjLcG6pngVLeq7MqySFsNdGFjSc= +github.com/aws/aws-sdk-go-v2/service/sqs v1.1.2 h1:sK05utknxyRwa9Tnu7b2dGir4kq9KXgi2moMmMoJiHc= +github.com/aws/aws-sdk-go-v2/service/sqs v1.1.2/go.mod h1:WE80cEEKvwrSokRKjw0rVRLpOMEmz/ohunPPz6RPFmE= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 h1:37QubsarExl5ZuCBlnRP+7l1tNwZPBSTqpTBrPH98RU= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.2 h1:9BnjX/ALn5uLo2DbgkwMpUkPL1VLQVBXcjZxqJBhf44= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.2/go.mod h1:5yU1oE3+CVYYLUsaHt2AVU3CJJZ6ER4pwsrRD1L2KSc= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 h1:TJoIfnIFubCX0ACVeJ0w46HEH5MwjwYN4iFhuYIhfIY= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.2 h1:7Kxqov7uQeP8WUEO0iHz3j9Bh0E1rJrn6cf/OGfcDds= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.2/go.mod h1:zu7rotIY9P4Aoc6ytqLP9jeYrECDHUODB5Gbp+BSHl8= github.com/aws/aws-sdk-go-v2/service/swf v1.1.1 h1:EStZ7gUWjg5++OVEZu3xjfIkD8hD4dGqV+9EwHtjfDo= github.com/aws/aws-sdk-go-v2/service/swf v1.1.1/go.mod h1:bbRKpQC4O12+BLlo6k67OyXWeJB8jWQwcmmKLrJgQVQ= +github.com/aws/aws-sdk-go-v2/service/swf v1.1.2 h1:TNCDYsj1WLfekK+WNabRV+PTOakCwzKE2OT0IaoKwNc= +github.com/aws/aws-sdk-go-v2/service/swf v1.1.2/go.mod h1:jhQ8uZUfrj9zoJ9GhZTj2eslbzwJTcPHfqom54yWkUo= github.com/aws/aws-sdk-go-v2/service/waf v1.1.1 h1:ttI5GZs4+1gUrjkO9ghNbu1TQ2jyO3DloZ8DRozl0VQ= github.com/aws/aws-sdk-go-v2/service/waf v1.1.1/go.mod h1:aSpFbfXuliA/KIQ6EfxYRXSJlnXpMfwUEPY7v5XtABw= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.2 h1:SNjFmhoWRtKK7zH88GZdmKnJ8O6SmjV3o7rxCOTkOtU= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.2/go.mod h1:W6aiAs0yNcOrWUPgAC09lDF7RzfMLCofr+5L5aXDUKU= github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1 h1:4UytI/MUBqd9Be5DgWXwWuzSRvbt6S4B5toSgbAZlEw= github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1/go.mod h1:rcc9EDUl/wpNAF+7AvKKh/r2fP6kpl8buDxwQ5Ep6ak= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.2 h1:dglAiqNnf/P862T7vsusss7uD94QKOaHgQzJp982bx4= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.2/go.mod h1:FLclarMnJVyBer8S2r1KRUnwFk9QeI3h0CGdNh6PDGk= github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1 h1:QXIL9UoGbmATmspJ8v+OMp4er7K/q8ZQ5O0/iyfAG2w= github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1/go.mod h1:/EpCu/KcalvPnsyM8zYgXCQ+dStC43HbtCO0hInHZP8= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.2 h1:KHw96rJ+BR7WTACzs4OgJXJeNPtxqxyzHvResNRMSpI= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.2/go.mod h1:g1xdhjBHekgd6TocTr7HaGXNwGwO4e2YoVw+RJz4i7M= github.com/aws/aws-sdk-go-v2/service/xray v1.1.1 h1:KdBCrnM+HnMW/On4O6EQ9OhiM3Fz0hrpvMhzIRY1/eY= github.com/aws/aws-sdk-go-v2/service/xray v1.1.1/go.mod h1:yXqbCaS1hC9CrShJsTrshudAvR/pspjeIRDbMpPRrC0= +github.com/aws/aws-sdk-go-v2/service/xray v1.1.2 h1:FEXG/2JtaWivdk30nXCJdJ6rPsd+cZIOAV62tpcOO8g= +github.com/aws/aws-sdk-go-v2/service/xray v1.1.2/go.mod h1:BrJBKpEUgTi0HcjOiUGGmhMG7XCEsuNnAr9ioc3cCxQ= github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.1.0 h1:D6CSsM3gdxaGaqXnPgOBCeL6Mophqzu7KJOu7zW78sU= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/aws/smithy-go v1.2.0 h1:0PoGBWXkXDIyVdPaZW9gMhaGzj3UOAgTdiVoHuuZAFA= +github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= From a8ad67596cd630ae5c4be661fc9c92a2c96214b6 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 14 Mar 2021 01:54:37 +0800 Subject: [PATCH 113/276] #793 #750 refreshing provider mapping after applied filters --- terraformutils/providers_mapping.go | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go index ce9fd3dd3d..8a90f62780 100644 --- a/terraformutils/providers_mapping.go +++ b/terraformutils/providers_mapping.go @@ -83,13 +83,28 @@ func (p *ProvidersMapping) ShuffleResources() []*Resource { } func (p *ProvidersMapping) ProcessResources() { - for provider := range p.Providers { - resources := provider.GetService().GetResources() - log.Printf("num of resources for service %s: %d", p.providerToService[provider], len(provider.GetService().GetResources())) - for i := range resources { - resource := resources[i] - p.Resources[&resource] = true - p.resourceToProvider[&resource] = provider + initialResources := p.resourceToProvider + if len(initialResources) > 0 { + p.Resources = map[*Resource]bool{} + p.resourceToProvider = map[*Resource]ProviderGenerator{} + for provider := range p.Providers { + resources := provider.GetService().GetResources() + log.Printf("Filtered number of resources for service %s: %d", p.providerToService[provider], len(provider.GetService().GetResources())) + for i := range resources { + resource := resources[i] + p.Resources[&resource] = true + p.resourceToProvider[&resource] = provider + } + } + } else { + for provider := range p.Providers { + resources := provider.GetService().GetResources() + log.Printf("Number of resources for service %s: %d", p.providerToService[provider], len(provider.GetService().GetResources())) + for i := range resources { + resource := resources[i] + p.Resources[&resource] = true + p.resourceToProvider[&resource] = provider + } } } } @@ -161,5 +176,6 @@ func (p *ProvidersMapping) CleanupProviders() { if err != nil { log.Printf("failed run PostConvertHook because of error %s", err) } + p.ProcessResources() } } From 523ccdbd20c43479d3ee1ac66b13f58d57b2d117 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Mar 2021 06:21:23 +0000 Subject: [PATCH 114/276] Bump github.com/IBM/networking-go-sdk from 0.12.1 to 0.13.0 Bumps [github.com/IBM/networking-go-sdk](https://github.com/IBM/networking-go-sdk) from 0.12.1 to 0.13.0. - [Release notes](https://github.com/IBM/networking-go-sdk/releases) - [Changelog](https://github.com/IBM/networking-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/IBM/networking-go-sdk/compare/v0.12.1...v0.13.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e7843ddf16..38a84178d0 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/IBM/go-sdk-core/v4 v4.9.0 github.com/IBM/ibm-cos-sdk-go v1.5.0 github.com/IBM/keyprotect-go-client v0.6.0 - github.com/IBM/networking-go-sdk v0.12.1 + github.com/IBM/networking-go-sdk v0.13.0 github.com/IBM/vpc-go-sdk v0.4.1 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 diff --git a/go.sum b/go.sum index 4422ddf376..f8bdfba2a1 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,8 @@ github.com/IBM/ibm-cos-sdk-go v1.5.0 h1:YCmAgsdtp/irQep5g+62OvjLNj35tMXLqTC5jQ+Y github.com/IBM/ibm-cos-sdk-go v1.5.0/go.mod h1:4mqv/ejW1PKW+Ij6ytU+W8j1UZeLmSEsR5K+flBaWMY= github.com/IBM/keyprotect-go-client v0.6.0 h1:jZExoYSaoQ5TrfEzPOmBLc1vJ0VWA0RfKC+Bx39IeGo= github.com/IBM/keyprotect-go-client v0.6.0/go.mod h1:SVr2ylV/fhSQPDiUjWirN9fsyWFCNNbt8GIT8hPJVjE= -github.com/IBM/networking-go-sdk v0.12.1 h1:GmzrRjvAyqKMfUPM8Y/R5dce0x5AXTqmseVZ3n7eZks= -github.com/IBM/networking-go-sdk v0.12.1/go.mod h1:lzkGBnw5glMB7Nxawfgu19MH4Tjy3KRQ2SYMYl2ck7o= +github.com/IBM/networking-go-sdk v0.13.0 h1:MKDL0c5Gnc6BT10lCS1S1pZVz71UmX4mJC4eXQqWwHE= +github.com/IBM/networking-go-sdk v0.13.0/go.mod h1:3/QnBTwCXAWoz98dw3z37UUfpkIwAwi8qDGntNt6F6A= github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= From 6de43d35280358c0ab55e39c8b31b2d0b2df9bc3 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 28 Mar 2021 00:16:04 +0800 Subject: [PATCH 115/276] #793 #750 fixed filters, importing only customer KMS resources --- cmd/import.go | 4 +- providers/aws/kms.go | 81 +++++++++++++++++++++++------ terraformutils/providers_mapping.go | 8 +-- 3 files changed, 70 insertions(+), 23 deletions(-) diff --git a/cmd/import.go b/cmd/import.go index f3331a14e5..c8a09bc1c8 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -149,7 +149,7 @@ func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, var wg sync.WaitGroup wg.Add(numOfResources) - failedServices := []string{} + var failedServices []string for _, service := range options.Resources { serviceProvider := providersMapping.AddServiceToProvider(service) @@ -165,7 +165,7 @@ func initAllServicesResources(providersMapping *terraformutils.ProvidersMapping, // remove providers that failed to init their service providersMapping.RemoveServices(failedServices) - providersMapping.ProcessResources() + providersMapping.ProcessResources(false) return nil } diff --git a/providers/aws/kms.go b/providers/aws/kms.go index 61f44e2f59..58cb6875f0 100644 --- a/providers/aws/kms.go +++ b/providers/aws/kms.go @@ -16,6 +16,7 @@ package aws import ( "context" + "log" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/kms" @@ -46,19 +47,30 @@ func (g *KmsGenerator) addKeys(client *kms.Client) error { p := kms.NewListKeysPaginator(client.ListKeysRequest(&kms.ListKeysInput{})) for p.Next(context.Background()) { for _, key := range p.CurrentPage().Keys { - resource := terraformutils.NewResource( - *key.KeyId, - *key.KeyId, - "aws_kms_key", - "aws", - map[string]string{ - "key_id": *key.KeyId, - }, - kmsAllowEmptyValues, - map[string]interface{}{}, - ) - resource.SlowQueryRequired = true - g.Resources = append(g.Resources, resource) + keyDescription, err := client.DescribeKeyRequest(&kms.DescribeKeyInput{ + KeyId: key.KeyId, + }).Send(context.TODO()) + if err != nil { + log.Println(err) + continue + } + if keyDescription.KeyMetadata.KeyManager == kms.KeyManagerTypeCustomer { + resource := terraformutils.NewResource( + *key.KeyId, + *key.KeyId, + "aws_kms_key", + "aws", + map[string]string{ + "key_id": *key.KeyId, + }, + kmsAllowEmptyValues, + map[string]interface{}{}, + ) + resource.SlowQueryRequired = true + g.Resources = append(g.Resources, resource) + + g.addGrants(key.KeyId, client) + } } } return p.Err() @@ -68,10 +80,43 @@ func (g *KmsGenerator) addAliases(client *kms.Client) error { p := kms.NewListAliasesPaginator(client.ListAliasesRequest(&kms.ListAliasesInput{})) for p.Next(context.Background()) { for _, alias := range p.CurrentPage().Aliases { + if alias.TargetKeyId == nil { + continue + } + keyDescription, err := client.DescribeKeyRequest(&kms.DescribeKeyInput{ + KeyId: alias.TargetKeyId, + }).Send(context.TODO()) + if err != nil { + log.Println(err) + continue + } + if keyDescription.KeyMetadata.KeyManager == kms.KeyManagerTypeCustomer { + resource := terraformutils.NewSimpleResource( + *alias.AliasName, + *alias.AliasName, + "aws_kms_alias", + "aws", + kmsAllowEmptyValues, + ) + resource.SlowQueryRequired = true + g.Resources = append(g.Resources, resource) + } + } + } + return p.Err() +} + +func (g *KmsGenerator) addGrants(keyId *string, client *kms.Client) { + p := kms.NewListGrantsPaginator(client.ListGrantsRequest(&kms.ListGrantsInput{ + KeyId: keyId, + })) + for p.Next(context.Background()) { + for _, grant := range p.CurrentPage().Grants { + grantId := *grant.KeyId + ":" + *grant.GrantId resource := terraformutils.NewSimpleResource( - *alias.AliasName, - *alias.AliasName, - "aws_kms_alias", + grantId, + grantId, + "aws_kms_grant", "aws", kmsAllowEmptyValues, ) @@ -79,5 +124,7 @@ func (g *KmsGenerator) addAliases(client *kms.Client) error { g.Resources = append(g.Resources, resource) } } - return p.Err() + if p.Err() != nil { + log.Println(p.Err()) + } } diff --git a/terraformutils/providers_mapping.go b/terraformutils/providers_mapping.go index 8a90f62780..c16d38c2f1 100644 --- a/terraformutils/providers_mapping.go +++ b/terraformutils/providers_mapping.go @@ -82,9 +82,9 @@ func (p *ProvidersMapping) ShuffleResources() []*Resource { return resources } -func (p *ProvidersMapping) ProcessResources() { +func (p *ProvidersMapping) ProcessResources(isCleanup bool) { initialResources := p.resourceToProvider - if len(initialResources) > 0 { + if isCleanup && len(initialResources) > 0 { p.Resources = map[*Resource]bool{} p.resourceToProvider = map[*Resource]ProviderGenerator{} for provider := range p.Providers { @@ -96,7 +96,7 @@ func (p *ProvidersMapping) ProcessResources() { p.resourceToProvider[&resource] = provider } } - } else { + } else if !isCleanup { for provider := range p.Providers { resources := provider.GetService().GetResources() log.Printf("Number of resources for service %s: %d", p.providerToService[provider], len(provider.GetService().GetResources())) @@ -176,6 +176,6 @@ func (p *ProvidersMapping) CleanupProviders() { if err != nil { log.Printf("failed run PostConvertHook because of error %s", err) } - p.ProcessResources() } + p.ProcessResources(true) } From d41f11b8306c5c603de74748f326c23ad4222d88 Mon Sep 17 00:00:00 2001 From: He Guimin Date: Mon, 29 Mar 2021 23:03:58 +0800 Subject: [PATCH 116/276] alicloud: fixes the nil pointer when importing the alicloud resources and supports global region --- providers/alicloud/alicloud_provider.go | 36 ++++++------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/providers/alicloud/alicloud_provider.go b/providers/alicloud/alicloud_provider.go index 2dbd6b9265..da20a2ebe9 100644 --- a/providers/alicloud/alicloud_provider.go +++ b/providers/alicloud/alicloud_provider.go @@ -29,6 +29,8 @@ type AliCloudProvider struct { //nolint profile string } +const GlobalRegion = "alicloud-global" + // GetConfig Converts json config to go-cty func (p *AliCloudProvider) GetConfig() cty.Value { profile := p.profile @@ -72,37 +74,15 @@ func (p AliCloudProvider) GetResourceConnections() map[string]map[string][]strin // GetProviderData Used for generated HCL2 for the provider func (p AliCloudProvider) GetProviderData(arg ...string) map[string]interface{} { - args := p.Service.GetArgs() - profile := args["profile"].(string) - config, err := LoadConfigFromProfile(profile) - if err != nil { - fmt.Println("ERROR:", err) - } - - region := p.region - if region == "" { - region = config.RegionID - } - - if config.RAMRoleArn != "" { - return map[string]interface{}{ - "provider": map[string]interface{}{ - "alicloud": map[string]interface{}{ - "region": region, - "profile": profile, - "assume_role": map[string]interface{}{ - "role_arn": config.RAMRoleArn, - }, - }, - }, - } + alicloudConfig := map[string]interface{}{} + if p.region == GlobalRegion { + alicloudConfig["region"] = "cn-hangzhou" + } else { + alicloudConfig["region"] = p.region } return map[string]interface{}{ "provider": map[string]interface{}{ - "alicloud": map[string]interface{}{ - "region": region, - "profile": profile, - }, + "alicloud": alicloudConfig, }, } } From dd4d630598f1a22e3b7e830fab2674b4121f7745 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Wed, 30 Dec 2020 20:19:57 -0800 Subject: [PATCH 117/276] Add the start of the xenorchestra implementation (cherry picked from commit 03999bce04c47c95957b2d569307c3ab9e80763f) --- README.md | 2 + cmd/provider_cmd_xenorchestra.go | 44 +++++++++ cmd/root.go | 2 + providers/xenorchestra/acls.go | 48 ++++++++++ .../xenorchestra/xenorchestra_provider.go | 91 +++++++++++++++++++ .../xenorchestra/xenorchestra_service.go | 33 +++++++ 6 files changed, 220 insertions(+) create mode 100644 cmd/provider_cmd_xenorchestra.go create mode 100644 providers/xenorchestra/acls.go create mode 100644 providers/xenorchestra/xenorchestra_provider.go create mode 100644 providers/xenorchestra/xenorchestra_service.go diff --git a/README.md b/README.md index 16d6d8ddef..ad55b874e3 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [Logz.io](#use-with-logzio) * [Commercetools](#use-with-commercetools) * [Mikrotik](#use-with-mikrotik) + * [Xen Orchestra](#use-with-xenorchestra) * [GmailFilter](#use-with-gmailfilter) - [Contributing](#contributing) - [Developing](#developing) @@ -264,6 +265,7 @@ Links to download Terraform Providers: * Logz.io provider >=1.1.1 - [here](https://github.com/jonboydell/logzio_terraform_provider/) * Commercetools provider >= 0.21.0 - [here](https://github.com/labd/terraform-provider-commercetools) * Mikrotik provider >= 0.2.2 - [here](https://github.com/ddelnano/terraform-provider-mikrotik) + * Xen Orchestra provider >= 0.XX.XX - [here](https://github.com/ddelnano/terraform-provider-xenorchestra) * GmailFilter provider >= 1.0.1 - [here](https://github.com/yamamoto-febc/terraform-provider-gmailfilter) Information on provider plugins: diff --git a/cmd/provider_cmd_xenorchestra.go b/cmd/provider_cmd_xenorchestra.go new file mode 100644 index 0000000000..b38c90ab6f --- /dev/null +++ b/cmd/provider_cmd_xenorchestra.go @@ -0,0 +1,44 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + xenorchestra_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/xenorchestra" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdXenorchestraImporter(options ImportOptions) *cobra.Command { + cmd := &cobra.Command{ + Use: "xenorchestra", + Short: "Import current state to Terraform configuration from Xen Orchestra", + Long: "Import current state to Terraform configuration from Xen Orchestra", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newXenorchestraProvider() + err := Import(provider, options, []string{}) + if err != nil { + return err + } + return nil + }, + } + + cmd.AddCommand(listCmd(newXenorchestraProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "instance", "acl=name1:name2:name3") + return cmd +} + +func newXenorchestraProvider() terraformutils.ProviderGenerator { + return &xenorchestra_terraforming.XenorchestraProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index c22ad4bc0d..74eb758dc0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -70,6 +70,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdLogzioImporter, newCmdCommercetoolsImporter, newCmdMikrotikImporter, + newCmdXenorchestraImporter, newCmdGmailfilterImporter, } } @@ -108,6 +109,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { newLogzioProvider, newCommercetoolsProvider, newMikrotikProvider, + newXenorchestraProvider, newGmailfilterProvider, } { list[providerGen().GetName()] = providerGen diff --git a/providers/xenorchestra/acls.go b/providers/xenorchestra/acls.go new file mode 100644 index 0000000000..0ea57a5c7a --- /dev/null +++ b/providers/xenorchestra/acls.go @@ -0,0 +1,48 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package xenorchestra + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/ddelnano/terraform-provider-xenorchestra/client" +) + +type AclGenerator struct { + XenorchestraService +} + +func (g AclGenerator) createResources(acls []client.Acl) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, acl := range acls { + resourceName := acl.Id + resources = append(resources, terraformutils.NewSimpleResource( + acl.Id, + resourceName, + "xenorchestra_acl", + "xenorchestra", + []string{})) + } + return resources +} + +func (g *AclGenerator) InitResources() error { + client := g.generateClient() + acls, err := client.GetAcls() + + if err != nil { + return err + } + g.Resources = g.createResources(acls) + return nil +} diff --git a/providers/xenorchestra/xenorchestra_provider.go b/providers/xenorchestra/xenorchestra_provider.go new file mode 100644 index 0000000000..9bc8d9f7ed --- /dev/null +++ b/providers/xenorchestra/xenorchestra_provider.go @@ -0,0 +1,91 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package xenorchestra + +import ( + "errors" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type XenorchestraProvider struct { //nolint + terraformutils.Provider + url string + user string + password string +} + +func (p *XenorchestraProvider) Init(args []string) error { + if os.Getenv("XOA_URL") == "" { + return errors.New("set XOA_URL env var") + } + p.url = os.Getenv("XOA_URL") + + if os.Getenv("XOA_USER") == "" { + return errors.New("set XOA_USER env var") + } + p.user = os.Getenv("XOA_USER") + + if os.Getenv("XOA_PASSWORD") == "" { + return errors.New("set XOA_PASSWORD env var") + } + p.password = os.Getenv("XOA_PASSWORD") + + return nil +} + +func (p *XenorchestraProvider) GetName() string { + return "xenorchestra" +} + +func (p *XenorchestraProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{ + "provider": map[string]interface{}{ + "xenorchestra": map[string]interface{}{ + "url": p.url, + "username": p.user, + "password": p.password, + }, + }, + } +} + +func (XenorchestraProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} + +func (p *XenorchestraProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "acl": &AclGenerator{}, + } +} + +func (p *XenorchestraProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New("xenorchestra: " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "url": p.url, + "username": p.user, + "password": p.password, + }) + return nil +} diff --git a/providers/xenorchestra/xenorchestra_service.go b/providers/xenorchestra/xenorchestra_service.go new file mode 100644 index 0000000000..fac2c0a931 --- /dev/null +++ b/providers/xenorchestra/xenorchestra_service.go @@ -0,0 +1,33 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package xenorchestra + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/ddelnano/terraform-provider-xenorchestra/client" +) + +type XenorchestraService struct { //nolint + terraformutils.Service +} + +func (m *XenorchestraService) generateClient() *client.Client { + config := client.Config{ + Url: m.Args["url"].(string), + Username: m.Args["username"].(string), + Password: m.Args["password"].(string), + } + client, _ := client.NewClient(config) + return client +} From 60eeae08bfa452db6b3eb06c4f72a32d26a16a58 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Wed, 31 Mar 2021 21:54:58 -0700 Subject: [PATCH 118/276] Add the xenorchestra_resource_set resource to terraformer --- providers/xenorchestra/resource_sets.go | 48 +++++++++++++++++++ .../xenorchestra/xenorchestra_provider.go | 3 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 providers/xenorchestra/resource_sets.go diff --git a/providers/xenorchestra/resource_sets.go b/providers/xenorchestra/resource_sets.go new file mode 100644 index 0000000000..86a62524ac --- /dev/null +++ b/providers/xenorchestra/resource_sets.go @@ -0,0 +1,48 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package xenorchestra + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/ddelnano/terraform-provider-xenorchestra/client" +) + +type ResourceSetGenerator struct { + XenorchestraService +} + +func (g ResourceSetGenerator) createResources(acls []client.ResourceSet) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, acl := range acls { + resourceName := acl.Id + resources = append(resources, terraformutils.NewSimpleResource( + acl.Id, + resourceName, + "xenorchestra_resource_set", + "xenorchestra", + []string{})) + } + return resources +} + +func (g *ResourceSetGenerator) InitResources() error { + client := g.generateClient() + acls, err := client.GetResourceSets() + + if err != nil { + return err + } + g.Resources = g.createResources(acls) + return nil +} diff --git a/providers/xenorchestra/xenorchestra_provider.go b/providers/xenorchestra/xenorchestra_provider.go index 9bc8d9f7ed..024264652d 100644 --- a/providers/xenorchestra/xenorchestra_provider.go +++ b/providers/xenorchestra/xenorchestra_provider.go @@ -69,7 +69,8 @@ func (XenorchestraProvider) GetResourceConnections() map[string]map[string][]str func (p *XenorchestraProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "acl": &AclGenerator{}, + "acl": &AclGenerator{}, + "resource_set": &ResourceSetGenerator{}, } } From 628d0bb4c2d512e33dad392b6aa3749a54c1f388 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Wed, 31 Mar 2021 22:06:12 -0700 Subject: [PATCH 119/276] Add github.com/ddelnano/terraform-provider-xenorchestra/client module to go.mod and go.sum --- go.mod | 1 + go.sum | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/go.mod b/go.mod index 38a84178d0..9199429f2e 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,7 @@ require ( github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c + github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1 // indirect github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.57.0 diff --git a/go.sum b/go.sum index f8bdfba2a1..d8c97c8b9c 100644 --- a/go.sum +++ b/go.sum @@ -231,6 +231,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315/go.mod h1:QXiCu8WKyFL/X+NMCmtxoCq/jSOb54R4iDXdjsaYEWA= github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c h1:/y0rm2Eg2xe4/qkZp7jNrg/hhAt9AEPjwuimkTY6938= github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c/go.mod h1:GfNYCa+c8fEK3kDRjxMeQiEdPyeORDK8Zi7ykJBA0/w= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1 h1:P0a6ZVjbOqzOYqsSSWWF19dHaxX2AuHcv9kQafNVC+Y= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 h1:ujQ4DKs+MqFWy/hoLAU4Ey/nQhqJ6pXyocMDbVJ4qSw= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dghubble/sling v1.1.0 h1:DLu20Bq2qsB9cI5Hldaxj+TMPEaPpPE8IR2kvD22Atg= @@ -446,6 +448,8 @@ github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -803,6 +807,8 @@ github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:s github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 h1:j3HKQAXXj5vV3oHyg9pjK3uIM4bidukvv+tR2iJCvFA= +github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750/go.mod h1:ZafdZgk/axhT1cvZAPOhw+95nz2I/Ra5qMlU4gTRwIo= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= From 7578ed1c5ba4f46056898e6aa06d2221c8ffa13a Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Wed, 31 Mar 2021 22:12:40 -0700 Subject: [PATCH 120/276] Update README to include more information about the xenorchestra integration --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad55b874e3..77d10fb47f 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ Links to download Terraform Providers: * Logz.io provider >=1.1.1 - [here](https://github.com/jonboydell/logzio_terraform_provider/) * Commercetools provider >= 0.21.0 - [here](https://github.com/labd/terraform-provider-commercetools) * Mikrotik provider >= 0.2.2 - [here](https://github.com/ddelnano/terraform-provider-mikrotik) - * Xen Orchestra provider >= 0.XX.XX - [here](https://github.com/ddelnano/terraform-provider-xenorchestra) + * Xen Orchestra provider >= 0.18.0 - [here](https://github.com/ddelnano/terraform-provider-xenorchestra) * GmailFilter provider >= 1.0.1 - [here](https://github.com/yamamoto-febc/terraform-provider-gmailfilter) Information on provider plugins: @@ -1714,7 +1714,7 @@ List of supported [commercetools](https://commercetools.com/de/) resources: ### Use with [Mikrotik](https://wiki.mikrotik.com/wiki/Manual:TOC) -This provider uses the [terraform-provider-mikrotik](https://github.com/ddelnano/terraform-provider-mikrotik). The terraformer provider was build by [Dom Del Nano](https://github.com/ddelnano). +This provider uses the [terraform-provider-mikrotik](https://github.com/ddelnano/terraform-provider-mikrotik). The terraformer provider was built by [Dom Del Nano](https://github.com/ddelnano). Example: @@ -1731,6 +1731,23 @@ List of supported mikrotik resources: * `mikrotik_dhcp_lease` +### Use with [Xen Orchestra](https://xen-orchestra.com/) + +This provider uses the [terraform-provider-xenorchestra](https://github.com/ddelnano/terraform-provider-xenorchestra). The terraformer provider was built by [Dom Del Nano](https://github.com/ddelnano) on behalf of [Vates SAS](https://vates.fr/) who is sponsoring Dom to work on the project. + +Example: + +``` +## Warning! You should not expose your xenorchestra creds through your bash history. Export them to your shell in a safe way when doing this for real! + +XOA_URL=ws://your-xenorchestra-domain XOA_USER=username XOA_PASSWORD=password terraformer import xenorchestra -r=acl +``` + +List of supported xenorchestra resources: + +* `xenorchestra_acl` +* `xenorchestra_resource_set` + ### Use with GmailFilter From c075ae96bc7214d0db1863dd71cd8c781ef02825 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Wed, 31 Mar 2021 23:21:22 -0700 Subject: [PATCH 121/276] Upgrade the mikrotik dependency to the new mikrotik client module and remove the transitive terraform-plugin-sdk dependency --- go.mod | 3 ++- go.sum | 63 +++++----------------------------------------------------- 2 files changed, 7 insertions(+), 59 deletions(-) diff --git a/go.mod b/go.mod index 38a84178d0..3a5a4a79c0 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect - github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c + github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.57.0 @@ -47,6 +47,7 @@ require ( github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d github.com/linode/linodego v0.24.1 github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 + github.com/nicksnyder/go-i18n v1.10.1 // indirect github.com/ns1/ns1-go v2.4.0+incompatible github.com/paultyng/go-newrelic/v4 v4.10.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index f8bdfba2a1..6349eb9947 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -9fans.net/go v0.0.0-20181112161441-237454027057/go.mod h1:diCsxrliIURU9xsYtjCp5AbpQKqdhKmf0ujWDUSkfoY= -9fans.net/go v0.0.2/go.mod h1:lfPdxjq9v8pVQXUMBCx5EO5oLXWQFlKRQgs1kEkjoIM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -18,7 +16,6 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0 h1:kpgPA77kSSbjSs+fWHkPTxQ6J5Z2Qkruo5jfXEkHxNQ= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.77.0 h1:qA5V5+uQf6Mgr+tmFI8UT3D/ELyhIYkPwNGao/3Y+sQ= cloud.google.com/go v0.77.0/go.mod h1:R8fYSLIilC247Iu8WS2OGHw1E/Ufn7Pd7HiDjTqiURs= @@ -131,10 +128,8 @@ github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0 github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 h1:fJ4XPqxuZfm11zauw9XX7c30P8xwDyucdWu8H6Htrxs= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/gometalinter v3.0.0+incompatible/go.mod h1:qfIpQGGz3d+NmgyPBqv+LSh50emm1pt72EtcX2vKYQk= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 h1:oUQYOKpPm4h7shYEdPJ0T8EzVpu7Zz34qTof9XaMDxY= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295/go.mod h1:mNZkuqaeM5UCiAdkV4r+lrheu8Q5fe/487bRFrGYZ8A= @@ -167,7 +162,6 @@ github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGL github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= @@ -188,7 +182,6 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -228,9 +221,8 @@ github.com/cucumber/messages-go/v12 v12.0.0/go.mod h1:5zuJu21U6rB+BBqyGoQr839a4h github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315/go.mod h1:QXiCu8WKyFL/X+NMCmtxoCq/jSOb54R4iDXdjsaYEWA= -github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c h1:/y0rm2Eg2xe4/qkZp7jNrg/hhAt9AEPjwuimkTY6938= -github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c/go.mod h1:GfNYCa+c8fEK3kDRjxMeQiEdPyeORDK8Zi7ykJBA0/w= +github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 h1:AMuZg5VR0/QGCqFpO4CUwAhZc4tbgDHpM8c4SvMt2yM= +github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4/go.mod h1:JrRtRlTHCkdIr7OTHCAonKS2yWwmwdqnvf+JEy+OYAA= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 h1:ujQ4DKs+MqFWy/hoLAU4Ey/nQhqJ6pXyocMDbVJ4qSw= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dghubble/sling v1.1.0 h1:DLu20Bq2qsB9cI5Hldaxj+TMPEaPpPE8IR2kvD22Atg= @@ -262,13 +254,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fastly/go-fastly v1.18.0 h1:fyVq/142VTFz5ZkNE5d57K+NkTmtwxt2K2Mh5sV5scg= github.com/fastly/go-fastly v1.18.0/go.mod h1:fwYSSnZ6zEClwRS65T0f57Yh83Tc4gL12GgttQwJZfA= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/gomodifytags v1.4.0/go.mod h1:I1Y8xh3aVI37vceIxNEr549I/TnDN1wuVPZM7NUR7kA= -github.com/fatih/motion v1.1.0/go.mod h1:go/hyCtg5rx6FjoC0o+iInMzlY2u7OeHayKYDY6Gbmk= -github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= @@ -279,7 +266,6 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj9zFpCNE+UDefwwFRijKjzvHNCM= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655 h1:hKQ7ba/nVgQ0sGq8KBWJ7hdm0CEN48AlIYjBmfzCQzQ= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= @@ -316,8 +302,8 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-resty/resty/v2 v2.1.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= -github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221 h1:HJ7/f/eGwr7jlZl0lsnNT38/mKcSluFGTc5uLHn4pwI= -github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= +github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730 h1:EuqwWLv/LPPjhvFqkeD2bz+FOlvw2DjvDI7vK8GVeyY= +github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -429,7 +415,6 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= @@ -458,7 +443,6 @@ github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6 github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.10.0 h1:KhjDnQhCqEMKlt4yH00MCevJQPJ6LkHFdSveXINO6vE= @@ -481,7 +465,6 @@ github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mo github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= @@ -517,11 +500,8 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= -github.com/hashicorp/hcl2 v0.0.0-20190909202536-66c59f909e25/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= +github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= -github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 h1:T1Q6ag9tCwun16AW+XK3tAql24P4uTGUMIn1/92WsQQ= -github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= @@ -530,11 +510,9 @@ github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZa github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/terraform v0.12.29 h1:UkuApT6qh6KONIT1Jz7HoV8f4B+x71db3bmGcBzjBB0= github.com/hashicorp/terraform v0.12.29/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhkKZNlHPcr4P55U= -github.com/hashicorp/terraform-config-inspect v0.0.0-20190821133035-82a99dc22ef4/go.mod h1:JDmizlhaP5P0rYTTZB0reDMefAiJyfWPEtugV4in1oI= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-plugin-sdk v1.0.0/go.mod h1:NuwtLpEpPsFaKJPJNGtMcn9vlhe6Ofe+Y6NqXhJgV2M= github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2bHu4fjRB1H6Ag4U= github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= @@ -560,7 +538,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570/go.mod h1:4X9u5iNUePRrRDdwjok6skjlQBXTcNfWa4C3uS1+5SQ= github.com/jarcoal/httpmock v1.0.5 h1:cHtVEcTxRSX4J0je7mWPfc9BpDpqzXSJ5HbymZmyHck= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -576,7 +553,6 @@ github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0 github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= github.com/jonboydell/logzio_client v1.2.0/go.mod h1:ZXJYF4M9/chuG+4fQDS9BN6CqXqokUjtQOjdMqzGC/Y= -github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7/go.mod h1:t4Tr0tn92eq5ISef4cS5plFAMYAqZlAXtgUcKE6y8nw= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -585,7 +561,6 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ 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 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jstemmer/gotags v1.4.1/go.mod h1:b6J3X0bsLbR4C5SgSx3V3KjuWTtmRzcmWPbTkWZ49PA= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -598,11 +573,9 @@ github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZsc github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/asmfmt v1.2.1/go.mod h1:RAoUvqkWr2rUa2I19qKMEVZQe4BVtcHGTMCUOcCU2Lg= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91/go.mod h1:C2tFh8w3I6i4lnUJfoBx2Hwku3mgu4wPNTtUNp1i5KI= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -704,7 +677,6 @@ github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= @@ -712,7 +684,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= -github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836/go.mod h1:6Q8/OMaaKAgTX7/jt2bOXVDrm1eJhoNd+iwzghR7jvs= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -723,7 +694,6 @@ github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRo github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= @@ -731,14 +701,12 @@ github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -781,7 +749,6 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/godef v1.1.2/go.mod h1:WtY9A/ovuQ+UakAJ1/CEqwwulX/WJjb2kgkokCHi/GY= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -830,7 +797,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -889,7 +855,6 @@ github.com/zclconf/go-cty v1.7.1 h1:AvsC01GMhMLFL8CgEYdHGM+yLnnDOwhPAYcgTkeF0Gw= github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= -github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a/go.mod h1:ofmGw6LrMypycsiWcyug6516EXpIxSbZ+uI9ppGypfY= github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -966,7 +931,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -985,7 +949,6 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -993,7 +956,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1029,7 +991,6 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 h1:BaN3BAqnopnKjvl+15DYP6LLrbBHfbfmlFYzmFj/Q9Q= golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -1042,7 +1003,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1102,7 +1062,6 @@ golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091 h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= @@ -1113,7 +1072,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1125,10 +1083,8 @@ golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjTo golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181207195948-8634b1ecd393/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1137,7 +1093,6 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190408220357-e5b8258f4918/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1166,13 +1121,11 @@ golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200226224502-204d844ad48d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200501155019-2658dc0cadb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1190,7 +1143,6 @@ golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= @@ -1226,7 +1178,6 @@ google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQW google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0 h1:l2Nfbl2GPXdWorv+dT2XfinX2jOOw4zv1VhLstx+6rE= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0 h1:uWrpz12dpVPn7cojP82mk02XDgTJLDPc2KbVTxrWb4A= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= @@ -1277,7 +1228,6 @@ google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc h1:BgQmMjmd7K1zov8j8lYULHW0WnmBGUIMp6+VDwlGErc= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d h1:Edhcm0CKDPLQIecHCp5Iz57Lo7MfT6zUFBAlocmOjcY= @@ -1301,7 +1251,6 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= @@ -1319,7 +1268,6 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba gopkg.in/DataDog/dd-trace-go.v1 v1.24.1 h1:CGQIcKZxAsFtMTUiXw0TxBWwj+l+b2bS2V8l1bIsfk4= gopkg.in/DataDog/dd-trace-go.v1 v1.24.1/go.mod h1:DVp8HmDh8PuTu2Z0fVVlBsyWaC++fzwVCaGWylTe3tg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780/go.mod h1:3HH7i1SgMqlzxCcBmUHW657sD4Kvv9sC3HpL3YukzwA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1365,7 +1313,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= From 040f7c6dc0bab4087ef461f8d7446cbc27cb48e9 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 1 Apr 2021 00:11:47 -0700 Subject: [PATCH 122/276] Upgrade the github.com/ddelnano/terraform-provider-xenorchestra/client module to the official v0.18.0 release (cherry picked from commit 7c3ba5a16b613dea4f9c96d275a00604f02f8ae3) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 9199429f2e..cdfe1401c9 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c - github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1 // indirect + github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef // indirect github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.57.0 diff --git a/go.sum b/go.sum index d8c97c8b9c..4f7cf92837 100644 --- a/go.sum +++ b/go.sum @@ -231,6 +231,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315/go.mod h1:QXiCu8WKyFL/X+NMCmtxoCq/jSOb54R4iDXdjsaYEWA= github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c h1:/y0rm2Eg2xe4/qkZp7jNrg/hhAt9AEPjwuimkTY6938= github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c/go.mod h1:GfNYCa+c8fEK3kDRjxMeQiEdPyeORDK8Zi7ykJBA0/w= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef h1:q/XC0MjIz8cl/NtyKKewDns6mNd2cUzLQ5Xnh+jGoRg= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1 h1:P0a6ZVjbOqzOYqsSSWWF19dHaxX2AuHcv9kQafNVC+Y= github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 h1:ujQ4DKs+MqFWy/hoLAU4Ey/nQhqJ6pXyocMDbVJ4qSw= From eff99a2ecdd66dcb546e43af2965e7841dc78ea1 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 1 Apr 2021 12:54:08 -0700 Subject: [PATCH 123/276] Update mikrotik client creation to match new method signature --- providers/mikrotik/mikrotik_provider.go | 36 +++++++++---------------- providers/mikrotik/mikrotik_service.go | 4 +-- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/providers/mikrotik/mikrotik_provider.go b/providers/mikrotik/mikrotik_provider.go index 441580b83d..5365c540a9 100644 --- a/providers/mikrotik/mikrotik_provider.go +++ b/providers/mikrotik/mikrotik_provider.go @@ -16,34 +16,19 @@ package mikrotik import ( "errors" - "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/ddelnano/terraform-provider-mikrotik/client" ) type MikrotikProvider struct { //nolint terraformutils.Provider - host string - user string - password string + client.Mikrotik } func (p *MikrotikProvider) Init(args []string) error { - if os.Getenv("MIKROTIK_HOST") == "" { - return errors.New("set MIKROTIK_HOST env var") - } - p.host = os.Getenv("MIKROTIK_HOST") - - if os.Getenv("MIKROTIK_USER") == "" { - return errors.New("set MIKROTIK_USER env var") - } - p.user = os.Getenv("MIKROTIK_USER") - - if os.Getenv("MIKROTIK_PASSWORD") == "" { - return errors.New("set MIKROTIK_PASSWORD env var") - } - p.password = os.Getenv("MIKROTIK_PASSWORD") - + // The mikrotik provider gets its credentials through environment variables + // and therefore nothing needs to be done here return nil } @@ -55,8 +40,8 @@ func (p *MikrotikProvider) GetProviderData(arg ...string) map[string]interface{} return map[string]interface{}{ "provider": map[string]interface{}{ "mikrotik": map[string]interface{}{ - "host": p.host, - "user": p.user, + "host": p.Host, + "user": p.Username, }, }, } @@ -82,9 +67,12 @@ func (p *MikrotikProvider) InitService(serviceName string, verbose bool) error { p.Service.SetVerbose(verbose) p.Service.SetProviderName(p.GetName()) p.Service.SetArgs(map[string]interface{}{ - "host": p.host, - "user": p.user, - "password": p.password, + "host": p.Host, + "user": p.Username, + "password": p.Password, + "tls": p.TLS, + "ca_certificate": p.CA, + "insecure": p.Insecure, }) return nil } diff --git a/providers/mikrotik/mikrotik_service.go b/providers/mikrotik/mikrotik_service.go index b98d371ce8..18232a49d5 100644 --- a/providers/mikrotik/mikrotik_service.go +++ b/providers/mikrotik/mikrotik_service.go @@ -24,8 +24,6 @@ type MikrotikService struct { //nolint func (m *MikrotikService) generateClient() client.Mikrotik { return client.NewClient( - m.Args["host"].(string), - m.Args["user"].(string), - m.Args["password"].(string), + client.GetConfigFromEnv(), ) } From a603fc5566d9036f42f1c04869432755a26bd94d Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Sat, 3 Apr 2021 02:57:14 -0500 Subject: [PATCH 124/276] Sets up command for Equinix Metal provider --- cmd/provider_cmd_equinixmetal.go | 46 ++++++ cmd/root.go | 2 + go.mod | 1 + go.sum | 235 +++++++++++++++++++++++++++++++ 4 files changed, 284 insertions(+) create mode 100644 cmd/provider_cmd_equinixmetal.go diff --git a/cmd/provider_cmd_equinixmetal.go b/cmd/provider_cmd_equinixmetal.go new file mode 100644 index 0000000000..8ce4195d8c --- /dev/null +++ b/cmd/provider_cmd_equinixmetal.go @@ -0,0 +1,46 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + equinixmetal_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/equinixmetal" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdEquinixMetalImporter(options ImportOptions) *cobra.Command { + cmd := &cobra.Command{ + Use: "metal", + Short: "Import current state to Terraform configuration from Equinix Metal", + Long: "Import current state to Terraform configuration from Equinix Metal", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newEquinixMetalProvider() + err := Import(provider, options, []string{}) + if err != nil { + return err + } + return nil + }, + } + + cmd.AddCommand(listCmd(newEquinixMetalProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "project,device", "project=name1:name2:name3") + + return cmd +} + +func newEquinixMetalProvider() terraformutils.ProviderGenerator { + return &equinixmetal_terraforming.EquinixMetalProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index c22ad4bc0d..338454cf6a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -46,6 +46,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdIbmImporter, // Cloud newCmdDigitalOceanImporter, + newCmdEquinixMetalImporter, newCmdFastlyImporter, newCmdHerokuImporter, newCmdLinodeImporter, @@ -85,6 +86,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { newIbmProvider, // Cloud newDigitalOceanProvider, + newEquinixMetalProvider, newFastlyProvider, newHerokuProvider, newLinodeProvider, diff --git a/go.mod b/go.mod index 38a84178d0..5da181b7b7 100644 --- a/go.mod +++ b/go.mod @@ -48,6 +48,7 @@ require ( github.com/linode/linodego v0.24.1 github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/ns1/ns1-go v2.4.0+incompatible + github.com/packethost/packngo v0.9.0 github.com/paultyng/go-newrelic/v4 v4.10.0 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.1.1 diff --git a/go.sum b/go.sum index f8bdfba2a1..3502fac531 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ 9fans.net/go v0.0.0-20181112161441-237454027057/go.mod h1:diCsxrliIURU9xsYtjCp5AbpQKqdhKmf0ujWDUSkfoY= +9fans.net/go v0.0.2 h1:RYM6lWITV8oADrwLfdzxmt8ucfW6UtP9v1jg4qAbqts= 9fans.net/go v0.0.2/go.mod h1:lfPdxjq9v8pVQXUMBCx5EO5oLXWQFlKRQgs1kEkjoIM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -27,15 +28,19 @@ cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNF cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0 h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/logging v1.1.2 h1:KNALX0NZn8UJhqKnqoHxhMqyoZfBZoh5wF7CQJZ5XrU= cloud.google.com/go/logging v1.1.2/go.mod h1:KrljuAHIw631j9+QXsnq9vDwsrwmdxfGpivMR68M7DY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= @@ -44,6 +49,7 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.12.0 h1:4y3gHptW1EHVtcPAVE0eBBlFuGqEejTTG3KdIE0lUX4= cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= @@ -88,10 +94,13 @@ github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9QpaFc/z2k0mcs7ZVnCRREeZU= github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= @@ -114,34 +123,49 @@ github.com/IBM/networking-go-sdk v0.13.0 h1:MKDL0c5Gnc6BT10lCS1S1pZVz71UmX4mJC4e github.com/IBM/networking-go-sdk v0.13.0/go.mod h1:3/QnBTwCXAWoz98dw3z37UUfpkIwAwi8qDGntNt6F6A= github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409 h1:DTQ/38ao/CfXsrK0cSAL+h4R/u0VVvfWLZEOlLwEROI= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= +github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KMJuWmfCkcxl09JwdlqwDZZ6U14= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 h1:fJ4XPqxuZfm11zauw9XX7c30P8xwDyucdWu8H6Htrxs= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/gometalinter v3.0.0+incompatible h1:e9Zfvfytsw/e6Kd/PYd75wggK+/kX5Xn8IYDUKyc5fU= github.com/alecthomas/gometalinter v3.0.0+incompatible/go.mod h1:qfIpQGGz3d+NmgyPBqv+LSh50emm1pt72EtcX2vKYQk= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 h1:oUQYOKpPm4h7shYEdPJ0T8EzVpu7Zz34qTof9XaMDxY= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295/go.mod h1:mNZkuqaeM5UCiAdkV4r+lrheu8Q5fe/487bRFrGYZ8A= +github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70 h1:FrF4uxA24DF3ARNXVbUin3wa5fDLaB1Cy8mKks/LRz4= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= +github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e h1:ptBAamGVd6CfRsUtyHD+goy2JGhv1QC32v3gqM8mYAM= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= +github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0 h1:JaCC8jz0zdMLk2m+qCCVLLLM/PL93p84w4pK3aJWj60= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= @@ -154,10 +178,14 @@ github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2 github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171 h1:19Seu/H5gq3Ugtx+CGenwF89SDG3S1REX5i6PJj3RK4= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= @@ -165,6 +193,7 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aslakhellesoy/gox v1.0.100 h1:IP+x+v9Wya7OHP1OmaetTFZkL4OYY2/9t+7Ndc61mMo= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -175,30 +204,43 @@ github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9z github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.24.0 h1:R0lL0krk9EyTI1vmO1ycoeceGZotSzCKO51LbPGq3rU= github.com/aws/aws-sdk-go-v2 v0.24.0/go.mod h1:2LhT7UgHOXK3UXONKI5OMgIyoQL6zTAw/jwIeX6yqzw= +github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= +github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e h1:D64GF/Xr5zSUnM3q1Jylzo4sK7szhP/ON+nb2DB5XJA= github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= +github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee h1:BnPxIde0gjtTnc9Er7cxvBk8DHLWhEux0SxayC8dP6I= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= @@ -206,20 +248,30 @@ github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuij github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/gherkin-go/v13 v13.0.0 h1:d09AwPZldyOFlCADAIZQMt7T+VHCrGdp5106+BCIfZU= github.com/cucumber/gherkin-go/v13 v13.0.0/go.mod h1:pzMEPEIPcPOBDkE8HaWC+Ck6eDBtBmIWVksUkSin/2E= @@ -228,6 +280,7 @@ github.com/cucumber/messages-go/v12 v12.0.0/go.mod h1:5zuJu21U6rB+BBqyGoQr839a4h github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315 h1:iPnw+GH24L2yS/xxsp16Lv86aM0ZVwqANxHic/gMrSc= github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315/go.mod h1:QXiCu8WKyFL/X+NMCmtxoCq/jSOb54R4iDXdjsaYEWA= github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c h1:/y0rm2Eg2xe4/qkZp7jNrg/hhAt9AEPjwuimkTY6938= github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c/go.mod h1:GfNYCa+c8fEK3kDRjxMeQiEdPyeORDK8Zi7ykJBA0/w= @@ -237,6 +290,7 @@ github.com/dghubble/sling v1.1.0 h1:DLu20Bq2qsB9cI5Hldaxj+TMPEaPpPE8IR2kvD22Atg= github.com/dghubble/sling v1.1.0/go.mod h1:ZcPRuLm0qrcULW2gOrjXrAWgf76sahqSyxXyVOvkunE= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.57.0 h1:uCpe0sRIZ/sJWxWDsJyBPBjUfSvxop+WHkHiSf+tjjM= github.com/digitalocean/godo v1.57.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= @@ -245,30 +299,44 @@ github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQ github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 h1:Od9CDqwkw5F3vjN8Lp8CQhkMOEjC70eTW+AJlTepE6g= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884/go.mod h1:SB2lZXXkyipTEoPLxR3A5YglkZ7QwoXSsyI9h6yUeFc= +github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= +github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1 h1:r1oACdS2XYiAWcfF8BJXkoU8l1J71KehGR+d99yWEDA= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 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 h1:EmNYJhPYy0pOFjCx2PrgtaBXmee0iUX9hLlxE1xHOJE= 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 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fastly/go-fastly v1.18.0 h1:fyVq/142VTFz5ZkNE5d57K+NkTmtwxt2K2Mh5sV5scg= github.com/fastly/go-fastly v1.18.0/go.mod h1:fwYSSnZ6zEClwRS65T0f57Yh83Tc4gL12GgttQwJZfA= +github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/gomodifytags v1.4.0 h1:vmm9INDEciuWj4Y38SKGHAGeHd4ELfVDj9IizF+FRkE= github.com/fatih/gomodifytags v1.4.0/go.mod h1:I1Y8xh3aVI37vceIxNEr549I/TnDN1wuVPZM7NUR7kA= +github.com/fatih/motion v1.1.0 h1:Cvkgg+oR4QK25yKCJ8Ol7YXATJA6uOHBISJnSqZ0PXw= github.com/fatih/motion v1.1.0/go.mod h1:go/hyCtg5rx6FjoC0o+iInMzlY2u7OeHayKYDY6Gbmk= github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90 h1:WXb3TSNmHp2vHoCroCIB1foO/yQ36swABL8aOVeDpgg= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= @@ -283,11 +351,15 @@ github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655 h1:hKQ7ba/nVgQ0sGq8KBWJ7hdm0CEN48AlIYjBmfzCQzQ= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= @@ -296,9 +368,12 @@ github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= @@ -306,6 +381,7 @@ github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/Id github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -318,35 +394,48 @@ github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhY github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221 h1:HJ7/f/eGwr7jlZl0lsnNT38/mKcSluFGTc5uLHn4pwI= github.com/go-routeros/routeros v0.0.0-20190719172022-0819accf8221/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd h1:hSkbZ9XSyjyBirMeqSqUrK+9HboWrweVlzRNqoBi2d4= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0 h1:31atYa/UW9V5q8vMJ+W6wd64OaaTHUrCUXER358zLM4= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3 h1:3GQ53z7E3o00C/yy7Ko8VXqQXoJGLkrTQCLTF1EjoXU= github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1 h1:iQ0D6SpNXIxu52WESsD+KoQ7af2e3nCfnSBoSF/hKe0= github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211 h1:mSVZ4vj4khv+oThUfS+SQU3UuFIZ5Zo6UNcvK8E8Mz8= github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1 h1:dLg+zb+uOyd/mKeQUYIbwbNmfRsr9hd/WtYWepmayhI= github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2 h1:8thhT+kUJMTMy3HlX4+y9Da+BNJck+p109tqqKp7WDs= github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2 h1:fq9WcL1BYrm36SzK6+aAnZ8hcp+SrmnDyAxhNx8dvJk= github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0 h1:4sGKOD8yaYJ+dek1FDkwcxCHA40M4kfKgFHx8N2kwbU= github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0 h1:Ir9W9XIm9j7bhhkKE9cokvtTl1vBm62A/fene/ZCj6A= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754 h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -355,8 +444,11 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d h1:lBXNCxVENCipq4D1Is42JVOP4eQjlB8TQ6H69Yx5J9Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -389,8 +481,10 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -427,8 +521,11 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e h1:41CTEDOoUXp+FxbPYuEhth5dE/s+NT1cRuhSoqhBQ1E= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -442,27 +539,38 @@ github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3i github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.13.0 h1:1XkslZZRm6Ks0bLup+hBNth+KQf+0JA1UeoB7YKw9E8= github.com/gophercloud/gophercloud v0.13.0/go.mod h1:VX0Ibx85B60B5XOrZr6kaNwrmPUzcmMpwxvQ1WQIIWM= +github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01 h1:OgCNGSnEalfkRpn//WGJHhpo7fkP+LhTpvEITZ7CkK4= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/hashicorp/aws-sdk-go-base v0.4.0 h1:zH9hNUdsS+2G0zJaU85ul8D59BGnZBaKM+KMNPAHGwk= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= +github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089 h1:1eDpXAxTh0iPv+1kc9/gfSI2pxRERDsTk/lNGolwHn8= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= +github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1 h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.10.0 h1:KhjDnQhCqEMKlt4yH00MCevJQPJ6LkHFdSveXINO6vE= github.com/hashicorp/go-azure-helpers v0.10.0/go.mod h1:YuAtHxm2v74s+IjQwUG88dHBJPd5jL+cXr5BGVzSKhE= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.0.0-20170211013415-3573b8b52aa7/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -478,8 +586,10 @@ github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= +github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.4 h1:SFT72YqIkOcLdWJUYcriVX7hbrZpwc/f7h8aW2NUqrA= github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= @@ -493,13 +603,18 @@ github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6 github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-slug v0.4.1 h1:/jAo8dNuLgSImoLXaX7Od7QB4TfYCVPam+OpAt5bZqc= github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-tfe v0.8.1 h1:J6ulpLaKPHrcnwudRjxvlMYIGzqQFlnPhg3SVFh5N4E= github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnOn8E8stHc= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= @@ -508,8 +623,10 @@ github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -518,15 +635,20 @@ github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= +github.com/hashicorp/hcl2 v0.0.0-20190909202536-66c59f909e25 h1:hP3bdZpTEdjGFXQZyeeRsYH1oJgOBGx5sMLYPqZuqOU= github.com/hashicorp/hcl2 v0.0.0-20190909202536-66c59f909e25/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 h1:T1Q6ag9tCwun16AW+XK3tAql24P4uTGUMIn1/92WsQQ= github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= +github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= +github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/terraform v0.12.29 h1:UkuApT6qh6KONIT1Jz7HoV8f4B+x71db3bmGcBzjBB0= github.com/hashicorp/terraform v0.12.29/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhkKZNlHPcr4P55U= @@ -539,6 +661,7 @@ github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2 github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/vault v0.10.4 h1:4x0lHxui/ZRp/B3E0Auv1QNBJpzETqHR2kQD3mHSBJU= github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= @@ -547,19 +670,23 @@ github.com/heroku/heroku-go/v5 v5.1.0 h1:3Qx1MxjzczSakhAZN4yRsvCI7kP0ldijK1XvfoY github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZOdlm26Sr73U= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570 h1:scAwHAovDCnGeG+6q16cAYngtzYqgy3q6lSyG42K7oQ= github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570/go.mod h1:4X9u5iNUePRrRDdwjok6skjlQBXTcNfWa4C3uS1+5SQ= github.com/jarcoal/httpmock v1.0.5 h1:cHtVEcTxRSX4J0je7mWPfc9BpDpqzXSJ5HbymZmyHck= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= @@ -576,7 +703,9 @@ github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0 github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= github.com/jonboydell/logzio_client v1.2.0/go.mod h1:ZXJYF4M9/chuG+4fQDS9BN6CqXqokUjtQOjdMqzGC/Y= +github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7 h1:dhk1N6iuFDo1Lcew31sAQxrh8GVWaw0xu0MWNnMc6ao= github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7/go.mod h1:t4Tr0tn92eq5ISef4cS5plFAMYAqZlAXtgUcKE6y8nw= +github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 h1:kie3qOosvRKqwij2HGzXWffwpXvcqfPPXRUw8I4F/mg= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -585,30 +714,44 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ 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 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jstemmer/gotags v1.4.1 h1:aWIyXsU3lTDqhsEC49MP85p2cUUWr2ptvdGNqqGA3r4= github.com/jstemmer/gotags v1.4.1/go.mod h1:b6J3X0bsLbR4C5SgSx3V3KjuWTtmRzcmWPbTkWZ49PA= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3 h1:lOpSw2vJP0y5eLBW906QwKsUK/fe/QDyoqM5rnnuPDY= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/asmfmt v1.2.1 h1:LgH5hc6QnY2sDT2K+ilscIzcZpfQ1xlayuTyLxo4pOA= github.com/klauspost/asmfmt v1.2.1/go.mod h1:RAoUvqkWr2rUa2I19qKMEVZQe4BVtcHGTMCUOcCU2Lg= +github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91 h1:hunjgdb3b21ZdRmzDPXii0EcnHpjH7uCP+kODoE1JH0= github.com/koron/iferr v0.0.0-20180615142939-bb332a3b1d91/go.mod h1:C2tFh8w3I6i4lnUJfoBx2Hwku3mgu4wPNTtUNp1i5KI= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -620,24 +763,34 @@ github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= +github.com/likexian/gokit v0.20.15 h1:DgtIqqTRFqtbiLJFzuRESwVrxWxfs8OlY6hnPYBa3BM= github.com/likexian/gokit v0.20.15/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= +github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b h1:tNa5q0zLsg6EzUI4npXeUYwk/xuTtMcKdVnRsYdOHzk= github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= github.com/linode/linodego v0.24.1 h1:3s7/F54z9XZfefzrFqnHMD9DIEYVyOddPm+gyTEFFzc= github.com/linode/linodego v0.24.1/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= +github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82 h1:wnfcqULT+N2seWf6y4yHzmi7GD2kNx4Ute0qArktD48= github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 h1:JgVTCPf0uBVcUSWpyXmGpgOc62nK5HWUBKAGc3Qqa5k= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9 h1:SmVbOZFWAlyQshuMfOkiAx1f5oUTsOGG5IXplAEYeeM= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= +github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b h1:/1RFh2SLCJ+tEnT73+Fh5R2AO89sQqs8ba7o+hx1G0Y= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -653,12 +806,16 @@ github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW1 github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-shellwords v1.0.4 h1:xmZZyxuP+bYKAKkA9ABYXVNJ+G/Wf3R8d8vAP3LDJJk= github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee h1:7Ac2RNGC8DAwDNd5uZyuYLoJOlVXyBGbO1VtFboDamk= github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee/go.mod h1:yd3I5pyIO5TrBH7+Ym94u8qp9xc6NTHAqESeI8kOJY8= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -669,6 +826,7 @@ github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFW github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb h1:GRiLv4rgyqjqzxbhJke65IYUf4NCOOvrPOJbV/sPxkM= github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= @@ -676,16 +834,20 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/panicwrap v1.0.0 h1:67zIyVakCIvcs69A0FGfZjBdPleaonSgGlXRSRlb6fE= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= +github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51 h1:eD92Am0Qf3rqhsOeA1zwBHSfRkoHrt4o6uORamdmJP8= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= @@ -696,13 +858,17 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 h1:TLDEP4t/KAbbIBVqMQlmf0MaLBm0eMAGHKtrOFNGHUM= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409/go.mod h1:q1krA85sGCNuxTOIcH9WSFf4nEO7he+IDDf5SW+xs1s= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d h1:7PxY7LVfSZm7PEeBTyK1rj1gABdCO2mbri6GKO1cMDs= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= @@ -712,14 +878,18 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= +github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836 h1:oc3CL18CoGhyOQJ7HDa9gJAde33bwI8Vi28zLdIzJVc= github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836/go.mod h1:6Q8/OMaaKAgTX7/jt2bOXVDrm1eJhoNd+iwzghR7jvs= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M= +github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -740,7 +910,11 @@ github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= +github.com/packethost/packngo v0.9.0 h1:dcrJFDNdbW+xCCNzWCmtol1x+hanEZmff5Myv/ku82U= +github.com/packethost/packngo v0.9.0/go.mod h1:YrtUNN9IRjjqN6zK+cy2IYoi3EjHfoWTWxJkI1I1Vk0= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paultyng/go-newrelic/v4 v4.10.0 h1:6R2aC3vONWnfxbW00nAYZ9YSj7nJ3IvQRw2rG5KGijY= github.com/paultyng/go-newrelic/v4 v4.10.0/go.mod h1:RmSnSvZnV267IBAqv2/2RACv1YVmxaf+/ujOFS9DRb8= @@ -749,10 +923,13 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -765,36 +942,51 @@ github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6D github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/godef v1.1.2 h1:c5mCx0EcCORJOdVMREX7Lgh1raTxAHFmOfXdEB9u8Jw= github.com/rogpeppe/godef v1.1.2/go.mod h1:WtY9A/ovuQ+UakAJ1/CEqwwulX/WJjb2kgkokCHi/GY= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sclevine/agouti v3.0.0+incompatible h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -802,17 +994,21 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:X github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -821,6 +1017,7 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= +github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -834,7 +1031,9 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible h1:q+D/Y9jla3afgsIihtyhwyl0c2W+eRWNM9ohVwPiiPw= @@ -842,20 +1041,25 @@ github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible/go.mod h1:0PfY github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= github.com/tencentyun/cos-go-sdk-v5 v0.7.19 h1:janAfTO4MglOrUFuKGTQJBuMc66+F7TgtEIt1wPsJ+k= github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= +github.com/terraform-providers/terraform-provider-openstack v1.15.0 h1:adpjqej+F8BAX9dHmuPF47sUIkgifeqBu6p7iCsyj0Y= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y= github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= +github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= @@ -866,12 +1070,18 @@ github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37w github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= +github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc h1:n+nNi93yXLkJvKwXNP9d55HC7lGK4H/SRcwB5IaUZLo= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557 h1:Jpn2j6wHkC9wJv5iMfJhKqrZJx3TahFx+7sbZ7zQdxs= github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 h1:ujojfQqu+1XfDMOVzAcKIJ3pRSF5f3gAmVGxuLcFWn4= github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= @@ -880,6 +1090,7 @@ github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13/go.mod h1:LEdA github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= @@ -889,9 +1100,11 @@ github.com/zclconf/go-cty v1.7.1 h1:AvsC01GMhMLFL8CgEYdHGM+yLnnDOwhPAYcgTkeF0Gw= github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a h1:00UFliGZl2UciXe8o/2iuEsRQ9u7z0rzDTVzuj6EYY0= github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a/go.mod h1:ofmGw6LrMypycsiWcyug6516EXpIxSbZ+uI9ppGypfY= github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= +go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= @@ -905,9 +1118,12 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -925,6 +1141,7 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= @@ -945,6 +1162,7 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -959,6 +1177,7 @@ golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= @@ -1107,6 +1326,7 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1205,6 +1425,7 @@ gonum.org/v1/gonum v0.7.0 h1:Hdks0L0hgznZLG9nzXb8vZ0rRvqNvAcgAp84y7Mwkgw= gonum.org/v1/gonum v0.7.0/go.mod h1:L02bwd0sqlsvRv41G7wGWFCsVNZFv/k1xzGIxeANHGM= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1318,15 +1539,20 @@ google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/DataDog/dd-trace-go.v1 v1.24.1 h1:CGQIcKZxAsFtMTUiXw0TxBWwj+l+b2bS2V8l1bIsfk4= gopkg.in/DataDog/dd-trace-go.v1 v1.24.1/go.mod h1:DVp8HmDh8PuTu2Z0fVVlBsyWaC++fzwVCaGWylTe3tg= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780 h1:CEBpW6C191eozfEuWdUmIAHn7lwlLxJ7HVdr2e2Tsrw= gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780/go.mod h1:3HH7i1SgMqlzxCcBmUHW657sD4Kvv9sC3HpL3YukzwA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= @@ -1341,6 +1567,7 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1364,7 +1591,9 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= @@ -1372,16 +1601,22 @@ k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/client-go v0.20.2 h1:uuf+iIAbfnCSw8IGAv/Rg0giM+2bOzHLOsbbrwrdhNQ= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac h1:sAvhNk5RRuc6FNYGqe7Ygz3PSo/2wGWbulskmzRX8Vs= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= From 811bd0f8e7db149924881e4b5c171e87f4f2a8d0 Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Sat, 3 Apr 2021 02:57:50 -0500 Subject: [PATCH 125/276] Adds client setup and provider for Equinix Metal provider --- .../equinixmetal/equinixmetal_provider.go | 76 +++++++++++++++++++ .../equinixmetal/equinixmetal_service.go | 32 ++++++++ 2 files changed, 108 insertions(+) create mode 100644 providers/equinixmetal/equinixmetal_provider.go create mode 100644 providers/equinixmetal/equinixmetal_service.go diff --git a/providers/equinixmetal/equinixmetal_provider.go b/providers/equinixmetal/equinixmetal_provider.go new file mode 100644 index 0000000000..9abc9a97d9 --- /dev/null +++ b/providers/equinixmetal/equinixmetal_provider.go @@ -0,0 +1,76 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package equinixmetal + +import ( + "errors" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type EquinixMetalProvider struct { //nolint + terraformutils.Provider + auth_token string + project_id string +} + +func (p *EquinixMetalProvider) Init(args []string) error { + if os.Getenv("PACKET_AUTH_TOKEN") == "" { + return errors.New("set PACKET_AUTH_TOKEN env var") + } + p.auth_token = os.Getenv("PACKET_AUTH_TOKEN") + + if os.Getenv("METAL_PROJECT_ID") == "" { + return errors.New("set METAL_PROJECT_ID env var") + } + p.project_id = os.Getenv("METAL_PROJECT_ID") + + return nil +} + +func (p *EquinixMetalProvider) GetName() string { + return "metal" +} + +func (p *EquinixMetalProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{} +} + +func (EquinixMetalProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} + +func (p *EquinixMetalProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "device": &DeviceGenerator{}, + } +} + +func (p *EquinixMetalProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New("equinixmetal: " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "auth_token": p.auth_token, + "project_id": p.project_id, + }) + return nil +} diff --git a/providers/equinixmetal/equinixmetal_service.go b/providers/equinixmetal/equinixmetal_service.go new file mode 100644 index 0000000000..0d425edbf2 --- /dev/null +++ b/providers/equinixmetal/equinixmetal_service.go @@ -0,0 +1,32 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package equinixmetal + +import ( + // "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/packethost/packngo" + // "golang.org/x/oauth2" +) + +type EquinixMetalService struct { //nolint + terraformutils.Service +} + +func (s *EquinixMetalService) generateClient() *packngo.Client { + client, _ := packngo.NewClient() + return client +} From 067a03e275ecfdc37be9823595a5a0dce75aab7e Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sat, 3 Apr 2021 20:48:16 +0800 Subject: [PATCH 126/276] #549 updated AWS SDK to address aws/aws-sdk-go-v2#1151 --- README.md | 1 + go.mod | 134 ++++++------- go.sum | 445 ++++++++++++++----------------------------- providers/aws/kms.go | 49 +++-- tests/aws/main.go | 2 +- 5 files changed, 246 insertions(+), 385 deletions(-) diff --git a/README.md b/README.md index 7fa7b6437e..fc7675b0ad 100644 --- a/README.md +++ b/README.md @@ -609,6 +609,7 @@ In that case terraformer will not know with which region resources are associate * `kms` * `aws_kms_key` * `aws_kms_alias` + * `aws_kms_grant` * `lambda` * `aws_lambda_event_source_mapping` * `aws_lambda_function` diff --git a/go.mod b/go.mod index d92d2e936e..17a8fc000e 100644 --- a/go.mod +++ b/go.mod @@ -21,73 +21,73 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go-v2 v1.2.1 - github.com/aws/aws-sdk-go-v2/config v1.1.2 - github.com/aws/aws-sdk-go-v2/credentials v1.1.2 - github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.2 - github.com/aws/aws-sdk-go-v2/service/acm v1.1.2 - github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.2 - github.com/aws/aws-sdk-go-v2/service/appsync v1.1.2 - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.2 - github.com/aws/aws-sdk-go-v2/service/budgets v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.2 - github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.2 - github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.2 - github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.2 - github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.2 - github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.2 - github.com/aws/aws-sdk-go-v2/service/configservice v1.1.2 - github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.2 - github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.2 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.2 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.2 - github.com/aws/aws-sdk-go-v2/service/ecr v1.1.2 - github.com/aws/aws-sdk-go-v2/service/ecs v1.1.2 - github.com/aws/aws-sdk-go-v2/service/efs v1.1.2 - github.com/aws/aws-sdk-go-v2/service/eks v1.1.2 - github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.2 - github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.2 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.2 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.2 - github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.2 - github.com/aws/aws-sdk-go-v2/service/emr v1.1.2 - github.com/aws/aws-sdk-go-v2/service/firehose v1.1.2 - github.com/aws/aws-sdk-go-v2/service/glue v1.1.2 - github.com/aws/aws-sdk-go-v2/service/iam v1.1.2 - github.com/aws/aws-sdk-go-v2/service/iot v1.1.2 - github.com/aws/aws-sdk-go-v2/service/kafka v1.1.2 - github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.2 - github.com/aws/aws-sdk-go-v2/service/kms v1.1.2 - github.com/aws/aws-sdk-go-v2/service/lambda v1.1.2 - github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.2 - github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.2 - github.com/aws/aws-sdk-go-v2/service/organizations v1.1.2 - github.com/aws/aws-sdk-go-v2/service/qldb v1.1.2 - github.com/aws/aws-sdk-go-v2/service/rds v1.1.2 - github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.2 - github.com/aws/aws-sdk-go-v2/service/route53 v1.1.2 - github.com/aws/aws-sdk-go-v2/service/s3 v1.2.1 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.2 - github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.2 - github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.2 - github.com/aws/aws-sdk-go-v2/service/ses v1.1.2 - github.com/aws/aws-sdk-go-v2/service/sfn v1.1.2 - github.com/aws/aws-sdk-go-v2/service/sns v1.1.2 - github.com/aws/aws-sdk-go-v2/service/sqs v1.1.2 - github.com/aws/aws-sdk-go-v2/service/sts v1.1.2 - github.com/aws/aws-sdk-go-v2/service/swf v1.1.2 - github.com/aws/aws-sdk-go-v2/service/waf v1.1.2 - github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.2 - github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.2 - github.com/aws/aws-sdk-go-v2/service/xray v1.1.2 + github.com/aws/aws-sdk-go-v2 v1.3.1 + github.com/aws/aws-sdk-go-v2/config v1.1.4 + github.com/aws/aws-sdk-go-v2/credentials v1.1.4 + github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 + github.com/aws/aws-sdk-go-v2/service/acm v1.2.1 + github.com/aws/aws-sdk-go-v2/service/apigateway v1.2.1 + github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1 + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.2.1 + github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3 + github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 + github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0 + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.2.1 + github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.3 + github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.2.1 + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0 + github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.1 + github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1 + github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.3 + github.com/aws/aws-sdk-go-v2/service/codedeploy v1.2.1 + github.com/aws/aws-sdk-go-v2/service/codepipeline v1.2.1 + github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.2.1 + github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.2.1 + github.com/aws/aws-sdk-go-v2/service/configservice v1.3.0 + github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.3 + github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.3 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.1 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0 + github.com/aws/aws-sdk-go-v2/service/ecr v1.2.1 + github.com/aws/aws-sdk-go-v2/service/ecs v1.2.1 + github.com/aws/aws-sdk-go-v2/service/efs v1.2.1 + github.com/aws/aws-sdk-go-v2/service/eks v1.2.1 + github.com/aws/aws-sdk-go-v2/service/elasticache v1.2.1 + github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.2.1 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.2.1 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.2.1 + github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.2.1 + github.com/aws/aws-sdk-go-v2/service/emr v1.2.1 + github.com/aws/aws-sdk-go-v2/service/firehose v1.2.1 + github.com/aws/aws-sdk-go-v2/service/glue v1.3.0 + github.com/aws/aws-sdk-go-v2/service/iam v1.3.0 + github.com/aws/aws-sdk-go-v2/service/iot v1.2.0 + github.com/aws/aws-sdk-go-v2/service/kafka v1.2.1 + github.com/aws/aws-sdk-go-v2/service/kinesis v1.2.1 + github.com/aws/aws-sdk-go-v2/service/kms v1.2.1 + github.com/aws/aws-sdk-go-v2/service/lambda v1.2.1 + github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1 + github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.4 + github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 + github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 + github.com/aws/aws-sdk-go-v2/service/rds v1.2.1 + github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1 + github.com/aws/aws-sdk-go-v2/service/route53 v1.3.0 + github.com/aws/aws-sdk-go-v2/service/s3 v1.4.0 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.2.1 + github.com/aws/aws-sdk-go-v2/service/securityhub v1.2.1 + github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.2.1 + github.com/aws/aws-sdk-go-v2/service/ses v1.2.1 + github.com/aws/aws-sdk-go-v2/service/sfn v1.2.1 + github.com/aws/aws-sdk-go-v2/service/sns v1.2.1 + github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0 + github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 + github.com/aws/aws-sdk-go-v2/service/swf v1.2.1 + github.com/aws/aws-sdk-go-v2/service/waf v1.1.3 + github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1 + github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1 + github.com/aws/aws-sdk-go-v2/service/xray v1.2.1 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect diff --git a/go.sum b/go.sum index 38a1a1eea0..d0944a5357 100644 --- a/go.sum +++ b/go.sum @@ -172,306 +172,155 @@ github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/aws-sdk-go-v2 v1.1.0/go.mod h1:smfAbmpW+tcRVuNUjo3MOArSZmW72t62rkCzc2i0TWM= -github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2 v1.2.1 h1:055XAi+MtmhyYX161p+jWRibkCb9YpI2ymXZiW1dwVY= -github.com/aws/aws-sdk-go-v2 v1.2.1/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+testmuQeRY= -github.com/aws/aws-sdk-go-v2/config v1.1.1 h1:ZAoq32boMzcaTW9bcUacBswAmHTbvlvDJICgHFZuECo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/config v1.1.2 h1:H2r6cwMvvINFpEC55Y7jcNaR/oc7zYIChrG2497wmBI= -github.com/aws/aws-sdk-go-v2/config v1.1.2/go.mod h1:77yIk+qmCS/94JlxbwV1d+YEyu6Z8FBlCGcSz3TdM6A= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1 h1:NbvWIM1Mx6sNPTxowHgS2ewXCRp+NGTzUYb/96FZJbY= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/credentials v1.1.2 h1:YoNqfhxAJGZI+lStIbqgx30UcCqQ86fr7FjTLUvrFOc= -github.com/aws/aws-sdk-go-v2/credentials v1.1.2/go.mod h1:hofjw//lM0XLplgvzPPMA7oD0doQU1QpaIK1nweEEWg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 h1:EtEU7WRaWliitZh2nmuxEXrN0Cb8EgPUFGIoTMeqbzI= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.3 h1:d3bKAGy4XdJyK8hz3Nx3WJJ4TCmYp2498G4mFY5wly0= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.3/go.mod h1:Zr1Mj+KUMGVQ+WJvTT68EZJxqhjiie2PWSPGEUPaNY0= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1 h1:6ocrUoJHmXBa0/oCoWYN2nK+UrETpA0zUxCV990nRl0= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.1/go.mod h1:+JkwIyrURCsjBdb3M6PdF+LAQ3TPvZAfH+gJ7AI3JT0= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.2 h1:nRGCAKHW9y7UTmYfVK0A4gdNPiv9r9DgRAgcNdKTIiI= -github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.1.2/go.mod h1:d06PcqdTUu/DWO7VX0THiUVJQiWQCOqlKUd2+3/l7K0= -github.com/aws/aws-sdk-go-v2/service/acm v1.1.1 h1:LAr7oTwfOZdfJN1GrZnU05yf2aOO3HVeGv2KjJKp8d4= -github.com/aws/aws-sdk-go-v2/service/acm v1.1.1/go.mod h1:LPzlCt4j2TSsD9P6NtruMhkOf0Ke7uxEHaxRCI5D1x4= -github.com/aws/aws-sdk-go-v2/service/acm v1.1.2 h1:rtDZfCAVenmkJbXlJtiKq2qUXk3CP24dUyY0ZdfntTU= -github.com/aws/aws-sdk-go-v2/service/acm v1.1.2/go.mod h1:D6HblKOnaa8K5Pz7SCl2p3lpY0TMnfUpE/2gel3bg3A= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1 h1:G2JpxWOpTyeLgTbh5gfiESvvm6B3lu/6kQNEhAS8Tvk= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.1/go.mod h1:wmgrgVgNP96iRTgbY+Qd3UdqVvmlOCd46tY2P6sOTfs= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.2 h1:HLLXaDntRmxE+ipJE0PaQm5s0EkxgCc2CdkjgYp+wuo= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.1.2/go.mod h1:tSUFOanfmaa5h3b4VhH505Bm/aO2yNk6sXUDRRfwZP4= -github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1 h1:NYPqPq18/WvalPPowYG0laum27pdEXq5gnrTp1ppVF4= -github.com/aws/aws-sdk-go-v2/service/appsync v1.1.1/go.mod h1:uhccc+JDGc1Ck0q8F3iI0+PPIP1N+yTZEfuMPp2Achw= -github.com/aws/aws-sdk-go-v2/service/appsync v1.1.2 h1:ZnPjospQrreBKs/wn3YFuAycYRVMiOmwPRpxFOUHdVU= -github.com/aws/aws-sdk-go-v2/service/appsync v1.1.2/go.mod h1:MJ/f6dHpgNODy8qpr9CKP2F7ahNLcTJbfiEPubP4kzk= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1 h1:O0iefEPzxDdVVBtY7o0Hyj4SUre27QRh5mthCU+HYDA= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.1/go.mod h1:lmXoX7IIO5yAHRCmHlqda9tFfsbkY3IO3rt85VvXmIQ= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.2 h1:FJDnLBh8hYdyvR+MNH4bO6dfaLUfpHt/qp7C0M9PW8E= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.1.2/go.mod h1:ZSwcb/G1aNBqI1sTu+ltHoyv24+rKMITwzGmOZWKu7w= -github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1 h1:ZVgyQqcfkXmz8VLA/R0j0FdqMBwPYNs52Ho2DzwY8zo= -github.com/aws/aws-sdk-go-v2/service/budgets v1.1.1/go.mod h1:/v+APBnOBPy/NpPFS1lH5qJ9BfEQVfPAEnBm5XV1870= -github.com/aws/aws-sdk-go-v2/service/budgets v1.1.2 h1:1Y0am48Q1bG2Sp+SRblVnZ5MQegm72CfY2wcXLMKy1c= -github.com/aws/aws-sdk-go-v2/service/budgets v1.1.2/go.mod h1:hXXUg4S46AY9OLt0Z5+6FO3m+zaQ+Fs7eZ9vOs5+5HA= -github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1 h1:WblDVlnxgdvuZNwBw3UX3JaO7hdVuvaLNK4P0XK1gKM= -github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.1/go.mod h1:InGDFYVeG6/bfb5KRB2n5qTFWZ/vp483zdUE1EPbDM0= -github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.2 h1:cEP6HRpSyu8Ya+R5pvoF022H5HGBhUVwILmG3b4gRvA= -github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.2/go.mod h1:h+/8bgq+cqn/4POUfLez6ytHJbF0ieYKIoXkzIrwIxY= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1 h1:cRw6t1ZAqc0fG2CFtWnXXdBwgREo6B06X63lDlpGPlI= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.1/go.mod h1:Fq3q5X0gHcCCldZx+ibAo0HRo2xbVi9LFoFj2Pp9nl0= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.2 h1:KLfDJr7FrIBUyblZoykOkrUQcee2jG4i/h9ktrAnR2w= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.1.2/go.mod h1:yEU17ooXv0TOuVllG01Y9bnLpzItcdQK5WwOQ8Hx0lE= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1 h1:Qhi6EdWHqYvqKXZBZ55YHNR6RL9JJTi65ndbqPKRdpM= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.1/go.mod h1:xNq//oorX26+SRydd//Rqk3iPLoKzoYmAGDm6p3wpzc= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.2 h1:AeLWpXkm6c1EsOBXWH2fCyQbQHcJvBEfKBHVKDxCIbE= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.1.2/go.mod h1:71I7dqlx0GqfHY5G8JfzgT9GtZiK/MIHE+rMODYhIzI= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1 h1:jso38tIYjMhe0i5uBD2sG/nmgODmh8ZCKFvaejqlIQ8= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.1/go.mod h1:e6vwvVG3CrANic49hz9SG2bkKnSujNy8r+S6MZ21oEE= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.2 h1:jzPgwQXYlH3rCNr+6lAatslMaUhcGzgWk+yPKsdsBNE= -github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.2/go.mod h1:PHb1emsao0PBvsnH2XxSgEq+FS6ifR1da8LDh+MRrk0= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1 h1:MNQmQJZNCAlPqkWP01/7YptslcAbVmLNyqac+W/Q5oY= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.1/go.mod h1:gI/6WuEdSe7fWiBOMVPJfaonzq9mSA2E7h85CZNXzuI= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.2 h1:TQG/DLTpnn2tOPqQ/eYA2MsDR+ALiRTEDdc02fpgTrc= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.1.2/go.mod h1:+mjnjZE8B5Kav2pwoc00jS36ffTYVYeC3HV9wIcbBL4= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1 h1:wvmvsbvJw/ml/PtdvqbcJnpu/GZLA5dERO0pqpcvyw0= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.1/go.mod h1:HFCCrSEnP3mVyR8zOmcbLSQJW4DGRKoz1hjJxh4d/tw= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.2 h1:/deTIzCUutEJMf2M9m+kJ+NxOREzWztaZfUF44bP49A= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.1.2/go.mod h1:YbU+VaZkitxbGlS92bIX78fEbx2zz0XDSw/btL3iPTU= -github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1 h1:abNETLBP3ShOHUBocGFBHqbP3D9Ho2vKhG8soWId4js= -github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.1/go.mod h1:rtyMQxf1ahZkyvpcwnHGR7goHPJC4WRUmazENZsbjas= -github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.2 h1:ORThOu2acsbFDtd6d21JMCmAQu+4X8a+H4j8T+dnCWE= -github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.1.2/go.mod h1:2l/dZr0yepiC4XOnYq4mS2pIkzV1ixc9IpNe1Qn12I0= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1 h1:9McrdB/9iGpEZw2xZdRdCYQlNuCHFFYjvROkO5yo1RM= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.1/go.mod h1:IB6HamJdrHbUjbWEgWkGX1Lrp8mZzxoBLXHOTAmoXFA= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.2 h1:m+Otg1daHTlYqmG1YVrTDIejzYypSngTuH31TVRP310= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.1.2/go.mod h1:Nlyl4XGXgdVbzvQ+pMjqB3DX7MBl0KwAk5k0KsM3W+c= -github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1 h1:5Ku1ITd/Epk23vIwq/2NU1F0gUKlUcjyk5gOrsXPZIA= -github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.1/go.mod h1:Hc+1mcfi7yTl5Qtrn7PRwazVWblIIWCfhqwaj8M6vAw= -github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.2 h1:AjbBPbHPvTfO9aJXpuq3c/iN/PjkyWny6EGKP270JVU= -github.com/aws/aws-sdk-go-v2/service/codebuild v1.1.2/go.mod h1:v0j3cjX8lslcxiwaIzyp/64Z8BjpWsKgtskCb4O0Hgg= -github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1 h1:7WUEimiBFjeo0x/K8JNhPc61oho7TPhXyfrpYxpEMN0= -github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.1/go.mod h1:JUViTUm6ZiAJOwKItWf/lN5KeBRdidcjfZnAhgKTc0Y= -github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.2 h1:PIAYXYIBEBFaSvCNTiXsxakePOXC2eZ+wpxWhD2J4O4= -github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.2/go.mod h1:9Y2XYeoa34KWUK9wae2Iuel8OLRxc00SGgIlGUCOoXE= -github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1 h1:nCv1/hV+E3kMUJVwgUzw5zNvcHzP9cQqVmcVZXlcmiE= -github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.1/go.mod h1:ktnHZmgGlqoJkUjyzR4RHDlGhfSxQV+AQY7Xx3nPNPw= -github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.2 h1:o0Q+/kq8y+mEsWyFjue0DblQ/qU+wOLgzSQAzpdLY08= -github.com/aws/aws-sdk-go-v2/service/codedeploy v1.1.2/go.mod h1:lVkvplEz4Hv3ZdrC4+24ZFF66mDISEqaSCiwtcAylCk= -github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1 h1:FbzagBHyTmKk4DbXJOx4l/a+k0y49TgWoyzCc04YwAk= -github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.1/go.mod h1:7pc2jReqY0EvHa5ReuVBIwmRlW8yQV5O3ptw4T+OS80= -github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.2 h1:EBKpfmTxPZUBXCsUtoCmaaL5KdEjano6axwtDMw23ls= -github.com/aws/aws-sdk-go-v2/service/codepipeline v1.1.2/go.mod h1:PPsYbVZ/U/7LfrGno9R0+pTsHOBmsWPqD/USc4cItFo= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1 h1:A/ZhwplRVmY3cSM5NfW/3lp0PBJFAhWvHD5+sYo7oxI= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.1/go.mod h1:85mUFI4DMZiUYpQzTfUvDaFf/TL/pd419Elk5FOCVtY= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.2 h1:deWVQ8TYCvZL/NEDvjRHCvpeX78xPEGDuOKh68AJB3Y= -github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.1.2/go.mod h1:TWobMrhdOnsWrGlDEeTOe26dq2E/3zFRn2CdYjw4L5g= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1 h1:HoHckIJOdxpS4RSEqnPXp9+gFjixFH97pT46Q4buxhA= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.1/go.mod h1:/yhD37TwPeVuZZ8qx1n7H65O0+a2Mh3gEF4TTB4Sn24= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.2 h1:Neqzz0qcl73aN+nIj7KEcQ7YM2AEOW+xloaMp0ge/vI= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.1.2/go.mod h1:s3dskZLRZHMDJl+kUAWJ7Uv5xbUWWSIkAPx36jFhCJU= -github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1 h1:2PU0yT1crQJ08BJOF8Flq8j962NpiU3QltBaKg4NI0c= -github.com/aws/aws-sdk-go-v2/service/configservice v1.1.1/go.mod h1:d8io9sMSzJBqxJrNABjaDuFH6t02btWR2ZQtDTGF35A= -github.com/aws/aws-sdk-go-v2/service/configservice v1.1.2 h1:dPfOQxqBLmYgV66JX7kyrCvPLUw5KMGeGJWZN3LS9Fs= -github.com/aws/aws-sdk-go-v2/service/configservice v1.1.2/go.mod h1:Ue5OaxOjceUOvFRteflDfk1puv9p8XFtb2Ek7Uo4N+M= -github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1 h1:iBj0PYHYe7Po52v8fAcMEH0RRLbgN0XkJ+dux63lKD8= -github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.1/go.mod h1:f+FK6B06DiJnhr8Ba6rnN8SSPITHG3et63y8NORbbsk= -github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.2 h1:hkPtX5dDgQVxqzljfYEo3x0pIGMpKsKkAC89VBX0ma4= -github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.2/go.mod h1:j+H/C6+L0lXjoAbJ9OGyT6TWFHiJtopkChYPM02xMiA= -github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1 h1:NSFZm6LIFbASAv833Bm4+Ea/GiaWr2NvTalswFtOTj4= -github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.1/go.mod h1:UMb/XuyQ0X/Gr+GVwCwL5qYvPE5vWwUOYHooaa4WhzQ= -github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.2 h1:9QwBepbF6bMb71tz9etE+FsBc86mop7F4McfiFe8z+Q= -github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.2/go.mod h1:ylJGzdCqVTEdS6l0KMgK1DRuKO6u2+0SyHSW6E8xKe8= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1 h1:rs3qt8vsrOXgm3qfVdjVkwnPiBXI2M7qN1nExoZmJfI= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.1/go.mod h1:0xGVqnX5hK8bd/Qnqklpdellx5/6KPSPV7vfno3i1Sk= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.2 h1:Ow9GseCWcUqFGI0t67OqNT+8hB45Cf3M9zRQkMYEnjU= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.1.2/go.mod h1:xlIykhO1SzJtiDIbIWxQAYRZFROcJUiuqfU+F3c1YoY= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1 h1:xZYDtbub5yhn+ASvD26m76Cgb0k+0+ShE+nZwK9djUQ= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1/go.mod h1:L7nNXGNEV0lkTauKM/KcEIZkT262pckC0YNykwAtX20= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.2 h1:/JoZ7YQX4WBJ+3+t1/cGBYLu+RLPb0pZESN0K11rK7c= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.2/go.mod h1:7oIsiYQEJ1b8Ub5uYCBIum6E2rbe1hOvFqYd2q8Rbcw= -github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1 h1:idXCsD7Rl3LtE/MFFw81a1C1tVRSP3AOnv96U0TsRUo= -github.com/aws/aws-sdk-go-v2/service/ecr v1.1.1/go.mod h1:NGFCwbEd03lj5kwG8vO5qS5m4CfvHE4ir3pA5ozrlUM= -github.com/aws/aws-sdk-go-v2/service/ecr v1.1.2 h1:U9rzf/TLdiD+t4nWOhjdyznvKoRbr2telGDrzKzihcE= -github.com/aws/aws-sdk-go-v2/service/ecr v1.1.2/go.mod h1:PGXr/KFEb5dOTLc239aywXcceI59izqTn10BjnJ9EBA= -github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1 h1:McBGvH3M7n8s6SGuS+UNm8+q5BEmE30cNH/81qy0B4Q= -github.com/aws/aws-sdk-go-v2/service/ecs v1.1.1/go.mod h1:HHh+ZaGFQVK16XijQFZKaJdTpeOdxWK894pn9vY2Tgo= -github.com/aws/aws-sdk-go-v2/service/ecs v1.1.2 h1:g3OpNiW1iW9euM9JL2OM6ufGe2eXU0y6nTuK4sgQX7w= -github.com/aws/aws-sdk-go-v2/service/ecs v1.1.2/go.mod h1:v0SesgZfZH39s3f/XaZH5RmT8qQ1ZSuWnYsh9eML0II= -github.com/aws/aws-sdk-go-v2/service/efs v1.1.1 h1:UnjpU4x5bCWhJn43C+FXSjRs4fh8z8YjN8AsjxkEFW8= -github.com/aws/aws-sdk-go-v2/service/efs v1.1.1/go.mod h1:fJbRgAwIrq3LyqphCXgJs6bVYfMlLZ9G6vepkPvAJsw= -github.com/aws/aws-sdk-go-v2/service/efs v1.1.2 h1:XVTEYxexCqNpiHOgGmsfL+TdpMKTNMde5I4L2NuDnQ0= -github.com/aws/aws-sdk-go-v2/service/efs v1.1.2/go.mod h1:usiaxuisGN8Nq83C2llX1uHGVN1J1kjtaL2iChrtn5s= -github.com/aws/aws-sdk-go-v2/service/eks v1.1.1 h1:nK/Kl0TIfwaHUkcCj9+L6td2Xds7QNYMODJKWG1wPOY= -github.com/aws/aws-sdk-go-v2/service/eks v1.1.1/go.mod h1:9SVAH9Cu/e1iQOu7VIBp7DhqTq3Dr5cAooCzoh61mEc= -github.com/aws/aws-sdk-go-v2/service/eks v1.1.2 h1:6dTsNRi/7zQfGlHdwQsyTM9K/7SjMb76HccIFjTZ8sY= -github.com/aws/aws-sdk-go-v2/service/eks v1.1.2/go.mod h1:pxRGZ5JOjWAjnDa219dKFwra0HpHgtNeVGku7X/XGmM= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1 h1:/1VLazyWVSYTzl3CmmfjT2g3jc9krekNcTyGiW09AYY= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.1/go.mod h1:DfEntnpXu52dWWWGCjrx2RNMsHWHXuyI2LOpn+XkFFY= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.2 h1:lU5BpIqZcTXwktDBspHnEtubtyJ64SS8//DoAUSgZQo= -github.com/aws/aws-sdk-go-v2/service/elasticache v1.1.2/go.mod h1:3OuV15Jw8bwFrDAE8mXqTjdaDDAY/p/v1mXG2EEImtE= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1 h1:xLqpXaLCUtHJuJiOASwPIPLAJMt1v+6h8phzma1haT8= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.1/go.mod h1:9Klmao5OCdCMYyXPNy+skSx6c4LoKsbPL8IcEqV5wVU= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.2 h1:MRrQb1YVSwWX8gPUpl69a4VeCbqpNl/iDPjVjpRkJ3k= -github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.1.2/go.mod h1:yCoYDJc/WIJzItnZS0ZjdIbXhqSg/dERuv/+YH3hcSE= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1 h1:YyPHbW33NvSfUVVYIHVdMQX/BVnkdiJcgGdpjFqU64s= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.1/go.mod h1:Gqg2Xf3BaVCDXPjNgkTwM3Q1zN7OSrOszkJ8s9xuYXU= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.2 h1:ZQZ/lNpm1MPz2pvqJbXoNC95S74A4g3nYgnEBSnzZuo= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.1.2/go.mod h1:01WwK9L3B2NCrItDsdXVxsr8oCPQBFBZb9FABnqgrUY= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1 h1:ARoh9oSYV0QwcenklgpagsW+fI0xx5STB31yn3BtcPE= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.1/go.mod h1:DP/R8CgrCb5TFyP3GIM5FcDWcrSl0sTZWHQSxXMtrEk= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.2 h1:GT5cd6rUGA3bWM+6dgP7Bm3QQdsHEqfsMII+BUIPFtk= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.1.2/go.mod h1:n5F9MNl9cWXJoFUA6+PUoGyOGZreNBgq9ifyMJbGSwk= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1 h1:Kz5PZgEUnzh3134+b8/kLmA6XrkSLD/qBV5YhUAlP0U= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.1/go.mod h1:LtpgnMWYTwd6oasEo9HsE8dPDyeOnnU4A8at3LkyI6g= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.2 h1:46wNdiMdwMpxJiVkTeodNmXwJykaVrCd7JdSurZPTCU= -github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.1.2/go.mod h1:kRMSbCrV9giecQRowSNMa1wBD1nkk9g6S4TOxxlMmFE= -github.com/aws/aws-sdk-go-v2/service/emr v1.1.1 h1:Al6w3GqqFKUmBjrQK+RWYNT7t7REiZ52GQL0ew/LSds= -github.com/aws/aws-sdk-go-v2/service/emr v1.1.1/go.mod h1:hgkNhB3DJRxLgFjL84KMXQ1c6XNRZQla4qiU1foMdbw= -github.com/aws/aws-sdk-go-v2/service/emr v1.1.2 h1:Z0U9SyMgawaHvgn/AznxADnsCO1nJNbSxPr13/j6+Ew= -github.com/aws/aws-sdk-go-v2/service/emr v1.1.2/go.mod h1:1c6TJKKigHoRbZZG4hhDvSKVPNLZHqr6H3cRE1pYpJ8= -github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1 h1:RDEx0S3iyLDCK4/Y2TH4kXo53vJeSNeNyCdVzSwLR4g= -github.com/aws/aws-sdk-go-v2/service/firehose v1.1.1/go.mod h1:mIQsr8OSwIu5DgdTeEimmQN6nld0TxfLfIW+aqTEX68= -github.com/aws/aws-sdk-go-v2/service/firehose v1.1.2 h1:uqT56fpKIqEp7OiJz4qulDZjsV2VTJ0f3zZn3wolcR0= -github.com/aws/aws-sdk-go-v2/service/firehose v1.1.2/go.mod h1:8jSNvPdW16D7wXXsu76DONUzGOQNow6qOyrCfRp0jC0= -github.com/aws/aws-sdk-go-v2/service/glue v1.1.1 h1:O0mpo0QQXcsjr9lhLpQFKHjBJVY2XXkv5c/nWsZ0zgw= -github.com/aws/aws-sdk-go-v2/service/glue v1.1.1/go.mod h1:TegWq2QgDYYk6v6JD8POmo4gWwJhn4Ar6KoCyNxdyC0= -github.com/aws/aws-sdk-go-v2/service/glue v1.1.2 h1:V+IGXefRi9cOe3JH6UAzn+aVSuysUUBQ/yomnZofeLY= -github.com/aws/aws-sdk-go-v2/service/glue v1.1.2/go.mod h1:8AQl1dwuxkdMVluNNEH/t6Qond4/XHu/dz5SeUpvOWs= -github.com/aws/aws-sdk-go-v2/service/iam v1.1.1 h1:dfpLUOEtz+DlRpeAA9vg/tM/VjAcDGBE47m2ZbdXrZU= -github.com/aws/aws-sdk-go-v2/service/iam v1.1.1/go.mod h1:vBPRxb7qWfonEjDJR+ckM+1b1z2gXOogQjmTIPw15L4= -github.com/aws/aws-sdk-go-v2/service/iam v1.1.2 h1:ia0xRsYdXiV/QZLrs2Q8DU4F6jOj4qycfVtRbGVC0Fs= -github.com/aws/aws-sdk-go-v2/service/iam v1.1.2/go.mod h1:QfZ/D110t/xfKWiq74jxn6dJcJQw5BiHedJnQGvemuM= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0/go.mod h1:cZbnzYflIuoRkuKp4BB4q/R4xklYIwpLYs26vS3/Sac= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1 h1:q+3dVb1s3piv/Q/Ft0+OjU5iKItBRfCvU5wNLQUyIbA= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.1/go.mod h1:zurGx7QI3Bk2OFwswSXl3PtJDdgD3QzjkfskiukJ2Mg= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.2 h1:GO0pL4QvQmA0fXJe3MHVO+emtg31MYq5/8sebSWgE6A= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.2/go.mod h1:bYl7lGFQQdHia3uMQH4p6ImnuOeDNeUoydoXM5x8Yzw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.1/go.mod h1:PISaKWylTYAyruocNk4Lr9miOOJjOcVBd7twCPbydDk= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 h1:4AH9fFjUlVktQMznF+YN33aWNXaR4VgDXyP28qokJC0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.3 h1:dST4y8pZKZdTPs4uwXmGCJmpycz1SHKmCSIhf3GqHEo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.3/go.mod h1:C50Z41fJaJ7WgaeeCulOGAU3q4+4se4B3uOPFdhBi2I= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.1 h1:U78TX1VNmbtb7Mea2LdXQXNtLJ6wWZ0yDJgEYeRX0wg= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.1/go.mod h1:IQF5AljyiiUz/CnLbe1FeE3hZZ/Kr87gJ1+/yEYel3I= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0 h1:6yUvdqgAAWoKAotui7AI4QvJASrjI6rkJtweSyjH6M4= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.0/go.mod h1:q+4U7Z1uD6Iimym8uPQp0Ong/XICxInhzIKVSwn7bUU= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.1 h1:+WCVceRPiUsrui55mDByXOVremK1n3Hm8GnB4ZD3eco= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.1.1/go.mod h1:B+fb+BFbja6obFOHYmYE4iUMdej9aM2VGSpgdU1pn0M= -github.com/aws/aws-sdk-go-v2/service/iot v1.1.1 h1:D7cWw8QZTkOEoF5uCnCUMYcNA1uo+yD+XuZXnZLcS+k= -github.com/aws/aws-sdk-go-v2/service/iot v1.1.1/go.mod h1:LM7v3TvBIu+R+UZ4QKQzoDS94lzJ3XLLFLN4wsbnbVM= -github.com/aws/aws-sdk-go-v2/service/iot v1.1.2 h1:y43srDjpAphR0mETX5OlXZ8iQNz7uKJan3DPEoAlT2U= -github.com/aws/aws-sdk-go-v2/service/iot v1.1.2/go.mod h1:rQnyitMh5vyWlEHY0g/VzHw7UPT6c+CrFqvD1/udxYk= -github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1 h1:FrFngpnVCdYW+lUljqqj9CLfY7xzRrGdY7/AkSOG5EE= -github.com/aws/aws-sdk-go-v2/service/kafka v1.1.1/go.mod h1:VqHOqKal4FUR6PfZDazxEcI/IBxyXOwOKKYzmUu4kC8= -github.com/aws/aws-sdk-go-v2/service/kafka v1.1.2 h1:eqrZIKfAq3MdMyvJqGi04BTKa0GaTb3tJ61vCxV9PZs= -github.com/aws/aws-sdk-go-v2/service/kafka v1.1.2/go.mod h1:nkoTpTd7ublMkC2cW6B8ENuzkqm2c+lPC8gUuANYcXc= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1 h1:w6pCp3eYLGhIH+mkNVZkR2KdpMXulXLzkQhmXbHeHTE= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.1/go.mod h1:7GLbfWUWm4KRU04QHvxkZGIQDiUjLFD+nVZW8joexTo= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.2 h1:KUEcr+YtbaaZRcX3k76b0emV4eIYRyBS850rNpZmEOo= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.1.2/go.mod h1:eF+ZxxPk6z9suPUrY4tHB5ws7H/RrjBGhUaPc+fabmA= -github.com/aws/aws-sdk-go-v2/service/kms v1.1.1 h1:rK1edW1dLtSGr1551ttHqQopajK4Pv9C4ez70dVMQaI= -github.com/aws/aws-sdk-go-v2/service/kms v1.1.1/go.mod h1:6K5oOoDdnkW/h+Jv+xOA+tvgI6lwGBT9igkJGL1ypaY= -github.com/aws/aws-sdk-go-v2/service/kms v1.1.2 h1:6a+KQe3r7Wps9nJrasrEip0lWaC7W1gRUVFWZmewshs= -github.com/aws/aws-sdk-go-v2/service/kms v1.1.2/go.mod h1:+VMpFqykub/7QnLH3IGZNjBxv/r0SU/vNZAkYH0UMRU= -github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1 h1:ptubVb1eLQgZh7U4i+k2vpf3PlL4ZoTmGdTj+VowqqM= -github.com/aws/aws-sdk-go-v2/service/lambda v1.1.1/go.mod h1:iSHLnnmJNKoAUdzKnUFh4rIGM3V58fxa+XCYtRpeFX8= -github.com/aws/aws-sdk-go-v2/service/lambda v1.1.2 h1:gWD2WWNzhjHxfOBnJfprdln0bfadZRVqN1XRqAaFjvs= -github.com/aws/aws-sdk-go-v2/service/lambda v1.1.2/go.mod h1:+VGeaIpjijz/BfgOYFORiXQ09YU63raqpMgUmnI/TTk= -github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1 h1:lIftsFn6TsByMl+v32Y4ztGLIz/C4Rq7gat5AihCpdw= -github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.1/go.mod h1:9YtJbicAA2/uNt2VsIMWd6eapsIJn2o/0u0VJMAtrXo= -github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.2 h1:GF/6GXQm0Dc0IJ8FnPdsO+UOZbVUvAu5A1Q/k4k05kY= -github.com/aws/aws-sdk-go-v2/service/mediapackage v1.1.2/go.mod h1:AGGEf3XNZdEV/QAw1R7eoMrS+KQQG9st21uZDSLWmSM= -github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1 h1:tl/58Fn+6E9VTEmconNpPqDWSZM+aeV1DjI/sahJYLQ= -github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.1/go.mod h1:gevnsX8qzzxtNcZoSab72+PNtrfFmgb1n1Z4GKbgkxU= -github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.2 h1:38pNoa80JakLLw+8MK2nzGKSr2nu3lF2BUR7hJEiwz0= -github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.2/go.mod h1:/En11w0nGq9cGyi7nT3/eDWYI09X80ehr1vSK/HXU1Y= -github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1 h1:JPmFEmO4ycVquOwChmPJtC8Ct4oM1r3qEHwBdHZ4y3w= -github.com/aws/aws-sdk-go-v2/service/organizations v1.1.1/go.mod h1:goX7wNhH+gPuyYZX0AEJWm7cegEHyKnRLvZW4T4ZTgg= -github.com/aws/aws-sdk-go-v2/service/organizations v1.1.2 h1:1jPtLFCGgDp1HXr12J3F0eimT+u9905YPe3Mv7auGaE= -github.com/aws/aws-sdk-go-v2/service/organizations v1.1.2/go.mod h1:assIbGLsQCHk18EZqVmFBhaDFOOFMLimcP5m3xUPEY8= -github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1 h1:2yUiwjSgEdMO2zRvbFkMVB5+qIw33o+1uvsS+Vwt3LU= -github.com/aws/aws-sdk-go-v2/service/qldb v1.1.1/go.mod h1:PdAF531U/qcXoTn4/Ay+RCTXAiim7Z4zPPiJMSY0P+w= -github.com/aws/aws-sdk-go-v2/service/qldb v1.1.2 h1:Q3VtZOtO3m1dI9lQoTo8sBKqL9BUgUsikmzzWKMOrOc= -github.com/aws/aws-sdk-go-v2/service/qldb v1.1.2/go.mod h1:SsP+mhnGVJ7QWlw69rF6Xyqdc+yb+djO6mywM9jxM9s= -github.com/aws/aws-sdk-go-v2/service/rds v1.1.1 h1:bA0wFJBnOiEa5ZcNHt9vHlTjjjj/rFvCcQq7nqE36WI= -github.com/aws/aws-sdk-go-v2/service/rds v1.1.1/go.mod h1:5KthKjThUjPkKAfTTtqEreCr5Lu5zYu78xfiSxo9KF4= -github.com/aws/aws-sdk-go-v2/service/rds v1.1.2 h1:Ar6MBK7h/v/DG7NPPhDP0r0GAt/hQ6TKirArSrOsiEY= -github.com/aws/aws-sdk-go-v2/service/rds v1.1.2/go.mod h1:Cmncpj0/MRcbTBZlVLA52uG6KLt7MS6AKLSOu8/2wyc= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1 h1:uDSFv0UmCcrrqhRrTlP9l/YTSESnZkZIHdJVdVDYY/4= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.1/go.mod h1:21JHC8cArZT+J7hgQZgS+4kx8s9SdSFIqxOmiR+sGto= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.2 h1:/543Sv7iyf9v2emTiPreuQMw30cPww63p3qNAy3H424= -github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.1.2/go.mod h1:edifC1mludO1Kjyl28vavYSnKGl8uRT12d6DD8fBDzw= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 h1:cKr6St+CtC3/dl/rEBJvlk7A/IN5D5F02GNkGzfbtVU= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.2 h1:EbmfNO86YZtJq13e+/O3b53Lcc0joHa72YZmHglSpYY= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.2/go.mod h1:U5XfxTqYfmqJ0tg0nJEHJ0bUiBVNynZNHAp1iTjPLnE= -github.com/aws/aws-sdk-go-v2/service/s3 v1.1.0 h1:d3PK2s3MB8ikznU/tChWoWQM2EVHo+4ZymURcl9WVE4= -github.com/aws/aws-sdk-go-v2/service/s3 v1.1.0/go.mod h1:FunhqiuImyH0bxYm3xESmYTwq4dcESZQeaSAO4GjnTc= -github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 h1:p20kkvl+DwV3wYsnLGcmsspBzWGD6EsWKi/W+09Z1NI= -github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0/go.mod h1:nHAD0aOk81kN3xdNYzKg4g9JISKSwRdUUDEXOgIojf4= -github.com/aws/aws-sdk-go-v2/service/s3 v1.2.1 h1:3qn6YVXpOCK9seQ8ZilDyMrhpEUaZNaJG8SXNiCvk+c= -github.com/aws/aws-sdk-go-v2/service/s3 v1.2.1/go.mod h1:3xGOyhtPPD/WXJUljmb5+ZXhNyHa4h6wgL6mWOF6S0c= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 h1:tOZVE/wpwnCH6zMCvDi8WsuXLV1p5PG/WOhHu8LWphE= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1/go.mod h1:ytf+Mop8BTUFmWJSCI/U33FawS9A8UWwybOdNOXU6zE= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.2 h1:J9zvPLPGvytqa3YKGIzvehoJ621xViLT8Saohg6P73I= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.2/go.mod h1:dR9hUeYkCYyYoCpucS2v+vFsTJolTIY0tGMx9dU0ZnM= -github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1 h1:80QYiUXqf6EHmxhW3wk9VGaGuem7GAeW2TcJj7hc0Do= -github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.1/go.mod h1:M/Eb/iVz5QLNeFxNP10Ww6uYarHvm8X1SaTc23NhoYw= -github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.2 h1:hg/3XqtxR8jkR4BIMQ1CNQlgH9qEOKx+W5cQX0b8hnU= -github.com/aws/aws-sdk-go-v2/service/securityhub v1.1.2/go.mod h1:d/fZm2dIqyVVIcpKaA/2XNS25ptU5Gf/cxl97BlVLHo= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1 h1:5qx3KZq6WyQnX+gvLuU6sLBBWJulFrVn7sZoe+9GpJQ= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.1/go.mod h1:AxJdVkbAHbnhUhUP3cFgMGEe288M8+YDXW7gbcdqOtQ= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.2 h1:uy6kUZz0zMvGy/zbrMM3OheoJIAdta4XVgBwmBiPvOc= -github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.1.2/go.mod h1:VLwduJ5SSTiFygZ9C9nkAvZRrDwz41S6sE6QmAXbPdI= -github.com/aws/aws-sdk-go-v2/service/ses v1.1.1 h1:ZCT1HdrWSIt8014g2Wia7B1SpytNh9EGZ/qKpZvRVgA= -github.com/aws/aws-sdk-go-v2/service/ses v1.1.1/go.mod h1:U9bdibu41007uBclE2QUdURjHU6SzQKqxY5GKppL7gE= -github.com/aws/aws-sdk-go-v2/service/ses v1.1.2 h1:5n1KWIWnfW2wmM8EHleIMCkLy5iTNFQGb6d3ECtuChI= -github.com/aws/aws-sdk-go-v2/service/ses v1.1.2/go.mod h1:l3A3unXDxCFxL575zpT+oocWtgGWjjGlsMw1PbKoLjo= -github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1 h1:GexTkfjidovrPhnvLrX2ggMo7pooiZJfZw/K1MOwe/o= -github.com/aws/aws-sdk-go-v2/service/sfn v1.1.1/go.mod h1:e1kcDzRmGL4UoKqMcyJT344yqMivOXIftV+O1H6fixY= -github.com/aws/aws-sdk-go-v2/service/sfn v1.1.2 h1:bw+seei8F3mYN8qO2XVclA2uB/Qwntg1/0OlUL3lVms= -github.com/aws/aws-sdk-go-v2/service/sfn v1.1.2/go.mod h1:LCvBsFAWOoJYpQL4JTV04yyVVR1jTReDBtIPvAknaw4= -github.com/aws/aws-sdk-go-v2/service/sns v1.1.1 h1:5Js3R6coB5uI/h/Gua2Vm+uyuZrgmXs80zqtkOBumxk= -github.com/aws/aws-sdk-go-v2/service/sns v1.1.1/go.mod h1:V2HdUZQcKhcF58AwYU78fkQ5Drfw3qAGMUd9o1uvrf8= -github.com/aws/aws-sdk-go-v2/service/sns v1.1.2 h1:1U/FujyBEkNwrvANUcZFuVnAQqy0EAUEGToso5Dcijs= -github.com/aws/aws-sdk-go-v2/service/sns v1.1.2/go.mod h1:/vvAGyo3/TG5CSrJQarIlwzjE6O/DjBIvJTRkpYkvwA= -github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1 h1:T1fzWyfSgTNfFwpePwG9l0re3HWHprjUId/zy1Q4YvM= -github.com/aws/aws-sdk-go-v2/service/sqs v1.1.1/go.mod h1:vT8RRjBL5Z9KBZGGhjLcG6pngVLeq7MqySFsNdGFjSc= -github.com/aws/aws-sdk-go-v2/service/sqs v1.1.2 h1:sK05utknxyRwa9Tnu7b2dGir4kq9KXgi2moMmMoJiHc= -github.com/aws/aws-sdk-go-v2/service/sqs v1.1.2/go.mod h1:WE80cEEKvwrSokRKjw0rVRLpOMEmz/ohunPPz6RPFmE= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 h1:37QubsarExl5ZuCBlnRP+7l1tNwZPBSTqpTBrPH98RU= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.2 h1:9BnjX/ALn5uLo2DbgkwMpUkPL1VLQVBXcjZxqJBhf44= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.2/go.mod h1:5yU1oE3+CVYYLUsaHt2AVU3CJJZ6ER4pwsrRD1L2KSc= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 h1:TJoIfnIFubCX0ACVeJ0w46HEH5MwjwYN4iFhuYIhfIY= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.2 h1:7Kxqov7uQeP8WUEO0iHz3j9Bh0E1rJrn6cf/OGfcDds= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.2/go.mod h1:zu7rotIY9P4Aoc6ytqLP9jeYrECDHUODB5Gbp+BSHl8= -github.com/aws/aws-sdk-go-v2/service/swf v1.1.1 h1:EStZ7gUWjg5++OVEZu3xjfIkD8hD4dGqV+9EwHtjfDo= -github.com/aws/aws-sdk-go-v2/service/swf v1.1.1/go.mod h1:bbRKpQC4O12+BLlo6k67OyXWeJB8jWQwcmmKLrJgQVQ= -github.com/aws/aws-sdk-go-v2/service/swf v1.1.2 h1:TNCDYsj1WLfekK+WNabRV+PTOakCwzKE2OT0IaoKwNc= -github.com/aws/aws-sdk-go-v2/service/swf v1.1.2/go.mod h1:jhQ8uZUfrj9zoJ9GhZTj2eslbzwJTcPHfqom54yWkUo= -github.com/aws/aws-sdk-go-v2/service/waf v1.1.1 h1:ttI5GZs4+1gUrjkO9ghNbu1TQ2jyO3DloZ8DRozl0VQ= -github.com/aws/aws-sdk-go-v2/service/waf v1.1.1/go.mod h1:aSpFbfXuliA/KIQ6EfxYRXSJlnXpMfwUEPY7v5XtABw= -github.com/aws/aws-sdk-go-v2/service/waf v1.1.2 h1:SNjFmhoWRtKK7zH88GZdmKnJ8O6SmjV3o7rxCOTkOtU= -github.com/aws/aws-sdk-go-v2/service/waf v1.1.2/go.mod h1:W6aiAs0yNcOrWUPgAC09lDF7RzfMLCofr+5L5aXDUKU= -github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1 h1:4UytI/MUBqd9Be5DgWXwWuzSRvbt6S4B5toSgbAZlEw= -github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.1/go.mod h1:rcc9EDUl/wpNAF+7AvKKh/r2fP6kpl8buDxwQ5Ep6ak= -github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.2 h1:dglAiqNnf/P862T7vsusss7uD94QKOaHgQzJp982bx4= -github.com/aws/aws-sdk-go-v2/service/wafregional v1.1.2/go.mod h1:FLclarMnJVyBer8S2r1KRUnwFk9QeI3h0CGdNh6PDGk= -github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1 h1:QXIL9UoGbmATmspJ8v+OMp4er7K/q8ZQ5O0/iyfAG2w= -github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.1/go.mod h1:/EpCu/KcalvPnsyM8zYgXCQ+dStC43HbtCO0hInHZP8= -github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.2 h1:KHw96rJ+BR7WTACzs4OgJXJeNPtxqxyzHvResNRMSpI= -github.com/aws/aws-sdk-go-v2/service/workspaces v1.1.2/go.mod h1:g1xdhjBHekgd6TocTr7HaGXNwGwO4e2YoVw+RJz4i7M= -github.com/aws/aws-sdk-go-v2/service/xray v1.1.1 h1:KdBCrnM+HnMW/On4O6EQ9OhiM3Fz0hrpvMhzIRY1/eY= -github.com/aws/aws-sdk-go-v2/service/xray v1.1.1/go.mod h1:yXqbCaS1hC9CrShJsTrshudAvR/pspjeIRDbMpPRrC0= -github.com/aws/aws-sdk-go-v2/service/xray v1.1.2 h1:FEXG/2JtaWivdk30nXCJdJ6rPsd+cZIOAV62tpcOO8g= -github.com/aws/aws-sdk-go-v2/service/xray v1.1.2/go.mod h1:BrJBKpEUgTi0HcjOiUGGmhMG7XCEsuNnAr9ioc3cCxQ= -github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aws/smithy-go v1.1.0 h1:D6CSsM3gdxaGaqXnPgOBCeL6Mophqzu7KJOu7zW78sU= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/aws/aws-sdk-go-v2 v1.3.0/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+testmuQeRY= +github.com/aws/aws-sdk-go-v2 v1.3.1 h1:KKstwh6zsuUhQH3GvSor7M3am/+imPqydFOZHzlkTKc= +github.com/aws/aws-sdk-go-v2 v1.3.1/go.mod h1:5SmWRTjN6uTRFNCc7rR69xHsdcUJnthmaRHGDsYhpTE= +github.com/aws/aws-sdk-go-v2/config v1.1.4 h1:2hjdDldmJJjb+rFieQySfOFt4WwxKZJVTEB6RBI74T4= +github.com/aws/aws-sdk-go-v2/config v1.1.4/go.mod h1:op05ummoVoAqctpA80jVt/+hvEtLfuKmDyx0bIuvfbE= +github.com/aws/aws-sdk-go-v2/credentials v1.1.4 h1:whYYw2srG+zUQzUw4LhML83f+xd22Vm7gv0I7aJglc8= +github.com/aws/aws-sdk-go-v2/credentials v1.1.4/go.mod h1:UQwsT2w2XelrWoVV2v/zL2uce1RxmVCiHaZsoKLamZg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 h1:5gCrezE41xYQHWDsDkJD9nT22tUH3s+Zrvs4c3v2FGc= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5/go.mod h1:z/NKNlYxMzphl7TzjV+ctUebHF4CFNGGlSvmV/NKcJU= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 h1:G7NSCbvUWDp4B0ny7tjHfuZvadphb7M66/1cYN9AnAg= +github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0/go.mod h1:PMYdnRge1BUXxlvWhynvcT7ltjXevZ/pVV56B299wT0= +github.com/aws/aws-sdk-go-v2/service/acm v1.2.1 h1:s3Yka4ZE67lTTbSG7ZXlgwIjC122RkG6okTcrEbCBBY= +github.com/aws/aws-sdk-go-v2/service/acm v1.2.1/go.mod h1:X6p3MQnaIMOJ6+A1D7OfW3WKt7rJzgZzSeVkua6lZrg= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.2.1 h1:2kxNxcT9QVSckqagWevdNOAOCOAmGHsCbkowF6Rmur8= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.2.1/go.mod h1:4fO3jaFTaz/8ygZBVNSk4NSdAwcc/NZ++HUrG9kpJ0I= +github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1 h1:qHxx2jl6nI6Sn5fuXtBQVWbhaG+fErDAB47BHm+Kw1A= +github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1/go.mod h1:JkdNL71yKS0qmF+dFJJzxf1WJZWFGIhTepXHaxtKipE= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.2.1 h1:imL02JGNApN3z+9u/meTDeZF37QfpqRmrDnGghGNFvY= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.2.1/go.mod h1:bOqVTdQoE8zqisF2vwsiZxZLxLDCOjOvfFohzXsJ/vE= +github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3 h1:P2IXGUpF2t6gwy3QTPB82/wFarHkX6WVsHWs7nfaVWY= +github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3/go.mod h1:1NXNu5eiAZbLx6bK0Ir2X4MBXBO6JSMaPN3mdRaYZqo= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 h1:I2V5IX5pwXq/+TL5QeDcoq4MIcFgzQ/yxbf5KTEqm4Q= +github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3/go.mod h1:bT6aHBpfi2TFnyOvBe3IjZkI7cXYaZ0uEErZE1bMABM= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0 h1:+eHZIcEQ7jMuAAWL9uS9RfQz8ElLcRksWqXSIQ7essE= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0/go.mod h1:9PLAEZCkzDVh+/fq7OwOloe/RqSpqwes2x+ozcRyloM= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.2.1 h1:7Zh+ShMr7awq0s76kwca8efPiWOZaWV5267fa6avwOQ= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.2.1/go.mod h1:AlMkBlBn/pyqVYIDcHRkf2FQRm9q0czFdMOMn1SV8oQ= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.3 h1:otg0eUT5LROwUixNpOtjhYksgBurDIRi6ykUmsBBrA8= +github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.3/go.mod h1:mtJg2sJe7X8jm/cL/OIxJkPPPGQbHNgQnipZgN6a4MU= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.2.1 h1:egAyiJ8xpfed+I+8t+71OxyNr4Vbw1xRA+9EjSu15tU= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.2.1/go.mod h1:GtzMwrY6i7/RXMKBZAMXyXFmZ1UHxtxDeIiUO3lBXRI= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0 h1:fyDRD5nYw4WlTQpX7p5MjtKX1SkEs5pLHt0bt7Zn0/A= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0/go.mod h1:2qNhOhvtzQHNKkwipEb/n95O4pAfJy4ObXv0n+Ldkn8= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0 h1:gXHyajuXD6lC4iaznrJcFzxOyg0E7f94MpRKmJ4hwvU= +github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0/go.mod h1:oqhgyu/GPZZpma8mHoiUhqSwx2gSlxjccE9Lny3RR2g= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.1 h1:WWUXM0mAA5ktH0Z3lM75sCg0R0BI6piPShKad3+vwzA= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.1/go.mod h1:iSmaYEKTakAa/tT8Kal8gh14QUXNx+7/lHRjM7naTR0= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1 h1:Kn8KgAStqC7/FMP927qsWUUQJH9gw/ubKTuMqyKUpds= +github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1/go.mod h1:n5wJZmnZAZxSQDf7CnNpyTCOP9cjTGsmH1xkCs8Giy4= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.3 h1:Fw5BXP0L4PNdneYOv0B2znzErlgj70QNEc7HIjwJrUs= +github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.3/go.mod h1:8RUQJoX54ROI44zDHSk5sIoyyBaYmy2bdBv7XZmcpp0= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.2.1 h1:WEqfKQLKriwX7BQyUXfJzK/gO6wMelZxtwOHD2cyjeg= +github.com/aws/aws-sdk-go-v2/service/codedeploy v1.2.1/go.mod h1:yLCnpa5QV9tRDM7Hl+2sMgOsL1+Od9L/i9EmRUxBK5s= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.2.1 h1:rFLNwNLEB+1wvueAOwTmuGS2WM4tc4Ly9vidfA6642Q= +github.com/aws/aws-sdk-go-v2/service/codepipeline v1.2.1/go.mod h1:FQdcXAJhwsXv9IqpIQYw4FjpTtdUv/CMjQ/C54HuyIs= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.2.1 h1:SxtoHbLsxtdUMeKD3Gdd1hCxkXlT1s2qok/k4S9arbY= +github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.2.1/go.mod h1:uSWFf65jWgwb/QH4TlkQX4t6CL4jNEtJPFtGfC7fPb4= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.2.1 h1:fEO/gs2CUMpBAoOTuLRnaMGhKCgntz6ZYvmXDDY/nOc= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.2.1/go.mod h1:cv/vtBmaOXXxLctr2OdeDWGJAJiNJ3Ilh3VKi4NAiAA= +github.com/aws/aws-sdk-go-v2/service/configservice v1.3.0 h1:F1VtAhAtPq6TxgRlBlpG4dF2BG+udfvFEiuOMSBG6Jo= +github.com/aws/aws-sdk-go-v2/service/configservice v1.3.0/go.mod h1:iUPe1LAYqj8xaouHcns/bNEIcryZ7uuXVbcgj0SyT/k= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.3 h1:dF5BSnxQIaFmpNbi7ybcP76Aa2ODKiA2WKjXsa/tTKU= +github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.3/go.mod h1:KfO/6uA+14FbbKydAiDSRKYG+DwEhYr56ujLlCgJCnw= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.3 h1:6y0p4RYpzNH6B8dlbNXfVyMl55EQHvJAXw33OLffA7o= +github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.3/go.mod h1:0sLAFkQrOqjK9Nm9CtrAB36cBQGe8K/1PsFHVPiZbvI= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.1 h1:NnYXRukLvkiTnNyZHCCQcZaoWJSeE5Y7tCVPgvTyWfw= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.1/go.mod h1:WqAbIrpO0PSa3AIDxMG12aPPN4D1u99rOFdEfSM/KgY= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0 h1:y82WbYudKuiWx0KuKQheqTQ4RIF8ZHoHvS/rD8HCYCc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0/go.mod h1:KW2/Fgs+L1m1X53O9hTFpJqPtLyYGbf9j1Ay5xPSy74= +github.com/aws/aws-sdk-go-v2/service/ecr v1.2.1 h1:rdvoJaE51N1tuNc2B75vNsZu2P0xV6y7ibOAwNeb1mI= +github.com/aws/aws-sdk-go-v2/service/ecr v1.2.1/go.mod h1:iuqVazSEO7GWaX6WYrVWCVECL3ixXwhL6Q6RF4V2Db0= +github.com/aws/aws-sdk-go-v2/service/ecs v1.2.1 h1:T8CKZFKySyOivXUc/80qlvNqvX9MQvvRCxFQCL6xxQU= +github.com/aws/aws-sdk-go-v2/service/ecs v1.2.1/go.mod h1:7gzy9DNs3NWZnxJcV61X0EjhLzDuZm8uUA+moRIoiKs= +github.com/aws/aws-sdk-go-v2/service/efs v1.2.1 h1:Cm/7OSlvQVPQpksrq7FYXw75Uv1D8++CA6tcWMb6y38= +github.com/aws/aws-sdk-go-v2/service/efs v1.2.1/go.mod h1:4UVgbo/4cTvbn0Y+lU+Sq7gvNlY0zPbmn1JCqkGiyHs= +github.com/aws/aws-sdk-go-v2/service/eks v1.2.1 h1:eNSGiZZKcrjT1/UlxOSL/v1gjR5bePJk4xMdGBZXd1o= +github.com/aws/aws-sdk-go-v2/service/eks v1.2.1/go.mod h1:XGNXr+eBGsXebPMHCHHJEaOWaenvyybnUU+dsdKpDXg= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.2.1 h1:r2GU9mRLlZtKNQiB8A6LeKMlxG0BK/LXU+86uv3zUos= +github.com/aws/aws-sdk-go-v2/service/elasticache v1.2.1/go.mod h1:H/CnUlHdpSJ6bi4PTZn7H046nY+OF0O1ItZGpOHbZ1s= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.2.1 h1:ngD2ETQ+bmpE9dXIwpovAKfEqhK0SODf0EQDMY7qkMA= +github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.2.1/go.mod h1:h2ETsoGWjnQFCsd5aYeg6+sf/HqLo7Qr7OKjSe4Axs4= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.2.1 h1:jN/we+fXuZeye2ZIPAGCI8xV6MT/JiT1JnpRUgkmG2M= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.2.1/go.mod h1:2J/pAuvfB8TQHdrbVX3t4Udjv6Cd2JohqGnoMZHKhe0= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.2.1 h1:4fbYf4lBHxmT0r48Ll7+Ls7e68jFdAgGs/JFXYeUiJA= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.2.1/go.mod h1:SGDkclfP0NWhrOMlh6IUPKUWooGcfNP2bR1O58+SZSM= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.2.1 h1:abdGxf1AJqZJTKAV7b7RKlwG5tdB82tqcUrd4JCRop0= +github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.2.1/go.mod h1:OflbS5dnlP5cKuSTJUR4MEF/02a7yg5t6MjxhyyAPiQ= +github.com/aws/aws-sdk-go-v2/service/emr v1.2.1 h1:YHcDnfSGq/DfLqIU+qf1uZ3tXVr5kythLVet2zWQZFY= +github.com/aws/aws-sdk-go-v2/service/emr v1.2.1/go.mod h1:cAGYVhsN+3rqjZb0TO8FaNtfV++ItE3vWiqzQTAkQ1Q= +github.com/aws/aws-sdk-go-v2/service/firehose v1.2.1 h1:XG4P2vpReYdY920Pf0pze6O7h7SFUkyIRVNYHNWtA2Y= +github.com/aws/aws-sdk-go-v2/service/firehose v1.2.1/go.mod h1:Zt1lhxCqEWgjYOtpQp1zNg+KGz5GBrJ3Kh2CY3tuAM0= +github.com/aws/aws-sdk-go-v2/service/glue v1.3.0 h1:xnSuV0C7FGfe9+/GJ/2KOTFD3WMXtLdk8gZzxuuuIRM= +github.com/aws/aws-sdk-go-v2/service/glue v1.3.0/go.mod h1:ITzMOyWhffmh06X4DxvN85ww8Ppt0uZGh8Qcty22/yQ= +github.com/aws/aws-sdk-go-v2/service/iam v1.3.0 h1:V95YLxbxLGlTcFR0KMMSZEaudIxYCAhycSGcO7/Favs= +github.com/aws/aws-sdk-go-v2/service/iam v1.3.0/go.mod h1:gPUYT7MBEb30j9eAsJ17LN9KbXtD1uqKOOKesCC4tjc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 h1:iLFz4nrWkXMTFeVn0n99wRyc4Xib4SlDbtAM3h2z8P8= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3/go.mod h1:g3Xw4tO/W+ae4EMzkxB6nGnJ48cLM4i1Z61WmD+IKtY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5 h1:GbW4bbc1iED64aIL203xcGSfLzWOWuIdnKV0guMcJvg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5/go.mod h1:MW0O/RpmVpS6MWKn6W03XEJmqXlG7+d3iaYLzkd2fAc= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 h1:wCzfVBrF1QRQFacZn1ywE/o2p92FzfpDNI2aCpIv+sY= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1/go.mod h1:6A0VfJAnYwhcXzt7KsixOdFlITEH5NFl4QeYxlZ5TtQ= +github.com/aws/aws-sdk-go-v2/service/iot v1.2.0 h1:OTrzh5ew69Vd6x1zruCQ7B/dtcxwCQ5ohPJWwfkydKQ= +github.com/aws/aws-sdk-go-v2/service/iot v1.2.0/go.mod h1:YzUfLvXlWGDMednNccsykrwSJmVGy0YeD+XwH8nRcIg= +github.com/aws/aws-sdk-go-v2/service/kafka v1.2.1 h1:70IRtg4hU1mQ5aAtjEHPQR+KCeVIDwLOpvbofiSEODE= +github.com/aws/aws-sdk-go-v2/service/kafka v1.2.1/go.mod h1:2gy+VDVpxUvxQRdjpFlZNhXSjybrxnYrb9Byuzz855I= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.2.1 h1:MXy6AyLlbBYypXEsmK94l9yGjKKtxNaD/jFzVVOsnYQ= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.2.1/go.mod h1:ZdVDeEkxSDTPYDtb8kVxXzyOSBkAQVXCA9fanM45a/c= +github.com/aws/aws-sdk-go-v2/service/kms v1.2.1 h1:X77wgZdglt2hU9zZS3DufyJiR4ZGW4F5x72OauDMSsM= +github.com/aws/aws-sdk-go-v2/service/kms v1.2.1/go.mod h1:VJL8/fcYPX11A7hdOPAXtzU6+yDifhKW5MgwaA6HIwY= +github.com/aws/aws-sdk-go-v2/service/lambda v1.2.1 h1:U1AhnZgIHWCh6kIXuq6RkTptzU6szpDHjRbrA7g+99s= +github.com/aws/aws-sdk-go-v2/service/lambda v1.2.1/go.mod h1:lczLef9EKYeQQ23eksYHU/Qf8j+66FSlX+g+15ZEP+k= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1 h1:/NgTgipY3ADAqLp18q1dDomqHYULUrcD3v3XGdqIhT8= +github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1/go.mod h1:S3JR8Z73bcaBwD1ddXzMcEkR1FFptmmY9pbsmCVWfn0= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.4 h1:7ho72LnawdmIm8J8KdkLoLWgcsqLcS8oKBDuT3005wg= +github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.4/go.mod h1:kXoBJPOMmUdpMEqWUhEPolBoycGzLGUHS5a/mL1+y1k= +github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 h1:TvDVD1mBXP60NIHrqbP8uuzTf4vu48HlOm5jtoQQcW0= +github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1/go.mod h1:iy7PhC7Wxk3aRePrvaUU7ngXjcAedbTBeKYAYVhnvfI= +github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 h1:mQUBlaWu2q7RftA5O8psLn2wQTIJAQEX0eIp3dZOtxQ= +github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3/go.mod h1:PgBTgxJV+wffbLmlJB/zO0/lD8+mEbUzEK0LvPkbxXM= +github.com/aws/aws-sdk-go-v2/service/rds v1.2.1 h1:nh6V70gwG0bE6Ocz34rg5VZvmthKuDSa785CBpvY2g8= +github.com/aws/aws-sdk-go-v2/service/rds v1.2.1/go.mod h1:QQ6pD2d3AUbZblcKzZ5aJ58mMMfcofx2j8KAXcHe8rg= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1 h1:36JI8JwGQEH5JcRXdpWucey2jr+mSLZWEvLWZLo73PI= +github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1/go.mod h1:fS4Gj1TYWWpQB0qHsijLygpI6zUFkEwoHSf8ajXFTqQ= +github.com/aws/aws-sdk-go-v2/service/route53 v1.3.0 h1:uwKwx0iSdZyIwQmsMPtAoBjlRC1lFUAhx2c6HGWjfPM= +github.com/aws/aws-sdk-go-v2/service/route53 v1.3.0/go.mod h1:vwPNxNmptQ70lgw8W4EzuHKCygDpVvhjJ/Xri8cnF80= +github.com/aws/aws-sdk-go-v2/service/s3 v1.4.0 h1:045tK3IL+TxOSWWQyG199A0BYJ/Yhgk8XV9xo+nQkLQ= +github.com/aws/aws-sdk-go-v2/service/s3 v1.4.0/go.mod h1:zFD4go1gW0I/WxeGfCNSsz/BnZSJyu5arLPMPnw0gvQ= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.2.1 h1:g5UomfutRdIkbsqdGr4XyuVyTZM+sp7ySmnoU8zai9s= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.2.1/go.mod h1:5UqHs6oUHhBRimgTAWZJ1uXa+A8QFLbOCi5yRZxLQAs= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.2.1 h1:qZplAHGJFl16wbZAWEnP73dzATdJDBly6ccPfeSeffc= +github.com/aws/aws-sdk-go-v2/service/securityhub v1.2.1/go.mod h1:SI3V2iXBWczkoetsurbZjbTNv2rCJihbo5APtlDLbCQ= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.2.1 h1:/FTF3YGI/WxRnRKhruU1nyhR/gzgfYP0kQF7yIaqEjU= +github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.2.1/go.mod h1:bivtoAQvh328aJFiY3+h4lQpyv9kPjJAP/y/PCQbnVY= +github.com/aws/aws-sdk-go-v2/service/ses v1.2.1 h1:hHtrVZvqyYzXYzMyZb6ww8aOI7n3X61uughtdJ8v8E8= +github.com/aws/aws-sdk-go-v2/service/ses v1.2.1/go.mod h1:l6zMRkVtC7WmAxDPRo/WwHSu+TXTKITQDPse/OgoViY= +github.com/aws/aws-sdk-go-v2/service/sfn v1.2.1 h1:L9eiomAn2X5JnUbJs//EbLmbQAOwFIjxowjFTb1+mg0= +github.com/aws/aws-sdk-go-v2/service/sfn v1.2.1/go.mod h1:E0SrMJis5ShsOfbc+WIpmn9sr7IbJV6puIBaWipvadE= +github.com/aws/aws-sdk-go-v2/service/sns v1.2.1 h1:IVHrunoAsIp1OV445PE84mM+WArZChXrxNbFIx4uAWQ= +github.com/aws/aws-sdk-go-v2/service/sns v1.2.1/go.mod h1:23FVJ4I/AHqbkh4vMa1Cz6/vXMCuMLPkU9Pi4RCFgxk= +github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0 h1:iePzn4Gr4p5QKat3G7snhUvopc/lOj25ZiPJ4/PPzq8= +github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0/go.mod h1:9bo6m/Pes+TR6ORT97E1BkczbSgbpKB1qTyFt08s9yw= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 h1:Tr/SsFDXWN8rntdzTNrDs/MvuBXRCjY6xvJrPFUPKRM= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.4/go.mod h1:yQayEbOWH75NaKFylsFocBc3yanYEGndlOaH4i/Lvno= +github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 h1:1koRvKlZMN+FhTGV5f4q6vRHXNJzeZlPKzbs1/Y32Kg= +github.com/aws/aws-sdk-go-v2/service/sts v1.2.1/go.mod h1:L1LH5nHMXxdkKj057ZUx7Wi50CCrkZ+9jkTnBnY2j/w= +github.com/aws/aws-sdk-go-v2/service/swf v1.2.1 h1:oRzuG8uLuYbUysx6lSJ/h1yHItT7CCq8wNjKt2SO5Yo= +github.com/aws/aws-sdk-go-v2/service/swf v1.2.1/go.mod h1:8oZdl0gL0mdCdkAqDvr2f2DFNCWgFmiUnRSJv/4qQ8c= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.3 h1:IEGT5besMwoerkUfEI7WD/JhCKbHMXrMmaCC8T5vTHc= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.3/go.mod h1:44wRNKMQN6/Cq8XgtZOxwv9oQ92bbvUbb9HSFp5XDRA= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1 h1:Re8Uwffnndo9t8V46kT3aruMvVXHXUmuYKhIF1U9CBc= +github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1/go.mod h1:WvRSWmA7SJw0TbU0XKCo+oC/qsD/OR/tFRzTnq8FBpk= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1 h1:hSzpp50D6D37eIELSSpYwJ75e8XL9bvTzjspZgt4+5A= +github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1/go.mod h1:8k9EEz8LMNPUDENPlW0laaQkAZC2TbEYF+XNUu1lFLk= +github.com/aws/aws-sdk-go-v2/service/xray v1.2.1 h1:RiTWbH90tIuJNnZZys9HeqBfpT3oSPulh7fM7anPQiY= +github.com/aws/aws-sdk-go-v2/service/xray v1.2.1/go.mod h1:MZS769M8/1Xm4XYQydDJbvugo7dG8fXzsVU3J84QXzY= github.com/aws/smithy-go v1.2.0 h1:0PoGBWXkXDIyVdPaZW9gMhaGzj3UOAgTdiVoHuuZAFA= github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.3.0 h1:awbB2OJBZ/Txj+c4q+qhDQs3Ob0sRhBuIIkOD4Aq8yc= +github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= diff --git a/providers/aws/kms.go b/providers/aws/kms.go index d5f0315430..836ab46f95 100644 --- a/providers/aws/kms.go +++ b/providers/aws/kms.go @@ -20,6 +20,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/kms" + "github.com/aws/aws-sdk-go-v2/service/kms/types" ) var kmsAllowEmptyValues = []string{"tags."} @@ -44,17 +45,21 @@ func (g *KmsGenerator) InitResources() error { } func (g *KmsGenerator) addKeys(client *kms.Client) error { - p := kms.NewListKeysPaginator(client.ListKeysRequest(&kms.ListKeysInput{})) - for p.Next(context.Background()) { - for _, key := range p.CurrentPage().Keys { - keyDescription, err := client.DescribeKeyRequest(&kms.DescribeKeyInput{ + p := kms.NewListKeysPaginator(client, &kms.ListKeysInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, key := range page.Keys { + keyDescription, err := client.DescribeKey(context.TODO(), &kms.DescribeKeyInput{ KeyId: key.KeyId, - }).Send(context.TODO()) + }) if err != nil { log.Println(err) continue } - if keyDescription.KeyMetadata.KeyManager == kms.KeyManagerTypeCustomer { + if keyDescription.KeyMetadata.KeyManager == types.KeyManagerTypeCustomer { resource := terraformutils.NewResource( *key.KeyId, *key.KeyId, @@ -77,20 +82,24 @@ func (g *KmsGenerator) addKeys(client *kms.Client) error { } func (g *KmsGenerator) addAliases(client *kms.Client) error { - p := kms.NewListAliasesPaginator(client.ListAliasesRequest(&kms.ListAliasesInput{})) - for p.Next(context.Background()) { - for _, alias := range p.CurrentPage().Aliases { + p := kms.NewListAliasesPaginator(client, &kms.ListAliasesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, alias := range page.Aliases { if alias.TargetKeyId == nil { continue } - keyDescription, err := client.DescribeKeyRequest(&kms.DescribeKeyInput{ + keyDescription, err := client.DescribeKey(context.TODO(), &kms.DescribeKeyInput{ KeyId: alias.TargetKeyId, - }).Send(context.TODO()) + }) if err != nil { log.Println(err) continue } - if keyDescription.KeyMetadata.KeyManager == kms.KeyManagerTypeCustomer { + if keyDescription.KeyMetadata.KeyManager == types.KeyManagerTypeCustomer { resource := terraformutils.NewSimpleResource( *alias.AliasName, *alias.AliasName, @@ -107,11 +116,16 @@ func (g *KmsGenerator) addAliases(client *kms.Client) error { } func (g *KmsGenerator) addGrants(keyId *string, client *kms.Client) { - p := kms.NewListGrantsPaginator(client.ListGrantsRequest(&kms.ListGrantsInput{ + p := kms.NewListGrantsPaginator(client, &kms.ListGrantsInput{ KeyId: keyId, - })) - for p.Next(context.Background()) { - for _, grant := range p.CurrentPage().Grants { + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + log.Println(err) + return + } + for _, grant := range page.Grants { grantId := *grant.KeyId + ":" + *grant.GrantId resource := terraformutils.NewSimpleResource( grantId, @@ -124,7 +138,4 @@ func (g *KmsGenerator) addGrants(keyId *string, client *kms.Client) { g.Resources = append(g.Resources, resource) } } - if p.Err() != nil { - log.Println(p.Err()) - } } diff --git a/tests/aws/main.go b/tests/aws/main.go index a32bbc7f3b..ae7114c2aa 100644 --- a/tests/aws/main.go +++ b/tests/aws/main.go @@ -31,7 +31,7 @@ func main() { "import", "aws", "--regions=ap-southeast-1", - "--resources=s3", + "--resources=*", "--profile=personal", "--verbose", "--compact", From 22e72c6f7dab4604ebfdf829c05d025e6a2965dd Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sat, 3 Apr 2021 21:36:50 +0800 Subject: [PATCH 127/276] #549 linting --- providers/aws/aws_service.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/providers/aws/aws_service.go b/providers/aws/aws_service.go index b561e07d42..03fd64de4d 100644 --- a/providers/aws/aws_service.go +++ b/providers/aws/aws_service.go @@ -16,7 +16,6 @@ package aws import ( "context" - "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "os" "regexp" @@ -24,6 +23,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -41,19 +41,19 @@ func (s *AWSService) generateConfig() (aws.Config, error) { return *configCache, nil } - config, e := s.buildBaseConfig() + baseConfig, e := s.buildBaseConfig() if e != nil { - return config, e + return baseConfig, e } if s.Verbose { - config.ClientLogMode = aws.LogRequestWithBody & aws.LogResponseWithBody + baseConfig.ClientLogMode = aws.LogRequestWithBody & aws.LogResponseWithBody } - creds, e := config.Credentials.Retrieve(context.TODO()) + creds, e := baseConfig.Credentials.Retrieve(context.TODO()) if e != nil { - return config, e + return baseConfig, e } // terraform cannot ask for MFA token, so we need to pass STS session token, which might contain credentials with MFA requirement @@ -66,8 +66,8 @@ func (s *AWSService) generateConfig() (aws.Config, error) { os.Setenv("AWS_SESSION_TOKEN", creds.SessionToken) } } - configCache = &config - return config, nil + configCache = &baseConfig + return baseConfig, nil } func (s *AWSService) buildBaseConfig() (aws.Config, error) { From 3c8e03ed15dc44194689c47392e2e06d1aace09b Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 4 Apr 2021 01:33:41 +0800 Subject: [PATCH 128/276] #549 addressed all linting issues --- build/multi-build/main.go | 30 ++++--- providers/aws/cloudhsm.go | 1 + providers/aws/efs.go | 18 ++--- providers/aws/elastic_beanstalk.go | 2 + providers/aws/kinesis.go | 3 + providers/aws/kms.go | 10 +-- providers/aws/s3.go | 3 +- providers/datadog/user.go | 3 +- providers/ibm/cis.go | 96 ++++++----------------- providers/ibm/cloud_functions.go | 25 +++--- providers/ibm/container_cluster.go | 9 +-- providers/ibm/cos.go | 14 ++-- providers/ibm/database_elasticsearch.go | 5 +- providers/ibm/database_etcd.go | 5 +- providers/ibm/database_mongo.go | 5 +- providers/ibm/database_postgresql.go | 7 +- providers/ibm/database_rabbitmq.go | 5 +- providers/ibm/database_redis.go | 9 +-- providers/ibm/iam.go | 17 ++-- providers/ibm/ibm_is_floating_ip.go | 5 +- providers/ibm/ibm_is_flow_log.go | 5 +- providers/ibm/ibm_is_ike_policy.go | 5 +- providers/ibm/ibm_is_image.go | 5 +- providers/ibm/ibm_is_instance.go | 5 +- providers/ibm/ibm_is_instance_template.go | 5 +- providers/ibm/ibm_is_ipsec_policy.go | 5 +- providers/ibm/ibm_is_lb.go | 28 +++---- providers/ibm/ibm_is_network_acl.go | 5 +- providers/ibm/ibm_is_public_gateway.go | 5 +- providers/ibm/ibm_is_security_group.go | 8 +- providers/ibm/ibm_is_ssh_key.go | 3 +- providers/ibm/ibm_is_subnet.go | 5 +- providers/ibm/ibm_is_volume.go | 5 +- providers/ibm/ibm_is_vpc.go | 19 ++--- providers/ibm/ibm_is_vpn_gateway.go | 10 +-- providers/ibm/ibm_kp.go | 20 +++-- providers/ibm/ibm_private_dns.go | 42 ++++------ providers/ibm/ibm_provider.go | 2 +- providers/ibm/ibm_service.go | 2 +- providers/ibm/instance_groups.go | 28 +++---- providers/ibm/utils.go | 6 +- providers/ibm/vpc_cluster.go | 8 +- terraformutils/resource.go | 7 +- 43 files changed, 205 insertions(+), 300 deletions(-) diff --git a/build/multi-build/main.go b/build/multi-build/main.go index b078a6d938..e4dad148dd 100644 --- a/build/multi-build/main.go +++ b/build/multi-build/main.go @@ -15,7 +15,7 @@ const fileSuffix = ".go" const packageCmdPath = "cmd" func main() { - //provider := os.Args[1] + // provider := os.Args[1] allProviders := []string{} files, err := ioutil.ReadDir(packageCmdPath) if err != nil { @@ -23,8 +23,8 @@ func main() { } for _, f := range files { if strings.HasPrefix(f.Name(), filePrefix) { - providerName := strings.Replace(f.Name(), filePrefix, "", -1) - providerName = strings.Replace(providerName, fileSuffix, "", -1) + providerName := strings.ReplaceAll(f.Name(), filePrefix, "") + providerName = strings.ReplaceAll(providerName, fileSuffix, "") allProviders = append(allProviders, providerName) } } @@ -48,14 +48,17 @@ func main() { for _, f := range files { if strings.HasPrefix(f.Name(), filePrefix) { if !strings.HasPrefix(f.Name(), filePrefix+provider+fileSuffix) { - providerName := strings.Replace(f.Name(), filePrefix, "", -1) - providerName = strings.Replace(providerName, fileSuffix, "", -1) + providerName := strings.ReplaceAll(f.Name(), filePrefix, "") + providerName = strings.ReplaceAll(providerName, fileSuffix, "") deletedProvider = append(deletedProvider, providerName) } } } // move files for deleted providers - os.MkdirAll(packageCmdPath+"/tmp", os.ModePerm) + err := os.MkdirAll(packageCmdPath+"/tmp", os.ModePerm) + if err != nil { + log.Fatal("err:", err) + } for _, provider := range deletedProvider { err := os.Rename(packageCmdPath+"/"+filePrefix+provider+fileSuffix, packageCmdPath+"/tmp/"+filePrefix+provider+fileSuffix) if err != nil { @@ -65,6 +68,9 @@ func main() { // comment deleted providers in code rootCode, err := ioutil.ReadFile(packageCmdPath + "/root.go") + if err != nil { + log.Fatal("err:", err) + } lines := strings.Split(string(rootCode), "\n") newRootCodeLines := make([]string, len(lines)) for i, line := range lines { @@ -79,7 +85,10 @@ func main() { newRootCodeLines[i] = line } newRootCode := strings.Join(newRootCodeLines, "\n") - ioutil.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm) + err = ioutil.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm) + if err != nil { + log.Fatal("err:", err) + } // build.... cmd := exec.Command("go", "build", "-v", "-o", binaryName) @@ -94,8 +103,11 @@ func main() { } fmt.Println(outb.String()) - //revert code and files - ioutil.WriteFile(packageCmdPath+"/root.go", []byte(rootCode), os.ModePerm) + // revert code and files + err = ioutil.WriteFile(packageCmdPath+"/root.go", rootCode, os.ModePerm) + if err != nil { + log.Fatal("err:", err) + } for _, provider := range deletedProvider { err := os.Rename(packageCmdPath+"/tmp/"+filePrefix+provider+fileSuffix, "cmd/"+filePrefix+provider+fileSuffix) if err != nil { diff --git a/providers/aws/cloudhsm.go b/providers/aws/cloudhsm.go index a06ae2bf88..3ff973bb25 100644 --- a/providers/aws/cloudhsm.go +++ b/providers/aws/cloudhsm.go @@ -16,6 +16,7 @@ package aws import ( "context" + "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2" "github.com/GoogleCloudPlatform/terraformer/terraformutils" diff --git a/providers/aws/efs.go b/providers/aws/efs.go index 1f7eedf231..3008d1a0bd 100644 --- a/providers/aws/efs.go +++ b/providers/aws/efs.go @@ -17,9 +17,9 @@ package aws import ( "context" "fmt" - "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/aws/aws-sdk-go-v2/service/efs" ) @@ -71,8 +71,8 @@ func (g *EfsGenerator) loadFileSystem(svc *efs.Client) error { } for _, mountTarget := range targetsResponse.MountTargets { g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - aws.StringValue(mountTarget.MountTargetId), - aws.StringValue(mountTarget.MountTargetId), + StringValue(mountTarget.MountTargetId), + StringValue(mountTarget.MountTargetId), "aws_efs_mount_target", "aws", efsAllowEmptyValues)) @@ -85,14 +85,14 @@ func (g *EfsGenerator) loadFileSystem(svc *efs.Client) error { fmt.Println(err.Error()) continue } - escapedPolicy := g.escapeAwsInterpolation(aws.StringValue(policyResponse.Policy)) + escapedPolicy := g.escapeAwsInterpolation(StringValue(policyResponse.Policy)) g.Resources = append(g.Resources, terraformutils.NewResource( - aws.StringValue(fileSystem.FileSystemId), - aws.StringValue(fileSystem.FileSystemId), + StringValue(fileSystem.FileSystemId), + StringValue(fileSystem.FileSystemId), "aws_efs_file_system_policy", "aws", map[string]string{ - "file_system_id": aws.StringValue(fileSystem.FileSystemId), + "file_system_id": StringValue(fileSystem.FileSystemId), "policy": fmt.Sprintf(`< 0 { request = kinesis.ListStreamsInput{ ExclusiveStartStreamName: &results.StreamNames[len(results.StreamNames)-1], diff --git a/providers/aws/kms.go b/providers/aws/kms.go index 836ab46f95..64884a3749 100644 --- a/providers/aws/kms.go +++ b/providers/aws/kms.go @@ -115,9 +115,9 @@ func (g *KmsGenerator) addAliases(client *kms.Client) error { return nil } -func (g *KmsGenerator) addGrants(keyId *string, client *kms.Client) { +func (g *KmsGenerator) addGrants(keyID *string, client *kms.Client) { p := kms.NewListGrantsPaginator(client, &kms.ListGrantsInput{ - KeyId: keyId, + KeyId: keyID, }) for p.HasMorePages() { page, err := p.NextPage(context.TODO()) @@ -126,10 +126,10 @@ func (g *KmsGenerator) addGrants(keyId *string, client *kms.Client) { return } for _, grant := range page.Grants { - grantId := *grant.KeyId + ":" + *grant.GrantId + grantID := *grant.KeyId + ":" + *grant.GrantId resource := terraformutils.NewSimpleResource( - grantId, - grantId, + grantID, + grantID, "aws_kms_grant", "aws", kmsAllowEmptyValues, diff --git a/providers/aws/s3.go b/providers/aws/s3.go index 03270c3909..93ba3b48f7 100644 --- a/providers/aws/s3.go +++ b/providers/aws/s3.go @@ -17,9 +17,10 @@ package aws import ( "context" "fmt" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" "log" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/s3" ) diff --git a/providers/datadog/user.go b/providers/datadog/user.go index ebf6746008..6e0af1a49d 100644 --- a/providers/datadog/user.go +++ b/providers/datadog/user.go @@ -17,9 +17,10 @@ package datadog import ( "context" "fmt" - datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" "github.com/GoogleCloudPlatform/terraformer/terraformutils" + + datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" ) var ( diff --git a/providers/ibm/cis.go b/providers/ibm/cis.go index f553bdada4..93e3a621de 100644 --- a/providers/ibm/cis.go +++ b/providers/ibm/cis.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/session" @@ -41,8 +41,7 @@ type CISGenerator struct { } func (g CISGenerator) loadInstances(crn, name, resGrpID string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( crn, name, "ibm_cis", @@ -56,8 +55,7 @@ func (g CISGenerator) loadInstances(crn, name, resGrpID string) terraformutils.R } func (g CISGenerator) loadDomains(crn, domainID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s", domainID, crn), domainID, "ibm_cis_domain", @@ -71,8 +69,7 @@ func (g CISGenerator) loadDomains(crn, domainID string, dependsOn []string) terr } func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", dnsRecordID, domainID, crn), dnsRecordID, "ibm_cis_dns_record", @@ -86,8 +83,7 @@ func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string, dependsO } func (g CISGenerator) loadFirewallLockdown(resourceName, crn, domainID, fID, fType string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s:%s", fType, fID, domainID, crn), resourceName, "ibm_cis_firewall", @@ -101,8 +97,7 @@ func (g CISGenerator) loadFirewallLockdown(resourceName, crn, domainID, fID, fTy } func (g CISGenerator) loadDomainSettings(crn, dID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s", dID, crn), dID, "ibm_cis_domain_settings", @@ -116,8 +111,7 @@ func (g CISGenerator) loadDomainSettings(crn, dID string, dependsOn []string) te } func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", gID, dID, crn), fmt.Sprintf("%s:%s:%s", gID, dID, crn), "ibm_cis_global_load_balancer", @@ -130,20 +124,8 @@ func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string, dependsOn []strin return resources } -func (g CISGenerator) loadGlobalBalancerPool(crn, pID string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( - fmt.Sprintf("%s:%s", pID, crn), - pID, - "ibm_cis_origin_pool", - g.ProviderName, - []string{}) - return resources -} - func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s", gblmID, crn), gblmID, "ibm_cis_healthcheck", @@ -157,8 +139,7 @@ func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID string, dependsOn [] } func (g CISGenerator) loadRateLimit(resourceName, crn, dID, rID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", rID, dID, crn), resourceName, "ibm_cis_rate_limit", @@ -172,8 +153,7 @@ func (g CISGenerator) loadRateLimit(resourceName, crn, dID, rID string, dependsO } func (g CISGenerator) loadEdgeFunctionAction(crn, dID, actionID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", actionID, dID, crn), actionID, "ibm_cis_edge_functions_action", @@ -187,8 +167,7 @@ func (g CISGenerator) loadEdgeFunctionAction(crn, dID, actionID string, dependsO } func (g CISGenerator) loadEdgeFunctionTrigger(crn, dID, triggerID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", triggerID, dID, crn), triggerID, "ibm_cis_edge_functions_trigger", @@ -201,22 +180,8 @@ func (g CISGenerator) loadEdgeFunctionTrigger(crn, dID, triggerID string, depend return resources } -func (g CISGenerator) loadWafRulePackage(crn, dID, pkgID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( - fmt.Sprintf("%s:%s:%s", pkgID, dID, crn), - pkgID, - "ibm_cis_waf_package", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{}) - return resources -} - -func (g CISGenerator) loadPageRule(crn, dID, ruleID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( +func (g CISGenerator) loadPageRule(crn, dID, ruleID string) terraformutils.Resource { + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", ruleID, dID, crn), ruleID, "ibm_cis_page_rule", @@ -227,19 +192,6 @@ func (g CISGenerator) loadPageRule(crn, dID, ruleID string, dependsOn []string) return resources } -func (g CISGenerator) loadCustomPage(crn, dID, cpID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( - fmt.Sprintf("%s:%s:%s", cpID, dID, crn), - cpID, - "ibm_cis_custom_page", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{}) - return resources -} - // InitResources .. func (g *CISGenerator) InitResources() error { DefaultCisURL := "https://api.cis.cloud.ibm.com" @@ -288,7 +240,7 @@ func (g *CISGenerator) InitResources() error { } for _, c := range cisInstances { - //Instance + // Instance crn := c.Crn.String() g.Resources = append(g.Resources, g.loadInstances(crn, c.Name, c.ResourceGroupID)) @@ -296,7 +248,7 @@ func (g *CISGenerator) InitResources() error { cisDependsOn = append(cisDependsOn, "ibm_cis."+terraformutils.TfSanitize(c.Name)) - //Domain + // Domain zoneOpts := &zonesv1.ZonesV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ @@ -316,7 +268,7 @@ func (g *CISGenerator) InitResources() error { return err } - //Health Monitor + // Health Monitor gblmOpts := &globalloadbalancermonitorv1.GlobalLoadBalancerMonitorV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, @@ -342,7 +294,7 @@ func (g *CISGenerator) InitResources() error { g.Resources = append(g.Resources, g.loadDomains(crn, *z.ID, domainDependsOn)) - //DNS Record + // DNS Record zoneID := *z.ID dnsOpts := &dnsrecordsv1.DnsRecordsV1Options{ URL: DefaultCisURL, @@ -353,7 +305,7 @@ func (g *CISGenerator) InitResources() error { ZoneIdentifier: &zoneID, } - //Domain Setting + // Domain Setting g.Resources = append(g.Resources, g.loadDomainSettings(crn, *z.ID, domainDependsOn)) dnsService, err := dnsrecordsv1.NewDnsRecordsV1(dnsOpts) @@ -367,7 +319,7 @@ func (g *CISGenerator) InitResources() error { return err } - //IBM Network CIS WAF Package + // IBM Network CIS WAF Package // cisWAFPackageOpt := &wafrulepackagesapiv1.WafRulePackagesApiV1Options{ // URL: DefaultCisURL, // Authenticator: &core.BearerTokenAuthenticator{ @@ -387,7 +339,7 @@ func (g *CISGenerator) InitResources() error { // //g.Resources = append(g.Resources, g.loadWafRulePackage(crn, *z.ID, *wafPkg.ID, domainDependsOn)) // } - //IBM Network CIS Page Rules + // IBM Network CIS Page Rules cisPageRuleOpt := &pageruleapiv1.PageRuleApiV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ @@ -403,10 +355,10 @@ func (g *CISGenerator) InitResources() error { } for _, pg := range cisPgList.Result { - g.Resources = append(g.Resources, g.loadPageRule(crn, *z.ID, *pg.ID, domainDependsOn)) + g.Resources = append(g.Resources, g.loadPageRule(crn, *z.ID, *pg.ID)) } - //Rate Limit + // Rate Limit rateLimitPoolOpts := &zoneratelimitsv1.ZoneRateLimitsV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, @@ -425,7 +377,7 @@ func (g *CISGenerator) InitResources() error { g.Resources = append(g.Resources, g.loadRateLimit(resourceName, crn, *z.ID, *rl.ID, domainDependsOn)) } - //Firewall Lockdown + // Firewall Lockdown firewallOpts := &zonelockdownv1.ZoneLockdownV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ @@ -482,7 +434,7 @@ func (g *CISGenerator) InitResources() error { g.Resources = append(g.Resources, g.loadDNSRecords(crn, *z.ID, *d.ID, domainDependsOn)) - //Global Load Balancer + // Global Load Balancer gblSetttingOpts := &globalloadbalancerv1.GlobalLoadBalancerV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ diff --git a/providers/ibm/cloud_functions.go b/providers/ibm/cloud_functions.go index 40c8995a8c..a68f3db008 100644 --- a/providers/ibm/cloud_functions.go +++ b/providers/ibm/cloud_functions.go @@ -36,8 +36,7 @@ type CloudFunctionGenerator struct { } func (g CloudFunctionGenerator) loadPackages(namespace, pkgName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s", namespace, pkgName), pkgName, "ibm_function_package", @@ -49,8 +48,7 @@ func (g CloudFunctionGenerator) loadPackages(namespace, pkgName string) terrafor } func (g CloudFunctionGenerator) loadRules(namespace, ruleName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s", namespace, ruleName), ruleName, "ibm_function_rule", @@ -62,8 +60,7 @@ func (g CloudFunctionGenerator) loadRules(namespace, ruleName string) terraformu } func (g CloudFunctionGenerator) loadTriggers(namespace, triggerName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s:%s", namespace, triggerName), triggerName, "ibm_function_trigger", @@ -147,22 +144,18 @@ func (g *CloudFunctionGenerator) InitResources() error { } for _, n := range nsList.Namespaces { - var dependsOn []string - dependsOn = append(dependsOn, - "ibm_function_namespace."+terraformutils.TfSanitize(n.GetID())) - - //Namespace + // Namespace if n.IsCf() { continue } - //Build whisk object + // Build whisk object wskClient, err := setupOpenWhiskClientConfigIAM(n, sess.Config, region) if err != nil { return err } - //Package + // Package packageService := wskClient.Packages pkgOptions := &whisk.PackageListOptions{ Limit: 100, @@ -177,7 +170,7 @@ func (g *CloudFunctionGenerator) InitResources() error { g.Resources = append(g.Resources, g.loadPackages(n.GetName(), p.GetName())) } - //Action + // Action actionService := wskClient.Actions actionOptions := &whisk.ActionListOptions{ Limit: 100, @@ -218,7 +211,7 @@ func (g *CloudFunctionGenerator) InitResources() error { } } - //Rule + // Rule ruleService := wskClient.Rules ruleOptions := &whisk.RuleListOptions{ Limit: 100, @@ -233,7 +226,7 @@ func (g *CloudFunctionGenerator) InitResources() error { g.Resources = append(g.Resources, g.loadRules(n.GetName(), r.Name)) } - //Triggers + // Triggers triggerService := wskClient.Triggers triggerOptions := &whisk.TriggerListOptions{ Limit: 100, diff --git a/providers/ibm/container_cluster.go b/providers/ibm/container_cluster.go index a6c69f3800..bab27a34ea 100644 --- a/providers/ibm/container_cluster.go +++ b/providers/ibm/container_cluster.go @@ -29,8 +29,7 @@ type ContainerClusterGenerator struct { } func (g ContainerClusterGenerator) loadcluster(clustersID, clusterName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( clustersID, clusterName, "ibm_container_cluster", @@ -40,8 +39,7 @@ func (g ContainerClusterGenerator) loadcluster(clustersID, clusterName string) t } func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", clustersID, poolID), poolID, "ibm_container_worker_pool", @@ -55,8 +53,7 @@ func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID string, de } func (g ContainerClusterGenerator) loadWorkerPoolZones(clustersID, poolID, zoneID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", clustersID, poolID, zoneID), fmt.Sprintf("%s/%s/%s", clustersID, poolID, zoneID), "ibm_container_worker_pool_zone_attachment", diff --git a/providers/ibm/cos.go b/providers/ibm/cos.go index 1fc3449b38..6f02ef8ad8 100644 --- a/providers/ibm/cos.go +++ b/providers/ibm/cos.go @@ -37,8 +37,7 @@ type COSGenerator struct { } func (g COSGenerator) loadCOS(cosID string, cosName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( cosID, cosName, "ibm_resource_instance", @@ -48,8 +47,7 @@ func (g COSGenerator) loadCOS(cosID string, cosName string) terraformutils.Resou } func (g COSGenerator) loadCOSBuckets(bucketID, bucketName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( bucketID, bucketName, "ibm_cos_bucket", @@ -98,9 +96,9 @@ func (g *COSGenerator) InitResources() error { s3Conf := ibmaws.NewConfig().WithCredentials(ibmiam.NewStaticCredentials(ibmaws.NewConfig(), authEndpoint, os.Getenv("IC_API_KEY"), cs.ID)).WithS3ForcePathStyle(true).WithEndpoint("s3.us-south.cloud-object-storage.appdomain.cloud") s3Sess := cossession.Must(cossession.NewSession()) s3Client := coss3.New(s3Sess, s3Conf) - singleSiteLocationRegex, _ := regexp.Compile("^[a-z]{3}[0-9][0-9]-[a-z]{4,8}$") - regionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{2,5}-[a-z]{4,8}$") - crossRegionLocationRegex, _ := regexp.Compile("^[a-z]{2}-[a-z]{4,8}$") + singleSiteLocationRegex := regexp.MustCompile("^[a-z]{3}[0-9][0-9]-[a-z]{4,8}$") + regionLocationRegex := regexp.MustCompile("^[a-z]{2}-[a-z]{2,5}-[a-z]{4,8}$") + crossRegionLocationRegex := regexp.MustCompile("^[a-z]{2}-[a-z]{4,8}$") d, _ := s3Client.ListBucketsExtended(&coss3.ListBucketsExtendedInput{}) for _, b := range d.Buckets { var dependsOn []string @@ -120,7 +118,7 @@ func (g *COSGenerator) InitResources() error { apiType = "crl" location = strings.Split(bLocationConstraint, "-")[0] } - bucketID := fmt.Sprintf("%s:%s:%s:meta:%s:%s", strings.Replace(cs.ID, "::", "", -1), "bucket", *b.Name, apiType, location) + bucketID := fmt.Sprintf("%s:%s:%s:meta:%s:%s", strings.ReplaceAll(cs.ID, "::", ""), "bucket", *b.Name, apiType, location) g.Resources = append(g.Resources, g.loadCOSBuckets(bucketID, *b.Name, dependsOn)) } } diff --git a/providers/ibm/database_elasticsearch.go b/providers/ibm/database_elasticsearch.go index 6ab5f87ed3..282bfb801c 100644 --- a/providers/ibm/database_elasticsearch.go +++ b/providers/ibm/database_elasticsearch.go @@ -31,8 +31,7 @@ type DatabaseElasticSearchGenerator struct { // loadElasticSearchDB ... func (g DatabaseElasticSearchGenerator) loadElasticSearchDB(dbID string, dbName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( dbID, dbName, "ibm_database", @@ -41,7 +40,7 @@ func (g DatabaseElasticSearchGenerator) loadElasticSearchDB(dbID string, dbName return resources } -//InitResources ... +// InitResources ... func (g *DatabaseElasticSearchGenerator) InitResources() error { region := os.Getenv("IC_REGION") diff --git a/providers/ibm/database_etcd.go b/providers/ibm/database_etcd.go index 23885c11d3..94236b52e3 100644 --- a/providers/ibm/database_etcd.go +++ b/providers/ibm/database_etcd.go @@ -31,8 +31,7 @@ type DatabaseETCDGenerator struct { // loadETCDDB ... func (g DatabaseETCDGenerator) loadETCDDB(dbID string, dbName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( dbID, dbName, "ibm_database", @@ -41,7 +40,7 @@ func (g DatabaseETCDGenerator) loadETCDDB(dbID string, dbName string) terraformu return resources } -//InitResources ... +// InitResources ... func (g *DatabaseETCDGenerator) InitResources() error { region := os.Getenv("IC_REGION") diff --git a/providers/ibm/database_mongo.go b/providers/ibm/database_mongo.go index 65a8d67434..08a8bef014 100644 --- a/providers/ibm/database_mongo.go +++ b/providers/ibm/database_mongo.go @@ -31,8 +31,7 @@ type DatabaseMongoGenerator struct { // loadMongoDB ... func (g DatabaseMongoGenerator) loadMongoDB(dbID string, dbName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( dbID, dbName, "ibm_database", @@ -41,7 +40,7 @@ func (g DatabaseMongoGenerator) loadMongoDB(dbID string, dbName string) terrafor return resources } -//InitResources ... +// InitResources ... func (g *DatabaseMongoGenerator) InitResources() error { region := os.Getenv("IC_REGION") diff --git a/providers/ibm/database_postgresql.go b/providers/ibm/database_postgresql.go index fff1aa29c4..e3546b17e5 100644 --- a/providers/ibm/database_postgresql.go +++ b/providers/ibm/database_postgresql.go @@ -18,7 +18,7 @@ import ( "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/session" @@ -31,8 +31,7 @@ type DatabasePostgresqlGenerator struct { // loadPostgresqlDB ... func (g DatabasePostgresqlGenerator) loadPostgresqlDB(dbID string, dbName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( dbID, dbName, "ibm_database", @@ -41,7 +40,7 @@ func (g DatabasePostgresqlGenerator) loadPostgresqlDB(dbID string, dbName string return resources } -//InitResources ... +// InitResources ... func (g *DatabasePostgresqlGenerator) InitResources() error { region := os.Getenv("IC_REGION") bmxConfig := &bluemix.Config{ diff --git a/providers/ibm/database_rabbitmq.go b/providers/ibm/database_rabbitmq.go index 97c5f3fd9f..571baacbe6 100644 --- a/providers/ibm/database_rabbitmq.go +++ b/providers/ibm/database_rabbitmq.go @@ -31,8 +31,7 @@ type DatabaseRabbitMQGenerator struct { // loadRabbitMQDB ... func (g DatabaseRabbitMQGenerator) loadRabbitMQDB(dbID string, dbName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( dbID, dbName, "ibm_database", @@ -41,7 +40,7 @@ func (g DatabaseRabbitMQGenerator) loadRabbitMQDB(dbID string, dbName string) te return resources } -//InitResources ... +// InitResources ... func (g *DatabaseRabbitMQGenerator) InitResources() error { region := os.Getenv("IC_REGION") diff --git a/providers/ibm/database_redis.go b/providers/ibm/database_redis.go index c1b87fab2b..206fd51d2a 100644 --- a/providers/ibm/database_redis.go +++ b/providers/ibm/database_redis.go @@ -18,21 +18,20 @@ import ( "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/session" ) -//DatabaseRedisGenerator ... +// DatabaseRedisGenerator ... type DatabaseRedisGenerator struct { IBMService } // loadRedisDB ... func (g DatabaseRedisGenerator) loadRedisDB(dbID string, dbName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( dbID, dbName, "ibm_database", @@ -41,7 +40,7 @@ func (g DatabaseRedisGenerator) loadRedisDB(dbID string, dbName string) terrafor return resources } -//InitResources ... +// InitResources ... func (g *DatabaseRedisGenerator) InitResources() error { region := os.Getenv("IC_REGION") diff --git a/providers/ibm/iam.go b/providers/ibm/iam.go index 000e2409da..f6a849521f 100644 --- a/providers/ibm/iam.go +++ b/providers/ibm/iam.go @@ -32,8 +32,7 @@ type IAMGenerator struct { } func (g IAMGenerator) loadUserPolicies(policyID string, user string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( fmt.Sprintf("%s/%s", user, policyID), policyID, "ibm_iam_user_policy", @@ -43,8 +42,7 @@ func (g IAMGenerator) loadUserPolicies(policyID string, user string) terraformut } func (g IAMGenerator) loadAccessGroups(grpID string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( grpID, grpID, "ibm_iam_access_group", @@ -54,8 +52,7 @@ func (g IAMGenerator) loadAccessGroups(grpID string) terraformutils.Resource { } func (g IAMGenerator) loadAccessGroupMembers(grpID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, grpID), grpID, "ibm_iam_access_group_members", @@ -69,8 +66,7 @@ func (g IAMGenerator) loadAccessGroupMembers(grpID string, dependsOn []string) t } func (g IAMGenerator) loadAccessGroupPolicies(grpID, policyID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, policyID), policyID, "ibm_iam_access_group_policy", @@ -84,8 +80,7 @@ func (g IAMGenerator) loadAccessGroupPolicies(grpID, policyID string, dependsOn } func (g IAMGenerator) loadAccessGroupDynamicPolicies(grpID, ruleID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, ruleID), ruleID, "ibm_iam_access_group_dynamic_rule", @@ -172,7 +167,7 @@ func (g *IAMGenerator) InitResources() error { Type: iampapv1.AccessPolicyType, }) if err != nil { - return fmt.Errorf("Error retrieving access group policy: %s", err) + return fmt.Errorf("error retrieving access group policy: %s", err) } for _, p := range policies { g.Resources = append(g.Resources, g.loadAccessGroupPolicies(group.ID, p.ID, dependsOn)) diff --git a/providers/ibm/ibm_is_floating_ip.go b/providers/ibm/ibm_is_floating_ip.go index 495db7cec5..7b3eb08fbc 100644 --- a/providers/ibm/ibm_is_floating_ip.go +++ b/providers/ibm/ibm_is_floating_ip.go @@ -30,8 +30,7 @@ type FloatingIPGenerator struct { } func (g FloatingIPGenerator) createFloatingIPResources(fipID, fipName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( fipID, fipName, "ibm_is_floating_ip", @@ -65,7 +64,7 @@ func (g *FloatingIPGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.FloatingIP{} + var allrecs []vpcv1.FloatingIP for { options := &vpcv1.ListFloatingIpsOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_flow_log.go b/providers/ibm/ibm_is_flow_log.go index e62e92383c..8db4279e7d 100644 --- a/providers/ibm/ibm_is_flow_log.go +++ b/providers/ibm/ibm_is_flow_log.go @@ -30,8 +30,7 @@ type FlowLogGenerator struct { } func (g FlowLogGenerator) createFlowLogResources(flogID, flogName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( flogID, flogName, "ibm_is_flow_log", @@ -65,7 +64,7 @@ func (g *FlowLogGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.FlowLogCollector{} + var allrecs []vpcv1.FlowLogCollector for { options := &vpcv1.ListFlowLogCollectorsOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_ike_policy.go b/providers/ibm/ibm_is_ike_policy.go index e054e7ff74..3c0faace36 100644 --- a/providers/ibm/ibm_is_ike_policy.go +++ b/providers/ibm/ibm_is_ike_policy.go @@ -30,8 +30,7 @@ type IkeGenerator struct { } func (g IkeGenerator) createIkeResources(ikeID, ikeName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( ikeID, ikeName, "ibm_is_ike_policy", @@ -60,7 +59,7 @@ func (g *IkeGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.IkePolicy{} + var allrecs []vpcv1.IkePolicy for { options := &vpcv1.ListIkePoliciesOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_image.go b/providers/ibm/ibm_is_image.go index b481bda68a..ddc2636a29 100644 --- a/providers/ibm/ibm_is_image.go +++ b/providers/ibm/ibm_is_image.go @@ -30,8 +30,7 @@ type ImageGenerator struct { } func (g ImageGenerator) createImageResources(imageID, imageName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( imageID, imageName, "ibm_is_image", @@ -66,7 +65,7 @@ func (g *ImageGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.Image{} + var allrecs []vpcv1.Image for { options := &vpcv1.ListImagesOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_instance.go b/providers/ibm/ibm_is_instance.go index 0f1284d608..ffdae94482 100644 --- a/providers/ibm/ibm_is_instance.go +++ b/providers/ibm/ibm_is_instance.go @@ -29,8 +29,7 @@ type InstanceGenerator struct { } func (g InstanceGenerator) createInstanceResources(instanceID, instanceName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( instanceID, instanceName, "ibm_is_instance", @@ -65,7 +64,7 @@ func (g *InstanceGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.Instance{} + var allrecs []vpcv1.Instance for { options := &vpcv1.ListInstancesOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_instance_template.go b/providers/ibm/ibm_is_instance_template.go index d54d776257..8bf2aca912 100644 --- a/providers/ibm/ibm_is_instance_template.go +++ b/providers/ibm/ibm_is_instance_template.go @@ -29,8 +29,7 @@ type InstanceTemplateGenerator struct { } func (g InstanceTemplateGenerator) createInstanceTemplateResources(templateID, templateName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( templateID, templateName, "ibm_is_instance_template", @@ -44,7 +43,7 @@ func (g *InstanceTemplateGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - return fmt.Errorf("No API key set") + return fmt.Errorf("no API key set") } vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) diff --git a/providers/ibm/ibm_is_ipsec_policy.go b/providers/ibm/ibm_is_ipsec_policy.go index c2eb44530a..f3a72744a8 100644 --- a/providers/ibm/ibm_is_ipsec_policy.go +++ b/providers/ibm/ibm_is_ipsec_policy.go @@ -30,8 +30,7 @@ type IpsecGenerator struct { } func (g IpsecGenerator) createIpsecResources(ipsecID, ipsecName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( ipsecID, ipsecName, "ibm_is_ipsec_policy", @@ -60,7 +59,7 @@ func (g *IpsecGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.IPsecPolicy{} + var allrecs []vpcv1.IPsecPolicy for { options := &vpcv1.ListIpsecPoliciesOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_lb.go b/providers/ibm/ibm_is_lb.go index 308fc9b730..12d5f409d8 100644 --- a/providers/ibm/ibm_is_lb.go +++ b/providers/ibm/ibm_is_lb.go @@ -29,8 +29,7 @@ type LBGenerator struct { } func (g LBGenerator) createLBResources(lbID, lbName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( lbID, lbName, "ibm_is_lb", @@ -40,8 +39,7 @@ func (g LBGenerator) createLBResources(lbID, lbName string) terraformutils.Resou } func (g LBGenerator) createLBPoolResources(lbID, lbPoolID, lbPoolName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", lbID, lbPoolID), lbPoolName, "ibm_is_lb_pool", @@ -55,8 +53,7 @@ func (g LBGenerator) createLBPoolResources(lbID, lbPoolID, lbPoolName string, de } func (g LBGenerator) createLBPoolMemberResources(lbID, lbPoolID, lbPoolMemberID, lbPoolMemberName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", lbID, lbPoolID, lbPoolMemberID), lbPoolMemberName, "ibm_is_lb_pool_member", @@ -70,8 +67,7 @@ func (g LBGenerator) createLBPoolMemberResources(lbID, lbPoolID, lbPoolMemberID, } func (g LBGenerator) createLBListenerResources(lbID, lbListenerID, lbListenerName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", lbID, lbListenerID), lbListenerName, "ibm_is_lb_listener", @@ -85,8 +81,7 @@ func (g LBGenerator) createLBListenerResources(lbID, lbListenerID, lbListenerNam } func (g LBGenerator) createLBListenerPolicyResources(lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", lbID, lbListenerID, lbListenerPolicyID), lbListenerPolicyName, "ibm_is_lb_listener_policy", @@ -100,8 +95,7 @@ func (g LBGenerator) createLBListenerPolicyResources(lbID, lbListenerID, lbListe } func (g LBGenerator) createLBListenerPolicyRuleResources(lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyRuleID, lbListenerPolicyName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s/%s", lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyRuleID), lbListenerPolicyName, "ibm_is_lb_listener_policy_rule", @@ -119,7 +113,7 @@ func (g *LBGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - return fmt.Errorf("No API key set") + return fmt.Errorf("no API key set") } rg := g.Args["resource_group"] @@ -138,7 +132,7 @@ func (g *LBGenerator) InitResources() error { if err != nil { return err } - allrecs := []vpcv1.LoadBalancer{} + var allrecs []vpcv1.LoadBalancer listLoadBalancersOptions := &vpcv1.ListLoadBalancersOptions{} lbs, response, err := vpcclient.ListLoadBalancers(listLoadBalancersOptions) @@ -161,8 +155,7 @@ func (g *LBGenerator) InitResources() error { } for _, lbPool := range lbPools.Pools { g.Resources = append(g.Resources, g.createLBPoolResources(*lb.ID, *lbPool.ID, *lbPool.Name, dependsOn)) - var dependsOn1 []string - dependsOn1 = append(dependsOn, + dependsOn1 := append(dependsOn, "ibm_is_lb_pool."+terraformutils.TfSanitize(*lbPool.Name)) listLoadBalancerPoolMembersOptions := &vpcv1.ListLoadBalancerPoolMembersOptions{ LoadBalancerID: lb.ID, @@ -186,8 +179,7 @@ func (g *LBGenerator) InitResources() error { } for _, lbListener := range lbListeners.Listeners { g.Resources = append(g.Resources, g.createLBListenerResources(*lb.ID, *lbListener.ID, *lbListener.ID, dependsOn)) - var dependsOn2 []string - dependsOn2 = append(dependsOn, + var dependsOn2 = append(dependsOn, //nolint:goimports,gofmt "ibm_is_lb_listener."+terraformutils.TfSanitize(*lbListener.ID)) listLoadBalancerListenerPoliciesOptions := &vpcv1.ListLoadBalancerListenerPoliciesOptions{ LoadBalancerID: lb.ID, diff --git a/providers/ibm/ibm_is_network_acl.go b/providers/ibm/ibm_is_network_acl.go index bd6fd3afe9..dce16bcd55 100644 --- a/providers/ibm/ibm_is_network_acl.go +++ b/providers/ibm/ibm_is_network_acl.go @@ -30,8 +30,7 @@ type NetworkACLGenerator struct { } func (g NetworkACLGenerator) createNetworkACLResources(nwaclID, nwaclName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( nwaclID, nwaclName, "ibm_is_network_acl", @@ -66,7 +65,7 @@ func (g *NetworkACLGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.NetworkACL{} + var allrecs []vpcv1.NetworkACL for { options := &vpcv1.ListNetworkAclsOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_public_gateway.go b/providers/ibm/ibm_is_public_gateway.go index 7c3ab0392c..1c8af8181e 100644 --- a/providers/ibm/ibm_is_public_gateway.go +++ b/providers/ibm/ibm_is_public_gateway.go @@ -30,8 +30,7 @@ type PublicGatewayGenerator struct { } func (g PublicGatewayGenerator) createPublicGatewayResources(publicGatewayID, publicGatewayName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( publicGatewayID, publicGatewayName, "ibm_is_public_gateway", @@ -65,7 +64,7 @@ func (g *PublicGatewayGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.PublicGateway{} + var allrecs []vpcv1.PublicGateway for { options := &vpcv1.ListPublicGatewaysOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_security_group.go b/providers/ibm/ibm_is_security_group.go index 8a9e5e98c1..b1df920a07 100644 --- a/providers/ibm/ibm_is_security_group.go +++ b/providers/ibm/ibm_is_security_group.go @@ -30,8 +30,7 @@ type SecurityGroupGenerator struct { } func (g SecurityGroupGenerator) createSecurityGroupResources(sgID, sgName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( sgID, sgName, "ibm_is_security_group", @@ -41,8 +40,7 @@ func (g SecurityGroupGenerator) createSecurityGroupResources(sgID, sgName string } func (g SecurityGroupGenerator) createSecurityGroupRuleResources(sgID, sgRuleID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s.%s", sgID, sgRuleID), sgRuleID, "ibm_is_security_group_rule", @@ -81,7 +79,7 @@ func (g *SecurityGroupGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.SecurityGroup{} + var allrecs []vpcv1.SecurityGroup for { options := &vpcv1.ListSecurityGroupsOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_ssh_key.go b/providers/ibm/ibm_is_ssh_key.go index ba470072df..f7e65941f4 100644 --- a/providers/ibm/ibm_is_ssh_key.go +++ b/providers/ibm/ibm_is_ssh_key.go @@ -30,8 +30,7 @@ type SSHKeyGenerator struct { } func (g SSHKeyGenerator) createSSHKeyResources(sshKeyID, sshKeyName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( sshKeyID, sshKeyName, "ibm_is_ssh_key", diff --git a/providers/ibm/ibm_is_subnet.go b/providers/ibm/ibm_is_subnet.go index 0e20c39188..1f54116085 100644 --- a/providers/ibm/ibm_is_subnet.go +++ b/providers/ibm/ibm_is_subnet.go @@ -29,8 +29,7 @@ type SubnetGenerator struct { } func (g SubnetGenerator) createSubnetResources(subnetID, subnetName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( subnetID, subnetName, "ibm_is_subnet", @@ -66,7 +65,7 @@ func (g *SubnetGenerator) InitResources() error { } start := "" - allrecs := []vpcv1.Subnet{} + var allrecs []vpcv1.Subnet for { options := &vpcv1.ListSubnetsOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_volume.go b/providers/ibm/ibm_is_volume.go index 0db7aca184..4d9ffe9f7b 100644 --- a/providers/ibm/ibm_is_volume.go +++ b/providers/ibm/ibm_is_volume.go @@ -30,8 +30,7 @@ type VolumeGenerator struct { } func (g VolumeGenerator) createVolumeResources(volID, volName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( volID, volName, "ibm_is_volume", @@ -60,7 +59,7 @@ func (g *VolumeGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.Volume{} + var allrecs []vpcv1.Volume for { options := &vpcv1.ListVolumesOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_vpc.go b/providers/ibm/ibm_is_vpc.go index abfba7e027..b285af3ee2 100644 --- a/providers/ibm/ibm_is_vpc.go +++ b/providers/ibm/ibm_is_vpc.go @@ -29,8 +29,7 @@ type VPCGenerator struct { } func (g VPCGenerator) createVPCResources(vpcID, vpcName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( vpcID, vpcName, "ibm_is_vpc", @@ -40,8 +39,7 @@ func (g VPCGenerator) createVPCResources(vpcID, vpcName string) terraformutils.R } func (g VPCGenerator) createVPCAddressPrefixResources(vpcID, addPrefixID, addPrefixName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, addPrefixID), addPrefixName, "ibm_is_vpc_address_prefix", @@ -55,8 +53,7 @@ func (g VPCGenerator) createVPCAddressPrefixResources(vpcID, addPrefixID, addPre } func (g VPCGenerator) createVPCRouteResources(vpcID, routeID, routeName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, routeID), routeName, "ibm_is_vpc_route", @@ -70,8 +67,7 @@ func (g VPCGenerator) createVPCRouteResources(vpcID, routeID, routeName string, } func (g VPCGenerator) createVPCRouteTableResources(vpcID, routeTableID, routeTableName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, routeTableID), routeTableName, "ibm_is_vpc_routing_table", @@ -85,8 +81,7 @@ func (g VPCGenerator) createVPCRouteTableResources(vpcID, routeTableID, routeTab } func (g VPCGenerator) createVPCRouteTableRouteResources(vpcID, routeTableID, routeTableRouteID, routeTableRouteName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", vpcID, routeTableID, routeTableRouteID), routeTableRouteName, "ibm_is_vpc_routing_table_route", @@ -105,7 +100,7 @@ func (g *VPCGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - return fmt.Errorf("No API key set") + return fmt.Errorf("no API key set") } rg := g.Args["resource_group"] @@ -125,7 +120,7 @@ func (g *VPCGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.VPC{} + var allrecs []vpcv1.VPC for { listVpcsOptions := &vpcv1.ListVpcsOptions{} if start != "" { diff --git a/providers/ibm/ibm_is_vpn_gateway.go b/providers/ibm/ibm_is_vpn_gateway.go index 915963ab5f..6a198b2859 100644 --- a/providers/ibm/ibm_is_vpn_gateway.go +++ b/providers/ibm/ibm_is_vpn_gateway.go @@ -29,8 +29,7 @@ type VPNGatewayGenerator struct { } func (g VPNGatewayGenerator) createVPNGatewayResources(vpngwID, vpngwName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( vpngwID, vpngwName, "ibm_is_vpn_gateway", @@ -40,8 +39,7 @@ func (g VPNGatewayGenerator) createVPNGatewayResources(vpngwID, vpngwName string } func (g VPNGatewayGenerator) createVPNGatewayConnectionResources(vpngwID, vpngwConnectionID, vpngwConnectionName string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpngwID, vpngwConnectionID), vpngwConnectionName, "ibm_is_vpn_gateway_connections", @@ -60,7 +58,7 @@ func (g *VPNGatewayGenerator) InitResources() error { region := envFallBack([]string{"IC_REGION"}, "us-south") apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { - return fmt.Errorf("No API key set") + return fmt.Errorf("no API key set") } rg := g.Args["resource_group"] @@ -80,7 +78,7 @@ func (g *VPNGatewayGenerator) InitResources() error { return err } start := "" - allrecs := []vpcv1.VPNGatewayIntf{} + var allrecs []vpcv1.VPNGatewayIntf for { listVPNGatewaysOptions := &vpcv1.ListVPNGatewaysOptions{} if start != "" { diff --git a/providers/ibm/ibm_kp.go b/providers/ibm/ibm_kp.go index 1c20f0d7b4..c0bab45fe6 100644 --- a/providers/ibm/ibm_kp.go +++ b/providers/ibm/ibm_kp.go @@ -20,7 +20,7 @@ import ( "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/session" @@ -31,11 +31,10 @@ type KPGenerator struct { IBMService } -func (g KPGenerator) loadKP(kpID, kpGuid string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( +func (g KPGenerator) loadKP(kpID, kpGUID string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( kpID, - kpGuid, + kpGUID, "ibm_resource_instance", "ibm", []string{}) @@ -43,8 +42,7 @@ func (g KPGenerator) loadKP(kpID, kpGuid string) terraformutils.Resource { } func (g KPGenerator) loadkPKeys(kpKeyCRN, kpKeyID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( kpKeyCRN, kpKeyID, "ibm_kms_key", @@ -99,9 +97,9 @@ func (g *KPGenerator) InitResources() error { if err != nil { return err } - for _, kp := range kpInstances { - g.Resources = append(g.Resources, g.loadKP(kp.ID, kp.Guid)) - client.Config.InstanceID = kp.Guid + for _, kpInstance := range kpInstances { + g.Resources = append(g.Resources, g.loadKP(kpInstance.ID, kpInstance.Guid)) + client.Config.InstanceID = kpInstance.Guid output, err := client.GetKeys(context.Background(), 100, 0) if err != nil { @@ -110,7 +108,7 @@ func (g *KPGenerator) InitResources() error { for _, key := range output.Keys { var dependsOn []string dependsOn = append(dependsOn, - "ibm_resource_instance."+terraformutils.TfSanitize(kp.Guid)) + "ibm_resource_instance."+terraformutils.TfSanitize(kpInstance.Guid)) g.Resources = append(g.Resources, g.loadkPKeys(key.CRN, key.ID, dependsOn)) } diff --git a/providers/ibm/ibm_private_dns.go b/providers/ibm/ibm_private_dns.go index 5d97b34ebf..5cb592d1fe 100644 --- a/providers/ibm/ibm_private_dns.go +++ b/providers/ibm/ibm_private_dns.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/session" @@ -28,15 +28,14 @@ import ( dns "github.com/IBM/networking-go-sdk/dnssvcsv1" ) -//privateDNSTemplateGenerator ... +// privateDNSTemplateGenerator ... type privateDNSTemplateGenerator struct { IBMService } // loadPrivateDNS ... func (g privateDNSTemplateGenerator) loadPrivateDNS(pDNSID string, pDNSName string, resGrpID string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( pDNSID, pDNSName, "ibm_resource_instance", @@ -51,8 +50,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNS(pDNSID string, pDNSName stri // loadPrivateDNSZone ... func (g privateDNSTemplateGenerator) loadPrivateDNSZone(pDNSGuid string, zoneID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", pDNSGuid, zoneID), zoneID, "ibm_dns_zone", @@ -67,8 +65,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSZone(pDNSGuid string, zoneID // loadPrivateDNSPermittedNetwork ... func (g privateDNSTemplateGenerator) loadPrivateDNSPermittedNetwork(pDNSGuid string, zoneID string, permittedNetworkID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, permittedNetworkID), permittedNetworkID, "ibm_dns_permitted_network", @@ -83,8 +80,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSPermittedNetwork(pDNSGuid str // loadPrivateDNSResourceRecord ... func (g privateDNSTemplateGenerator) loadPrivateDNSResourceRecord(pDNSGuid string, zoneID string, recordID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, recordID), recordID, "ibm_dns_resource_record", @@ -99,8 +95,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSResourceRecord(pDNSGuid strin // loadPrivateDNSGLBMonitor ... func (g privateDNSTemplateGenerator) loadPrivateDNSGLBMonitor(pDNSGuid string, monitorID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", pDNSGuid, monitorID), monitorID, "ibm_dns_glb_monitor", @@ -115,8 +110,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSGLBMonitor(pDNSGuid string, m // loadPrivateDNSGLBPool ... func (g privateDNSTemplateGenerator) loadPrivateDNSGLBPool(pDNSGuid string, poolID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", pDNSGuid, poolID), poolID, "ibm_dns_glb_pool", @@ -131,8 +125,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSGLBPool(pDNSGuid string, pool // loadPrivateDNSGLB ... func (g privateDNSTemplateGenerator) loadPrivateDNSGLB(pDNSGuid string, zoneID string, lbID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, lbID), lbID, "ibm_dns_glb", @@ -145,7 +138,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSGLB(pDNSGuid string, zoneID s return resources } -//InitResources ... +// InitResources ... func (g *privateDNSTemplateGenerator) InitResources() error { region := os.Getenv("IC_REGION") @@ -219,14 +212,13 @@ func (g *privateDNSTemplateGenerator) InitResources() error { } zoneList, _, err := zService.ListDnszones(&zoneOpt) if err != nil { - return fmt.Errorf("Error Listing Zones %s", err) + return fmt.Errorf("error Listing Zones %s", err) } for _, zone := range zoneList.Dnszones { zoneID := *zone.ID g.Resources = append(g.Resources, g.loadPrivateDNSZone(instanceGUID, zoneID, pDNSDependsOn)) - var domainDependsOn []string - domainDependsOn = append(pDNSDependsOn, + domainDependsOn := append(pDNSDependsOn, "ibm_dns_zone."+terraformutils.TfSanitize(zoneID)) // Permitted Network Records @@ -236,7 +228,7 @@ func (g *privateDNSTemplateGenerator) InitResources() error { } permittedNetworkList, _, err := zService.ListPermittedNetworks(&permittedNetworkOpt) if err != nil { - return fmt.Errorf("Error Listing Permitted Networks %s", err) + return fmt.Errorf("error Listing Permitted Networks %s", err) } for _, permittedNetwork := range permittedNetworkList.PermittedNetworks { permittedNetworkID := *permittedNetwork.ID @@ -250,7 +242,7 @@ func (g *privateDNSTemplateGenerator) InitResources() error { } resourceRecordList, _, err := zService.ListResourceRecords(&dnsRecordOpt) if err != nil { - return fmt.Errorf("Error Listing Resource Records %s", err) + return fmt.Errorf("error Listing Resource Records %s", err) } for _, record := range resourceRecordList.ResourceRecords { recordID := *record.ID @@ -264,7 +256,7 @@ func (g *privateDNSTemplateGenerator) InitResources() error { } glbOptList, _, err := zService.ListLoadBalancers(&glbOpt) if err != nil { - return fmt.Errorf("Error Listing GLBs %s", err) + return fmt.Errorf("error Listing GLBs %s", err) } for _, lb := range glbOptList.LoadBalancers { lbID := *lb.ID @@ -277,7 +269,7 @@ func (g *privateDNSTemplateGenerator) InitResources() error { } glbMonitorList, _, err := zService.ListMonitors(&monitorOpt) if err != nil { - return fmt.Errorf("Error Listing GLB Monitor %s", err) + return fmt.Errorf("error Listing GLB Monitor %s", err) } for _, monitor := range glbMonitorList.Monitors { monitorID := *monitor.ID @@ -290,7 +282,7 @@ func (g *privateDNSTemplateGenerator) InitResources() error { } glbPoolOptList, _, err := zService.ListPools(&glbPoolOpt) if err != nil { - return fmt.Errorf("Error Listing GLB Pools %s", err) + return fmt.Errorf("error Listing GLB Pools %s", err) } for _, pool := range glbPoolOptList.Pools { poolID := *pool.ID diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index f2c1940d60..eff48c4757 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -20,7 +20,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) -type IBMProvider struct { +type IBMProvider struct { //nolint terraformutils.Provider ResourceGroup string Region string diff --git a/providers/ibm/ibm_service.go b/providers/ibm/ibm_service.go index a78f2603d2..6b22f1fd51 100644 --- a/providers/ibm/ibm_service.go +++ b/providers/ibm/ibm_service.go @@ -18,6 +18,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) -type IBMService struct { +type IBMService struct { //nolint terraformutils.Service } diff --git a/providers/ibm/instance_groups.go b/providers/ibm/instance_groups.go index a1d8b9edaa..d9b5483850 100644 --- a/providers/ibm/instance_groups.go +++ b/providers/ibm/instance_groups.go @@ -32,8 +32,7 @@ type InstanceGroupGenerator struct { } func (g *InstanceGroupGenerator) loadInstanceGroup(instanceGroupID, instanceGroupName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( instanceGroupID, instanceGroupName, "ibm_is_instance_group", @@ -46,8 +45,7 @@ func (g *InstanceGroupGenerator) loadInstanceGroupManger(instanceGroupID, instan if managerName == "" { managerName = fmt.Sprintf("manager-%d-%d", rand.Intn(100), rand.Intn(50)) } - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", instanceGroupID, instanceGroupManagerID), managerName, "ibm_is_instance_group_manager", @@ -60,13 +58,12 @@ func (g *InstanceGroupGenerator) loadInstanceGroupManger(instanceGroupID, instan return resources } -func (g *InstanceGroupGenerator) loadInstanceGroupMangerPolicy(instanceGroupID, instanceGroupManagerID, PolicyID, policyName string, dependsOn []string) terraformutils.Resource { +func (g *InstanceGroupGenerator) loadInstanceGroupMangerPolicy(instanceGroupID, instanceGroupManagerID, policyID, policyName string, dependsOn []string) terraformutils.Resource { if policyName == "" { policyName = fmt.Sprintf("manager-%d-%d", rand.Intn(100), rand.Intn(50)) } - var resources terraformutils.Resource - resources = terraformutils.NewResource( - fmt.Sprintf("%s/%s/%s", instanceGroupID, instanceGroupManagerID, PolicyID), + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", instanceGroupID, instanceGroupManagerID, policyID), policyName, "ibm_is_instance_group_manager_policy", "ibm", @@ -116,11 +113,10 @@ func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroup policies := make([]string, 0) for i := 0; i < len(instanceGroupManager.Policies); i++ { - policies = append(policies, string(*(instanceGroupManager.Policies[i].ID))) + policies = append(policies, *(instanceGroupManager.Policies[i].ID)) } policiesWG.Add(1) - var dependsOn1 []string - dependsOn1 = append(dependsOn, + dependsOn1 := append(dependsOn, "ibm_is_instance_group_manger."+terraformutils.TfSanitize(*instanceGroupManager.Name)) go g.handlePolicies(sess, instanceGroupID, instanceGroupManagerID, policies, dependsOn1, &policiesWG) } @@ -131,7 +127,7 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1, waitGro // Support for pagination defer waitGroup.Done() start := "" - allrecs := []vpcv1.InstanceGroup{} + var allrecs []vpcv1.InstanceGroup for { listInstanceGroupOptions := vpcv1.ListInstanceGroupsOptions{} if start != "" { @@ -158,7 +154,7 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1, waitGro g.Resources = append(g.Resources, g.loadInstanceGroup(instanceGoupID, *instanceGroup.Name)) managers := make([]string, 0) for i := 0; i < len(instanceGroup.Managers); i++ { - managers = append(managers, string(*(instanceGroup.Managers[i].ID))) + managers = append(managers, *(instanceGroup.Managers[i].ID)) } managersWG.Add(1) go g.handleManagers(sess, instanceGoupID, managers, dependsOn, &managersWG) @@ -170,7 +166,7 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1, waitGro func (g *InstanceGroupGenerator) InitResources() error { apiKey := os.Getenv("IBMCLOUD_API_KEY") if apiKey == "" { - return fmt.Errorf("No API key set") + return fmt.Errorf("no API key set") } // Instantiate the service with an API key based IAM authenticator @@ -189,11 +185,11 @@ func (g *InstanceGroupGenerator) InitResources() error { instanceGroupWG.Add(1) go g.handleInstanceGroups(sess, &instanceGroupWG) - select { + select { //nolint case err := <-g.fatalErrors: close(g.fatalErrors) return err } - instanceGroupWG.Wait() + instanceGroupWG.Wait() //nolint:govet return nil } diff --git a/providers/ibm/utils.go b/providers/ibm/utils.go index adb9bced66..ebb2caa3d9 100644 --- a/providers/ibm/utils.go +++ b/providers/ibm/utils.go @@ -28,7 +28,7 @@ import ( "github.com/dgrijalva/jwt-go" ) -//UserConfig ... +// UserConfig ... type UserConfig struct { userID string userEmail string @@ -38,7 +38,7 @@ type UserConfig struct { generation int `default:"2"` } -//EnvFallBack ... +// EnvFallBack ... func envFallBack(envs []string, defaultValue string) string { for _, k := range envs { if v := os.Getenv(k); v != "" { @@ -62,7 +62,7 @@ func fetchUserDetails(sess *session.Session, generation int) (*UserConfig, error token, err := jwt.Parse(bluemixToken, func(token *jwt.Token) (interface{}, error) { return "", nil }) - //TODO validate with key + // TODO validate with key if err != nil && !strings.Contains(err.Error(), "key is of invalid type") { return &user, err } diff --git a/providers/ibm/vpc_cluster.go b/providers/ibm/vpc_cluster.go index 0802ba5f2f..08ccb9c363 100644 --- a/providers/ibm/vpc_cluster.go +++ b/providers/ibm/vpc_cluster.go @@ -19,7 +19,7 @@ import ( "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/session" ) @@ -29,8 +29,7 @@ type VPCClusterGenerator struct { } func (g VPCClusterGenerator) loadcluster(clustersID, clusterName string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewSimpleResource( + resources := terraformutils.NewSimpleResource( clustersID, clusterName, "ibm_container_vpc_cluster", @@ -40,8 +39,7 @@ func (g VPCClusterGenerator) loadcluster(clustersID, clusterName string) terrafo } func (g VPCClusterGenerator) loadWorkerPools(clustersID, poolID string, dependsOn []string) terraformutils.Resource { - var resources terraformutils.Resource - resources = terraformutils.NewResource( + resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", clustersID, poolID), poolID, "ibm_container_vpc_worker_pool", diff --git a/terraformutils/resource.go b/terraformutils/resource.go index b6c1d4a803..9af1de944f 100644 --- a/terraformutils/resource.go +++ b/terraformutils/resource.go @@ -55,15 +55,16 @@ func (rf *ResourceFilter) Filter(resource Resource) bool { return true } var vals []interface{} - if rf.FieldPath == "id" { + switch { + case rf.FieldPath == "id": vals = []interface{}{resource.InstanceState.ID} - } else if rf.AcceptableValues == nil { + case rf.AcceptableValues == nil: var hasField = WalkAndCheckField(rf.FieldPath, resource.InstanceState.Attributes) if hasField { return true } return WalkAndCheckField(rf.FieldPath, resource.Item) - } else { + default: vals = WalkAndGet(rf.FieldPath, resource.InstanceState.Attributes) if len(vals) == 0 { vals = WalkAndGet(rf.FieldPath, resource.Item) From 1c9dfceb7128697bc8d1f182f822b00bee2df3b2 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sat, 3 Apr 2021 22:58:03 +0300 Subject: [PATCH 129/276] fix issue 838 --- providers/kubernetes/kind.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/kubernetes/kind.go b/providers/kubernetes/kind.go index 236e47d982..3837a2faa8 100644 --- a/providers/kubernetes/kind.go +++ b/providers/kubernetes/kind.go @@ -15,6 +15,7 @@ package kubernetes import ( + "context" "reflect" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -54,9 +55,10 @@ func (k *Kind) InitResources() error { if k.Namespaced { param = append(param, reflect.ValueOf(namespace)) } + resource := group.MethodByName(extractClientSetFuncTypeName(k.Name)).Call(param)[0] - results := resource.MethodByName("List").Call([]reflect.Value{ + results := resource.MethodByName("List").Call([]reflect.Value{reflect.ValueOf(context.Background()), reflect.ValueOf(metav1.ListOptions{})}) if !results[1].IsNil() { From 126de79794e24b7b3e66051a6219ffd236f0cea8 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sat, 3 Apr 2021 23:51:00 +0300 Subject: [PATCH 130/276] fix newrelic v2 --- README.md | 5 ++- cmd/provider_cmd_newrelic.go | 8 ++++- providers/newrelic/newrelic_provider.go | 42 +++++++++++++++++++++++++ providers/newrelic/newrelic_service.go | 32 ++----------------- 4 files changed, 54 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index fc7675b0ad..12dfb017f5 100644 --- a/README.md +++ b/README.md @@ -258,7 +258,7 @@ Links to download Terraform Providers: * GitHub provider >=2.2.1 - [here](https://releases.hashicorp.com/terraform-provider-github/) * Monitoring & System Management * Datadog provider >2.1.0 - [here](https://releases.hashicorp.com/terraform-provider-datadog/) - * New Relic provider >1.5.0 - [here](https://releases.hashicorp.com/terraform-provider-newrelic/) + * New Relic provider >2.0.0 - [here](https://releases.hashicorp.com/terraform-provider-newrelic/) * Community * Keycloak provider >=1.19.0 - [here](https://github.com/mrparkers/terraform-provider-keycloak/) * Logz.io provider >=1.1.1 - [here](https://github.com/jonboydell/logzio_terraform_provider/) @@ -1593,8 +1593,7 @@ List of supported Datadog services: Example: ``` -NEWRELIC_API_KEY=[API-KEY] -./terraformer import newrelic -r alert,dashboard,infra,synthetics +./terraformer import newrelic -r alert,dashboard,infra,synthetics --api-key=NRAK-XXXXXXXX --account-id=XXXXX ``` List of supported New Relic resources: diff --git a/cmd/provider_cmd_newrelic.go b/cmd/provider_cmd_newrelic.go index beb3edc4c8..015ca8a12c 100644 --- a/cmd/provider_cmd_newrelic.go +++ b/cmd/provider_cmd_newrelic.go @@ -21,13 +21,16 @@ import ( ) func newCmdNewRelicImporter(options ImportOptions) *cobra.Command { + apiKey := "" + accountID := "" + region := "" cmd := &cobra.Command{ Use: "newrelic", Short: "Import current state to Terraform configuration from New Relic", Long: "Import current state to Terraform configuration from New Relic", RunE: func(cmd *cobra.Command, args []string) error { provider := newNewRelicProvider() - err := Import(provider, options, []string{}) + err := Import(provider, options, []string{apiKey, accountID, region}) if err != nil { return err } @@ -36,6 +39,9 @@ func newCmdNewRelicImporter(options ImportOptions) *cobra.Command { } cmd.AddCommand(listCmd(newNewRelicProvider())) + cmd.PersistentFlags().StringVar(&apiKey, "api-key", "", "Your Personal API Key") + cmd.PersistentFlags().StringVar(&accountID, "account-id", "", "Your Account ID") + cmd.PersistentFlags().StringVar(®ion, "region", "US", "") baseProviderFlags(cmd.PersistentFlags(), &options, "alert", "dashboard=id1:id2:id4") return cmd } diff --git a/providers/newrelic/newrelic_provider.go b/providers/newrelic/newrelic_provider.go index 27116e2c93..0e9b4866d5 100644 --- a/providers/newrelic/newrelic_provider.go +++ b/providers/newrelic/newrelic_provider.go @@ -16,15 +16,48 @@ package newrelic import ( "errors" + "os" + "strconv" "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/zclconf/go-cty/cty" ) type NewRelicProvider struct { //nolint terraformutils.Provider + accountID int + APIKey string + Region string } func (p *NewRelicProvider) Init(args []string) error { + if apiKey := os.Getenv("NEW_RELIC_API_KEY"); apiKey != "" { + p.APIKey = os.Getenv("NEW_RELIC_API_KEY") + } + if accountIDs := os.Getenv("NEW_RELIC_ACCOUNT_ID"); accountIDs != "" { + accountID, err := strconv.Atoi(accountIDs) + if err != nil { + return err + + } + p.accountID = accountID + } + if len(args) > 0 { + p.APIKey = args[0] + } + if len(args) > 1 { + accountID, err := strconv.Atoi(args[1]) + if err != nil { + return err + } + p.accountID = accountID + } + if len(args) > 1 { + p.Region = args[2] + } + if p.Region == "" { + p.Region = "US" + } return nil } @@ -32,6 +65,14 @@ func (p *NewRelicProvider) GetName() string { return "newrelic" } +func (p *NewRelicProvider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "account_id": cty.NumberIntVal(int64(p.accountID)), + "api_key": cty.StringVal(p.APIKey), + "region": cty.StringVal(p.Region), + }) +} + func (p *NewRelicProvider) GetProviderData(arg ...string) map[string]interface{} { return map[string]interface{}{} } @@ -57,6 +98,7 @@ func (p *NewRelicProvider) InitService(serviceName string, verbose bool) error { p.Service = p.GetSupportedService()[serviceName] p.Service.SetName(serviceName) p.Service.SetVerbose(verbose) + p.Service.SetArgs(map[string]interface{}{"apiKey": p.APIKey}) p.Service.SetProviderName(p.GetName()) return nil diff --git a/providers/newrelic/newrelic_service.go b/providers/newrelic/newrelic_service.go index 5e4d901f5c..27992b029b 100644 --- a/providers/newrelic/newrelic_service.go +++ b/providers/newrelic/newrelic_service.go @@ -15,9 +15,6 @@ package newrelic import ( - "errors" - "os" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" synthetics "github.com/dollarshaveclub/new-relic-synthetics-go" newrelic "github.com/paultyng/go-newrelic/v4/api" @@ -28,41 +25,18 @@ type NewRelicService struct { //nolint } func (s *NewRelicService) Client() (*newrelic.Client, error) { - apiKey := os.Getenv("NEWRELIC_API_KEY") - - if apiKey == "" { - err := errors.New("No NEWRELIC_API_KEY environment set") - return nil, err - } - - client := newrelic.New(newrelic.Config{APIKey: apiKey}) + client := newrelic.New(newrelic.Config{APIKey: s.GetArgs()["apiKey"].(string)}) return &client, nil } func (s *NewRelicService) InfraClient() (*newrelic.InfraClient, error) { - apiKey := os.Getenv("NEWRELIC_API_KEY") - - if apiKey == "" { - err := errors.New("No NEWRELIC_API_KEY environment set") - return nil, err - } - - client := newrelic.NewInfraClient(newrelic.Config{APIKey: apiKey, Debug: s.Verbose}) - + client := newrelic.NewInfraClient(newrelic.Config{APIKey: s.GetArgs()["apiKey"].(string), Debug: s.Verbose}) return &client, nil } func (s *NewRelicService) SyntheticsClient() (*synthetics.Client, error) { - apiKey := os.Getenv("NEWRELIC_API_KEY") - - if apiKey == "" { - err := errors.New("No NEWRELIC_API_KEY environment set") - return nil, err - } - conf := func(c *synthetics.Client) { - c.APIKey = apiKey + c.APIKey = s.GetArgs()["apiKey"].(string) } - return synthetics.NewClient(conf) } From 2ece85d7534994b0cfcb249f87a710394a212997 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sun, 4 Apr 2021 00:18:42 +0300 Subject: [PATCH 131/276] add actions.yaml --- .github/actions.yaml | 51 ++++++++++++++++++++++++++++++++ cmd/provider_cmd_tencentcloud.go | 0 2 files changed, 51 insertions(+) create mode 100644 .github/actions.yaml mode change 100755 => 100644 cmd/provider_cmd_tencentcloud.go diff --git a/.github/actions.yaml b/.github/actions.yaml new file mode 100644 index 0000000000..0fd0d656c6 --- /dev/null +++ b/.github/actions.yaml @@ -0,0 +1,51 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' + days-before-issue-stale: 60 + days-before-issue-close: 7 + days-before-pr-close: -1 +--- +name: "tagged-release" +on: + push: + tags: + - "*" +jobs: + tagged-release: + name: "Tagged Release" + runs-on: "ubuntu-latest" + + steps: + - uses: actions/checkout@v2 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Test + run: go build -v && go test ./... + - name: Build for linux + run: go build -o terraformer-all-linux-amd64 + - name: Build for mac + run: GOOS=darwin go build -o terraformer-all-darwin-amd64 + - name: Build for windows + run: GOOS=windows go build -o terraformer-all-windows-amd64 + - name: Build for all providers + run: go run build/muilti-build/main.go + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + terraformer-* \ No newline at end of file diff --git a/cmd/provider_cmd_tencentcloud.go b/cmd/provider_cmd_tencentcloud.go old mode 100755 new mode 100644 From a4a724cbff29854c78cc109a34793c09aca49afc Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sun, 4 Apr 2021 00:57:42 +0300 Subject: [PATCH 132/276] fix github actions --- .github/{ => workflows}/actions.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/actions.yaml (100%) diff --git a/.github/actions.yaml b/.github/workflows/actions.yaml similarity index 100% rename from .github/actions.yaml rename to .github/workflows/actions.yaml From ff2edb7e8fa4e92d2fc103c92b3c3b6a5c7c643b Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sun, 4 Apr 2021 01:09:54 +0300 Subject: [PATCH 133/276] version 0.8.12 --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 6ecdbc764a..ffcd02560e 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.11" +const version = "v0.8.12" var versionCmd = &cobra.Command{ Use: "version", From a1f07e912725a8c4aa58a0b64dcee9a802375104 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sun, 4 Apr 2021 01:24:39 +0300 Subject: [PATCH 134/276] separate github actions --- .../workflows/{actions.yaml => release.yaml} | 18 ------------------ .github/workflows/stale.yaml | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) rename .github/workflows/{actions.yaml => release.yaml} (59%) create mode 100644 .github/workflows/stale.yaml diff --git a/.github/workflows/actions.yaml b/.github/workflows/release.yaml similarity index 59% rename from .github/workflows/actions.yaml rename to .github/workflows/release.yaml index 0fd0d656c6..f86cd71ba7 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/release.yaml @@ -1,21 +1,3 @@ -name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.' - close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' - days-before-issue-stale: 60 - days-before-issue-close: 7 - days-before-pr-close: -1 ---- name: "tagged-release" on: push: diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 0000000000..311c520141 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,17 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' + days-before-issue-stale: 60 + days-before-issue-close: 7 + days-before-pr-close: -1 \ No newline at end of file From 7ca795386c0b77061f8440ef64945e6a119766e1 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sun, 4 Apr 2021 02:04:25 +0300 Subject: [PATCH 135/276] fix release workflow --- .github/workflows/release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f86cd71ba7..1c2d21e4d9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,9 @@ on: push: tags: - "*" + workflow_dispatch: + tags: + description: 'Release' jobs: tagged-release: name: "Tagged Release" @@ -23,7 +26,7 @@ jobs: - name: Build for windows run: GOOS=windows go build -o terraformer-all-windows-amd64 - name: Build for all providers - run: go run build/muilti-build/main.go + run: go run build/multi-build/main.go - uses: "marvinpinto/action-automatic-releases@latest" with: From e4e72f6dfc257747227cc7207c6f74c864d06969 Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Sun, 4 Apr 2021 01:44:33 -0500 Subject: [PATCH 136/276] Adds import for Equinix Metal devices, spot market requests, ssh keys, and volumes --- providers/equinixmetal/device.go | 56 +++++++++++++++++++ .../equinixmetal/equinixmetal_provider.go | 3 + providers/equinixmetal/spot_market_request.go | 56 +++++++++++++++++++ providers/equinixmetal/ssh_key.go | 56 +++++++++++++++++++ providers/equinixmetal/volume.go | 56 +++++++++++++++++++ 5 files changed, 227 insertions(+) create mode 100644 providers/equinixmetal/device.go create mode 100644 providers/equinixmetal/spot_market_request.go create mode 100644 providers/equinixmetal/ssh_key.go create mode 100644 providers/equinixmetal/volume.go diff --git a/providers/equinixmetal/device.go b/providers/equinixmetal/device.go new file mode 100644 index 0000000000..923c4bb142 --- /dev/null +++ b/providers/equinixmetal/device.go @@ -0,0 +1,56 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package equinixmetal + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/packethost/packngo" +) + +type DeviceGenerator struct { + EquinixMetalService +} + +func (g DeviceGenerator) listDevices(client *packngo.Client) ([]packngo.Device, error) { + devices, _, err := client.Devices.List(g.GetArgs()["project_id"].(string), nil) + if err != nil { + return nil, err + } + + return devices, nil +} + +func (g DeviceGenerator) createResources(deviceList []packngo.Device) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, device := range deviceList { + resources = append(resources, terraformutils.NewSimpleResource( + device.ID, + device.Hostname, + "metal_device", + "equinixmetal", + []string{})) + } + return resources +} + +func (g *DeviceGenerator) InitResources() error { + client := g.generateClient() + output, err := g.listDevices(client) + if err != nil { + return err + } + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/equinixmetal/equinixmetal_provider.go b/providers/equinixmetal/equinixmetal_provider.go index 9abc9a97d9..6f7d7a9de2 100644 --- a/providers/equinixmetal/equinixmetal_provider.go +++ b/providers/equinixmetal/equinixmetal_provider.go @@ -56,6 +56,9 @@ func (EquinixMetalProvider) GetResourceConnections() map[string]map[string][]str func (p *EquinixMetalProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ "device": &DeviceGenerator{}, + "sshkey": &SshKeyGenerator{}, + "spotmarketrequest": &SpotMarketRequestGenerator{}, + "volume": &VolumeGenerator{}, } } diff --git a/providers/equinixmetal/spot_market_request.go b/providers/equinixmetal/spot_market_request.go new file mode 100644 index 0000000000..7cb7e2c9cf --- /dev/null +++ b/providers/equinixmetal/spot_market_request.go @@ -0,0 +1,56 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package equinixmetal + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/packethost/packngo" +) + +type SpotMarketRequestGenerator struct { + EquinixMetalService +} + +func (g SpotMarketRequestGenerator) listSpotMarketRequests(client *packngo.Client) ([]packngo.SpotMarketRequest, error) { + spot_market_requests, _, err := client.SpotMarketRequests.List(g.GetArgs()["project_id"].(string), nil) + if err != nil { + return nil, err + } + + return spot_market_requests, nil +} + +func (g SpotMarketRequestGenerator) createResources(spot_market_requestList []packngo.SpotMarketRequest) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, spot_market_request := range spot_market_requestList { + resources = append(resources, terraformutils.NewSimpleResource( + spot_market_request.ID, + spot_market_request.ID, + "metal_spot_market_request", + "equinixmetal", + []string{})) + } + return resources +} + +func (g *SpotMarketRequestGenerator) InitResources() error { + client := g.generateClient() + output, err := g.listSpotMarketRequests(client) + if err != nil { + return err + } + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/equinixmetal/ssh_key.go b/providers/equinixmetal/ssh_key.go new file mode 100644 index 0000000000..623c9b3b74 --- /dev/null +++ b/providers/equinixmetal/ssh_key.go @@ -0,0 +1,56 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package equinixmetal + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/packethost/packngo" +) + +type SshKeyGenerator struct { + EquinixMetalService +} + +func (g SshKeyGenerator) listSshKeys(client *packngo.Client) ([]packngo.SSHKey, error) { + ssh_keys, _, err := client.SSHKeys.List() + if err != nil { + return nil, err + } + + return ssh_keys, nil +} + +func (g SshKeyGenerator) createResources(ssh_keyList []packngo.SSHKey) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, ssh_key := range ssh_keyList { + resources = append(resources, terraformutils.NewSimpleResource( + ssh_key.ID, + ssh_key.Label, + "metal_ssh_key", + "equinixmetal", + []string{})) + } + return resources +} + +func (g *SshKeyGenerator) InitResources() error { + client := g.generateClient() + output, err := g.listSshKeys(client) + if err != nil { + return err + } + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/equinixmetal/volume.go b/providers/equinixmetal/volume.go new file mode 100644 index 0000000000..4c2f0a3ed0 --- /dev/null +++ b/providers/equinixmetal/volume.go @@ -0,0 +1,56 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package equinixmetal + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/packethost/packngo" +) + +type VolumeGenerator struct { + EquinixMetalService +} + +func (g VolumeGenerator) listVolumes(client *packngo.Client) ([]packngo.Volume, error) { + volumes, _, err := client.Volumes.List(g.GetArgs()["project_id"].(string), nil) + if err != nil { + return nil, err + } + + return volumes, nil +} + +func (g VolumeGenerator) createResources(volumeList []packngo.Volume) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, volume := range volumeList { + resources = append(resources, terraformutils.NewSimpleResource( + volume.ID, + volume.Name, + "metal_volume", + "equinixmetal", + []string{})) + } + return resources +} + +func (g *VolumeGenerator) InitResources() error { + client := g.generateClient() + output, err := g.listVolumes(client) + if err != nil { + return err + } + g.Resources = g.createResources(output) + return nil +} From d8233ed106c18e70227b1e552a3edb4c33ff7a21 Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Sun, 4 Apr 2021 01:46:03 -0500 Subject: [PATCH 137/276] Updates cmd/root.go to add EquinixMetal provider --- cmd/root.go | 102 +++++++++--------- .../equinixmetal/equinixmetal_service.go | 3 - 2 files changed, 51 insertions(+), 54 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 338454cf6a..4a364724d7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -39,39 +39,39 @@ func Execute() error { func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command { return []func(options ImportOptions) *cobra.Command{ // Major Cloud - newCmdGoogleImporter, - newCmdAwsImporter, - newCmdAzureImporter, - newCmdAliCloudImporter, - newCmdIbmImporter, +// newCmdGoogleImporter, +// newCmdAwsImporter, +// newCmdAzureImporter, +// newCmdAliCloudImporter, +// newCmdIbmImporter, // Cloud - newCmdDigitalOceanImporter, +// newCmdDigitalOceanImporter, newCmdEquinixMetalImporter, - newCmdFastlyImporter, - newCmdHerokuImporter, - newCmdLinodeImporter, - newCmdNs1Importer, - newCmdOpenStackImporter, - newCmdTencentCloudImporter, - newCmdVultrImporter, - newCmdYandexImporter, +// newCmdFastlyImporter, +// newCmdHerokuImporter, +// newCmdLinodeImporter, +// newCmdNs1Importer, +// newCmdOpenStackImporter, +// newCmdTencentCloudImporter, +// newCmdVultrImporter, +// newCmdYandexImporter, // Infrastructure Software - newCmdKubernetesImporter, - newCmdOctopusDeployImporter, - newCmdRabbitMQImporter, +// newCmdKubernetesImporter, +// newCmdOctopusDeployImporter, +// newCmdRabbitMQImporter, // Network - newCmdCloudflareImporter, +// newCmdCloudflareImporter, // VCS - newCmdGithubImporter, +// newCmdGithubImporter, // Monitoring & System Management - newCmdDatadogImporter, - newCmdNewRelicImporter, +// newCmdDatadogImporter, +// newCmdNewRelicImporter, // Community - newCmdKeycloakImporter, - newCmdLogzioImporter, - newCmdCommercetoolsImporter, - newCmdMikrotikImporter, - newCmdGmailfilterImporter, +// newCmdKeycloakImporter, +// newCmdLogzioImporter, +// newCmdCommercetoolsImporter, +// newCmdMikrotikImporter, +// newCmdGmailfilterImporter, } } @@ -79,38 +79,38 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { list := make(map[string]func() terraformutils.ProviderGenerator) for _, providerGen := range []func() terraformutils.ProviderGenerator{ // Major Cloud - newGoogleProvider, - newAWSProvider, - newAzureProvider, - newAliCloudProvider, - newIbmProvider, +// newGoogleProvider, +// newAWSProvider, +// newAzureProvider, +// newAliCloudProvider, +// newIbmProvider, // Cloud - newDigitalOceanProvider, +// newDigitalOceanProvider, newEquinixMetalProvider, - newFastlyProvider, - newHerokuProvider, - newLinodeProvider, - newNs1Provider, - newOpenStackProvider, - newTencentCloudProvider, - newVultrProvider, +// newFastlyProvider, +// newHerokuProvider, +// newLinodeProvider, +// newNs1Provider, +// newOpenStackProvider, +// newTencentCloudProvider, +// newVultrProvider, // Infrastructure Software - newKubernetesProvider, - newOctopusDeployProvider, - newRabbitMQProvider, +// newKubernetesProvider, +// newOctopusDeployProvider, +// newRabbitMQProvider, // Network - newCloudflareProvider, +// newCloudflareProvider, // VCS - newGitHubProvider, +// newGitHubProvider, // Monitoring & System Management - newDataDogProvider, - newNewRelicProvider, +// newDataDogProvider, +// newNewRelicProvider, // Community - newKeycloakProvider, - newLogzioProvider, - newCommercetoolsProvider, - newMikrotikProvider, - newGmailfilterProvider, +// newKeycloakProvider, +// newLogzioProvider, +// newCommercetoolsProvider, +// newMikrotikProvider, +// newGmailfilterProvider, } { list[providerGen().GetName()] = providerGen } diff --git a/providers/equinixmetal/equinixmetal_service.go b/providers/equinixmetal/equinixmetal_service.go index 0d425edbf2..3151ad59c3 100644 --- a/providers/equinixmetal/equinixmetal_service.go +++ b/providers/equinixmetal/equinixmetal_service.go @@ -15,11 +15,8 @@ package equinixmetal import ( - // "context" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/packethost/packngo" - // "golang.org/x/oauth2" ) type EquinixMetalService struct { //nolint From 206415d8b35b10f77685bab5973f466513338cf3 Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Sun, 4 Apr 2021 01:49:52 -0500 Subject: [PATCH 138/276] Updates cmd/root.go to add EquinixMetal provider --- cmd/root.go | 102 ++++++++++++++++++++++++++-------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 4a364724d7..f2dbfe95aa 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -39,39 +39,39 @@ func Execute() error { func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command { return []func(options ImportOptions) *cobra.Command{ // Major Cloud -// newCmdGoogleImporter, -// newCmdAwsImporter, -// newCmdAzureImporter, -// newCmdAliCloudImporter, -// newCmdIbmImporter, + newCmdGoogleImporter, + newCmdAwsImporter, + newCmdAzureImporter, + newCmdAliCloudImporter, + newCmdIbmImporter, // Cloud -// newCmdDigitalOceanImporter, + newCmdDigitalOceanImporter, newCmdEquinixMetalImporter, -// newCmdFastlyImporter, -// newCmdHerokuImporter, -// newCmdLinodeImporter, -// newCmdNs1Importer, -// newCmdOpenStackImporter, -// newCmdTencentCloudImporter, -// newCmdVultrImporter, -// newCmdYandexImporter, + newCmdFastlyImporter, + newCmdHerokuImporter, + newCmdLinodeImporter, + newCmdNs1Importer, + newCmdOpenStackImporter, + newCmdTencentCloudImporter, + newCmdVultrImporter, + newCmdYandexImporter, // Infrastructure Software -// newCmdKubernetesImporter, -// newCmdOctopusDeployImporter, -// newCmdRabbitMQImporter, + newCmdKubernetesImporter, + newCmdOctopusDeployImporter, + newCmdRabbitMQImporter, // Network -// newCmdCloudflareImporter, + newCmdCloudflareImporter, // VCS -// newCmdGithubImporter, + newCmdGithubImporter, // Monitoring & System Management -// newCmdDatadogImporter, -// newCmdNewRelicImporter, + newCmdDatadogImporter, + newCmdNewRelicImporter, // Community -// newCmdKeycloakImporter, -// newCmdLogzioImporter, -// newCmdCommercetoolsImporter, -// newCmdMikrotikImporter, -// newCmdGmailfilterImporter, + newCmdKeycloakImporter, + newCmdLogzioImporter, + newCmdCommercetoolsImporter, + newCmdMikrotikImporter, + newCmdGmailfilterImporter, } } @@ -79,38 +79,38 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { list := make(map[string]func() terraformutils.ProviderGenerator) for _, providerGen := range []func() terraformutils.ProviderGenerator{ // Major Cloud -// newGoogleProvider, -// newAWSProvider, -// newAzureProvider, -// newAliCloudProvider, -// newIbmProvider, + newGoogleProvider, + newAWSProvider, + newAzureProvider, + newAliCloudProvider, + newIbmProvider, // Cloud -// newDigitalOceanProvider, + newDigitalOceanProvider, newEquinixMetalProvider, -// newFastlyProvider, -// newHerokuProvider, -// newLinodeProvider, -// newNs1Provider, -// newOpenStackProvider, -// newTencentCloudProvider, -// newVultrProvider, + newFastlyProvider, + newHerokuProvider, + newLinodeProvider, + newNs1Provider, + newOpenStackProvider, + newTencentCloudProvider, + newVultrProvider, // Infrastructure Software -// newKubernetesProvider, -// newOctopusDeployProvider, -// newRabbitMQProvider, + newKubernetesProvider, + newOctopusDeployProvider, + newRabbitMQProvider, // Network -// newCloudflareProvider, + newCloudflareProvider, // VCS -// newGitHubProvider, + newGitHubProvider, // Monitoring & System Management -// newDataDogProvider, -// newNewRelicProvider, + newDataDogProvider, + newNewRelicProvider, // Community -// newKeycloakProvider, -// newLogzioProvider, -// newCommercetoolsProvider, -// newMikrotikProvider, -// newGmailfilterProvider, + newKeycloakProvider, + newLogzioProvider, + newCommercetoolsProvider, + newMikrotikProvider, + newGmailfilterProvider, } { list[providerGen().GetName()] = providerGen } From 90b5f3cf70bf01425ca2916c85b36252717a4db3 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 4 Apr 2021 17:43:43 +0800 Subject: [PATCH 139/276] #511 ECR adjustments, added ECR public --- README.md | 3 ++ go.mod | 3 +- go.sum | 10 +++--- providers/aws/aws_provider.go | 5 ++- providers/aws/ecr.go | 64 ++++++++++++++++++++++++++++------- providers/aws/ecrpublic.go | 57 +++++++++++++++++++++++++++++++ tests/aws/main.go | 4 +-- 7 files changed, 123 insertions(+), 23 deletions(-) create mode 100644 providers/aws/ecrpublic.go diff --git a/README.md b/README.md index aa6db2a4d8..a6cb688f9c 100644 --- a/README.md +++ b/README.md @@ -564,6 +564,8 @@ In that case terraformer will not know with which region resources are associate * `aws_ecr_lifecycle_policy` * `aws_ecr_repository` * `aws_ecr_repository_policy` +* `ecrpublic` + * `aws_ecrpublic_repository` * `efs` * `aws_efs_access_point` * `aws_efs_file_system` @@ -735,6 +737,7 @@ AWS services that are global will be imported without specified region even if s List of global AWS services: * `budgets` * `cloudfront` +* `ecrpublic` * `iam` * `organization` * `route53` diff --git a/go.mod b/go.mod index 4cb2373c19..2a6a77d4a3 100644 --- a/go.mod +++ b/go.mod @@ -50,6 +50,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.1 github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0 github.com/aws/aws-sdk-go-v2/service/ecr v1.2.1 + github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.2.0 github.com/aws/aws-sdk-go-v2/service/ecs v1.2.1 github.com/aws/aws-sdk-go-v2/service/efs v1.2.1 github.com/aws/aws-sdk-go-v2/service/eks v1.2.1 @@ -91,8 +92,8 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect - github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef // indirect github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 + github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.57.0 diff --git a/go.sum b/go.sum index 83ae5095ba..81eaa137f0 100644 --- a/go.sum +++ b/go.sum @@ -227,6 +227,8 @@ github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0 h1:y82WbYudKuiWx0KuKQheqTQ4RIF8Z github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0/go.mod h1:KW2/Fgs+L1m1X53O9hTFpJqPtLyYGbf9j1Ay5xPSy74= github.com/aws/aws-sdk-go-v2/service/ecr v1.2.1 h1:rdvoJaE51N1tuNc2B75vNsZu2P0xV6y7ibOAwNeb1mI= github.com/aws/aws-sdk-go-v2/service/ecr v1.2.1/go.mod h1:iuqVazSEO7GWaX6WYrVWCVECL3ixXwhL6Q6RF4V2Db0= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.2.0 h1:Qb0q2R4dff4/e/qvSVPyTs3ZME+zlzN8HDCm0+F1Ko0= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.2.0/go.mod h1:njYzwMTk1bscTUcF56dR9DO5ORsVaV6FMQC+/wZNGjU= github.com/aws/aws-sdk-go-v2/service/ecs v1.2.1 h1:T8CKZFKySyOivXUc/80qlvNqvX9MQvvRCxFQCL6xxQU= github.com/aws/aws-sdk-go-v2/service/ecs v1.2.1/go.mod h1:7gzy9DNs3NWZnxJcV61X0EjhLzDuZm8uUA+moRIoiKs= github.com/aws/aws-sdk-go-v2/service/efs v1.2.1 h1:Cm/7OSlvQVPQpksrq7FYXw75Uv1D8++CA6tcWMb6y38= @@ -311,7 +313,6 @@ github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1 h1:hSzpp50D6D37eIELSSpYwJ github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1/go.mod h1:8k9EEz8LMNPUDENPlW0laaQkAZC2TbEYF+XNUu1lFLk= github.com/aws/aws-sdk-go-v2/service/xray v1.2.1 h1:RiTWbH90tIuJNnZZys9HeqBfpT3oSPulh7fM7anPQiY= github.com/aws/aws-sdk-go-v2/service/xray v1.2.1/go.mod h1:MZS769M8/1Xm4XYQydDJbvugo7dG8fXzsVU3J84QXzY= -github.com/aws/smithy-go v1.2.0 h1:0PoGBWXkXDIyVdPaZW9gMhaGzj3UOAgTdiVoHuuZAFA= github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.3.0 h1:awbB2OJBZ/Txj+c4q+qhDQs3Ob0sRhBuIIkOD4Aq8yc= github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= @@ -367,13 +368,10 @@ github.com/cucumber/messages-go/v12 v12.0.0/go.mod h1:5zuJu21U6rB+BBqyGoQr839a4h github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315/go.mod h1:QXiCu8WKyFL/X+NMCmtxoCq/jSOb54R4iDXdjsaYEWA= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef h1:q/XC0MjIz8cl/NtyKKewDns6mNd2cUzLQ5Xnh+jGoRg= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1 h1:P0a6ZVjbOqzOYqsSSWWF19dHaxX2AuHcv9kQafNVC+Y= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 h1:AMuZg5VR0/QGCqFpO4CUwAhZc4tbgDHpM8c4SvMt2yM= github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4/go.mod h1:JrRtRlTHCkdIr7OTHCAonKS2yWwmwdqnvf+JEy+OYAA= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef h1:q/XC0MjIz8cl/NtyKKewDns6mNd2cUzLQ5Xnh+jGoRg= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 h1:ujQ4DKs+MqFWy/hoLAU4Ey/nQhqJ6pXyocMDbVJ4qSw= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dghubble/sling v1.1.0 h1:DLu20Bq2qsB9cI5Hldaxj+TMPEaPpPE8IR2kvD22Atg= diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index 1e96ee65a4..9088c1227c 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -30,6 +30,7 @@ type AWSProvider struct { //nolint } const GlobalRegion = "aws-global" +const MainRegionPublicPartition = "us-east-1" const NoRegion = "" // SupportedGlobalResources should be bound to a default region. AWS doesn't specify in which region default services are @@ -39,6 +40,7 @@ const NoRegion = "" var SupportedGlobalResources = []string{ "budgets", "cloudfront", + "ecrpublic", "iam", "organization", "route53", @@ -142,7 +144,7 @@ func (p AWSProvider) GetProviderData(arg ...string) map[string]interface{} { awsConfig := map[string]interface{}{} if p.region == GlobalRegion { - awsConfig["region"] = "us-east-1" // For TF to workaround terraform-providers/terraform-provider-aws#1043 + awsConfig["region"] = MainRegionPublicPartition // For TF to workaround terraform-providers/terraform-provider-aws#1043 } else if p.region != NoRegion { awsConfig["region"] = p.region } @@ -253,6 +255,7 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "ebs": &AwsFacade{service: &EbsGenerator{}}, "ec2_instance": &AwsFacade{service: &Ec2Generator{}}, "ecr": &AwsFacade{service: &EcrGenerator{}}, + "ecrpublic": &AwsFacade{service: &EcrPublicGenerator{}}, "ecs": &AwsFacade{service: &EcsGenerator{}}, "efs": &AwsFacade{service: &EfsGenerator{}}, "eks": &AwsFacade{service: &EksGenerator{}}, diff --git a/providers/aws/ecr.go b/providers/aws/ecr.go index f5b3aec5a7..4d68eb142f 100644 --- a/providers/aws/ecr.go +++ b/providers/aws/ecr.go @@ -16,9 +16,11 @@ package aws import ( "context" + "fmt" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/ecr" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) var ecrAllowEmptyValues = []string{"tags."} @@ -32,6 +34,7 @@ func (g *EcrGenerator) InitResources() error { if e != nil { return e } + svc := ecr.NewFromConfig(config) p := ecr.NewDescribeRepositoriesPaginator(svc, &ecr.DescribeRepositoriesInput{}) @@ -47,18 +50,53 @@ func (g *EcrGenerator) InitResources() error { "aws_ecr_repository", "aws", ecrAllowEmptyValues)) - g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - *repository.RepositoryName, - *repository.RepositoryName, - "aws_ecr_repository_policy", - "aws", - ecrAllowEmptyValues)) - g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - *repository.RepositoryName, - *repository.RepositoryName, - "aws_ecr_lifecycle_policy", - "aws", - ecrAllowEmptyValues)) + + _, err := svc.GetRepositoryPolicy(context.TODO(), &ecr.GetRepositoryPolicyInput{ + RepositoryName: repository.RepositoryName, + RegistryId: repository.RegistryId, + }) + if err == nil { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + *repository.RepositoryName, + *repository.RepositoryName, + "aws_ecr_repository_policy", + "aws", + ecrAllowEmptyValues)) + } + + _, err = svc.GetLifecyclePolicy(context.TODO(), &ecr.GetLifecyclePolicyInput{ + RepositoryName: repository.RepositoryName, + RegistryId: repository.RegistryId, + }) + if err == nil { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + *repository.RepositoryName, + *repository.RepositoryName, + "aws_ecr_lifecycle_policy", + "aws", + ecrAllowEmptyValues)) + } + } + } + return nil +} + +func (g *EcrGenerator) PostConvertHook() error { + for i, resource := range g.Resources { + if resource.InstanceInfo.Type == "aws_ecr_repository_policy" { + if val, ok := g.Resources[i].Item["policy"]; ok { + policy := g.escapeAwsInterpolation(val.(string)) + g.Resources[i].Item["policy"] = fmt.Sprintf(`< Date: Sun, 4 Apr 2021 05:58:54 -0500 Subject: [PATCH 140/276] Adds resource generators to metal provider --- cmd/root.go | 52 +++++++++---------- .../equinixmetal/equinixmetal_provider.go | 10 ++-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index f2dbfe95aa..338454cf6a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -39,39 +39,39 @@ func Execute() error { func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command { return []func(options ImportOptions) *cobra.Command{ // Major Cloud - newCmdGoogleImporter, - newCmdAwsImporter, - newCmdAzureImporter, - newCmdAliCloudImporter, - newCmdIbmImporter, + newCmdGoogleImporter, + newCmdAwsImporter, + newCmdAzureImporter, + newCmdAliCloudImporter, + newCmdIbmImporter, // Cloud - newCmdDigitalOceanImporter, + newCmdDigitalOceanImporter, newCmdEquinixMetalImporter, - newCmdFastlyImporter, - newCmdHerokuImporter, - newCmdLinodeImporter, - newCmdNs1Importer, - newCmdOpenStackImporter, - newCmdTencentCloudImporter, - newCmdVultrImporter, - newCmdYandexImporter, + newCmdFastlyImporter, + newCmdHerokuImporter, + newCmdLinodeImporter, + newCmdNs1Importer, + newCmdOpenStackImporter, + newCmdTencentCloudImporter, + newCmdVultrImporter, + newCmdYandexImporter, // Infrastructure Software - newCmdKubernetesImporter, - newCmdOctopusDeployImporter, - newCmdRabbitMQImporter, + newCmdKubernetesImporter, + newCmdOctopusDeployImporter, + newCmdRabbitMQImporter, // Network - newCmdCloudflareImporter, + newCmdCloudflareImporter, // VCS - newCmdGithubImporter, + newCmdGithubImporter, // Monitoring & System Management - newCmdDatadogImporter, - newCmdNewRelicImporter, + newCmdDatadogImporter, + newCmdNewRelicImporter, // Community - newCmdKeycloakImporter, - newCmdLogzioImporter, - newCmdCommercetoolsImporter, - newCmdMikrotikImporter, - newCmdGmailfilterImporter, + newCmdKeycloakImporter, + newCmdLogzioImporter, + newCmdCommercetoolsImporter, + newCmdMikrotikImporter, + newCmdGmailfilterImporter, } } diff --git a/providers/equinixmetal/equinixmetal_provider.go b/providers/equinixmetal/equinixmetal_provider.go index 6f7d7a9de2..64e9f247d1 100644 --- a/providers/equinixmetal/equinixmetal_provider.go +++ b/providers/equinixmetal/equinixmetal_provider.go @@ -37,7 +37,7 @@ func (p *EquinixMetalProvider) Init(args []string) error { return errors.New("set METAL_PROJECT_ID env var") } p.project_id = os.Getenv("METAL_PROJECT_ID") - + return nil } @@ -55,10 +55,10 @@ func (EquinixMetalProvider) GetResourceConnections() map[string]map[string][]str func (p *EquinixMetalProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "device": &DeviceGenerator{}, - "sshkey": &SshKeyGenerator{}, - "spotmarketrequest": &SpotMarketRequestGenerator{}, - "volume": &VolumeGenerator{}, + "device": &DeviceGenerator{}, + "sshkey": &SshKeyGenerator{}, + "spotmarketrequest": &SpotMarketRequestGenerator{}, + "volume": &VolumeGenerator{}, } } From 82cf2bb76f7b275d0da04a668acba88a2bd358ce Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sun, 4 Apr 2021 21:54:08 +0800 Subject: [PATCH 141/276] #830 added SSM PS --- README.md | 2 ++ go.mod | 1 + go.sum | 2 ++ providers/aws/aws_provider.go | 1 + providers/aws/ecrpublic.go | 1 + providers/aws/ssm.go | 55 ++++++++++++++++++++++++++++++++++ providers/xenorchestra/acls.go | 2 +- tests/aws/main.go | 4 +-- 8 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 providers/aws/ssm.go diff --git a/README.md b/README.md index a6cb688f9c..48285e0e89 100644 --- a/README.md +++ b/README.md @@ -682,6 +682,8 @@ In that case terraformer will not know with which region resources are associate * `aws_sns_topic_subscription` * `sqs` * `aws_sqs_queue` +* `ssm` + * `aws_ssm_parameter` * `subnet` * `aws_subnet` * `swf` diff --git a/go.mod b/go.mod index 2a6a77d4a3..23e00c8b07 100644 --- a/go.mod +++ b/go.mod @@ -83,6 +83,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sfn v1.2.1 github.com/aws/aws-sdk-go-v2/service/sns v1.2.1 github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0 + github.com/aws/aws-sdk-go-v2/service/ssm v1.3.0 github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 github.com/aws/aws-sdk-go-v2/service/swf v1.2.1 github.com/aws/aws-sdk-go-v2/service/waf v1.1.3 diff --git a/go.sum b/go.sum index 81eaa137f0..257a2c23ea 100644 --- a/go.sum +++ b/go.sum @@ -299,6 +299,8 @@ github.com/aws/aws-sdk-go-v2/service/sns v1.2.1 h1:IVHrunoAsIp1OV445PE84mM+WArZC github.com/aws/aws-sdk-go-v2/service/sns v1.2.1/go.mod h1:23FVJ4I/AHqbkh4vMa1Cz6/vXMCuMLPkU9Pi4RCFgxk= github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0 h1:iePzn4Gr4p5QKat3G7snhUvopc/lOj25ZiPJ4/PPzq8= github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0/go.mod h1:9bo6m/Pes+TR6ORT97E1BkczbSgbpKB1qTyFt08s9yw= +github.com/aws/aws-sdk-go-v2/service/ssm v1.3.0 h1:0swJm4MqIjN1v1tM9GQ8hGv+KXv4smEiftpAXg84aZg= +github.com/aws/aws-sdk-go-v2/service/ssm v1.3.0/go.mod h1:WX5OhauvURAo0+ljp29uEIitBkt3+Y3RGnVa9ix2xc8= github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 h1:Tr/SsFDXWN8rntdzTNrDs/MvuBXRCjY6xvJrPFUPKRM= github.com/aws/aws-sdk-go-v2/service/sso v1.1.4/go.mod h1:yQayEbOWH75NaKFylsFocBc3yanYEGndlOaH4i/Lvno= github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 h1:1koRvKlZMN+FhTGV5f4q6vRHXNJzeZlPKzbs1/Y32Kg= diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index 9088c1227c..65001ff61f 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -295,6 +295,7 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "sg": &AwsFacade{service: &SecurityGenerator{}}, "sqs": &AwsFacade{service: &SqsGenerator{}}, "sns": &AwsFacade{service: &SnsGenerator{}}, + "ssm": &AwsFacade{service: &SsmGenerator{}}, "subnet": &AwsFacade{service: &SubnetGenerator{}}, "swf": &AwsFacade{service: &SWFGenerator{}}, "transit_gateway": &AwsFacade{service: &TransitGatewayGenerator{}}, diff --git a/providers/aws/ecrpublic.go b/providers/aws/ecrpublic.go index 5f6c1d3c53..706424a89b 100644 --- a/providers/aws/ecrpublic.go +++ b/providers/aws/ecrpublic.go @@ -16,6 +16,7 @@ package aws import ( "context" + "github.com/aws/aws-sdk-go-v2/service/ecrpublic" "github.com/GoogleCloudPlatform/terraformer/terraformutils" diff --git a/providers/aws/ssm.go b/providers/aws/ssm.go new file mode 100644 index 0000000000..99f2b04e16 --- /dev/null +++ b/providers/aws/ssm.go @@ -0,0 +1,55 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aws + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + + "github.com/aws/aws-sdk-go-v2/service/ssm" +) + +var ssmAllowEmptyValues = []string{"tags."} + +type SsmGenerator struct { + AWSService +} + +func (g *SsmGenerator) InitResources() error { + config, e := g.generateConfig() + if e != nil { + return e + } + svc := ssm.NewFromConfig(config) + p := ssm.NewDescribeParametersPaginator(svc, &ssm.DescribeParametersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, parameter := range page.Parameters { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(parameter.Name), + StringValue(parameter.Name), + "aws_ssm_parameter", + "aws", + ssmAllowEmptyValues, + )) + } + } + + return nil +} diff --git a/providers/xenorchestra/acls.go b/providers/xenorchestra/acls.go index 0ea57a5c7a..f5ea6b1355 100644 --- a/providers/xenorchestra/acls.go +++ b/providers/xenorchestra/acls.go @@ -18,7 +18,7 @@ import ( "github.com/ddelnano/terraform-provider-xenorchestra/client" ) -type AclGenerator struct { +type AclGenerator struct { //nolint XenorchestraService } diff --git a/tests/aws/main.go b/tests/aws/main.go index 9db96e84e7..f555f86c7f 100644 --- a/tests/aws/main.go +++ b/tests/aws/main.go @@ -30,8 +30,8 @@ func main() { tCommand.SetArgs([]string{ "import", "aws", - "--regions=us-east-1", - "--resources=ecrpublic", + "--regions=ap-southeast-1", + "--resources=ssm", "--profile=personal", "--verbose", "--compact", From 3cfc1e20c6b0077e34f6edefaff389d05ab354ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Apr 2021 06:42:20 +0000 Subject: [PATCH 142/276] Bump github.com/aws/aws-sdk-go-v2/service/waf from 1.1.3 to 1.1.4 Bumps [github.com/aws/aws-sdk-go-v2/service/waf](https://github.com/aws/aws-sdk-go-v2) from 1.1.3 to 1.1.4. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.1.3...config/v1.1.4) Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 4cb2373c19..d8e228c99b 100644 --- a/go.mod +++ b/go.mod @@ -84,15 +84,15 @@ require ( github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0 github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 github.com/aws/aws-sdk-go-v2/service/swf v1.2.1 - github.com/aws/aws-sdk-go-v2/service/waf v1.1.3 + github.com/aws/aws-sdk-go-v2/service/waf v1.1.4 github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1 github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1 github.com/aws/aws-sdk-go-v2/service/xray v1.2.1 github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect - github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef // indirect github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 + github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.57.0 diff --git a/go.sum b/go.sum index 83ae5095ba..589f57aa3a 100644 --- a/go.sum +++ b/go.sum @@ -303,15 +303,14 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 h1:1koRvKlZMN+FhTGV5f4q6vRHXNJze github.com/aws/aws-sdk-go-v2/service/sts v1.2.1/go.mod h1:L1LH5nHMXxdkKj057ZUx7Wi50CCrkZ+9jkTnBnY2j/w= github.com/aws/aws-sdk-go-v2/service/swf v1.2.1 h1:oRzuG8uLuYbUysx6lSJ/h1yHItT7CCq8wNjKt2SO5Yo= github.com/aws/aws-sdk-go-v2/service/swf v1.2.1/go.mod h1:8oZdl0gL0mdCdkAqDvr2f2DFNCWgFmiUnRSJv/4qQ8c= -github.com/aws/aws-sdk-go-v2/service/waf v1.1.3 h1:IEGT5besMwoerkUfEI7WD/JhCKbHMXrMmaCC8T5vTHc= -github.com/aws/aws-sdk-go-v2/service/waf v1.1.3/go.mod h1:44wRNKMQN6/Cq8XgtZOxwv9oQ92bbvUbb9HSFp5XDRA= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.4 h1:Wh0YMwF394A9eBC8Pv8Uxk6CBx9KTWmoqyflQIBx6DU= +github.com/aws/aws-sdk-go-v2/service/waf v1.1.4/go.mod h1:Ujifac0yyu5RLw3cPCGua50uHnsjiJo9LAhXEJZ+tVk= github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1 h1:Re8Uwffnndo9t8V46kT3aruMvVXHXUmuYKhIF1U9CBc= github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1/go.mod h1:WvRSWmA7SJw0TbU0XKCo+oC/qsD/OR/tFRzTnq8FBpk= github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1 h1:hSzpp50D6D37eIELSSpYwJ75e8XL9bvTzjspZgt4+5A= github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1/go.mod h1:8k9EEz8LMNPUDENPlW0laaQkAZC2TbEYF+XNUu1lFLk= github.com/aws/aws-sdk-go-v2/service/xray v1.2.1 h1:RiTWbH90tIuJNnZZys9HeqBfpT3oSPulh7fM7anPQiY= github.com/aws/aws-sdk-go-v2/service/xray v1.2.1/go.mod h1:MZS769M8/1Xm4XYQydDJbvugo7dG8fXzsVU3J84QXzY= -github.com/aws/smithy-go v1.2.0 h1:0PoGBWXkXDIyVdPaZW9gMhaGzj3UOAgTdiVoHuuZAFA= github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.3.0 h1:awbB2OJBZ/Txj+c4q+qhDQs3Ob0sRhBuIIkOD4Aq8yc= github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= @@ -367,13 +366,10 @@ github.com/cucumber/messages-go/v12 v12.0.0/go.mod h1:5zuJu21U6rB+BBqyGoQr839a4h github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315/go.mod h1:QXiCu8WKyFL/X+NMCmtxoCq/jSOb54R4iDXdjsaYEWA= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef h1:q/XC0MjIz8cl/NtyKKewDns6mNd2cUzLQ5Xnh+jGoRg= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1 h1:P0a6ZVjbOqzOYqsSSWWF19dHaxX2AuHcv9kQafNVC+Y= -github.com/ddelnano/terraform-provider-xenorchestra/client v0.18.0-alpha1/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 h1:AMuZg5VR0/QGCqFpO4CUwAhZc4tbgDHpM8c4SvMt2yM= github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4/go.mod h1:JrRtRlTHCkdIr7OTHCAonKS2yWwmwdqnvf+JEy+OYAA= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef h1:q/XC0MjIz8cl/NtyKKewDns6mNd2cUzLQ5Xnh+jGoRg= +github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 h1:ujQ4DKs+MqFWy/hoLAU4Ey/nQhqJ6pXyocMDbVJ4qSw= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dghubble/sling v1.1.0 h1:DLu20Bq2qsB9cI5Hldaxj+TMPEaPpPE8IR2kvD22Atg= From 11cc864796cf9291b02bdfdf17ea201369ac29dd Mon Sep 17 00:00:00 2001 From: Herby Gillot Date: Mon, 5 Apr 2021 09:32:04 -0400 Subject: [PATCH 143/276] README: add MacPorts installation info --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 48285e0e89..2ad03d7d57 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,7 @@ sudo mv terraformer-${PROVIDER}-darwin-amd64 /usr/local/bin/terraformer If you want to use a package manager: - [Homebrew](https://brew.sh/) users can use `brew install terraformer`. +- [MacPorts](https://www.macports.org/) users can use `sudo port install terraformer`. - [Chocolatey](https://chocolatey.org/) users can use `choco install terraformer`. Links to download Terraform Providers: From 5ec47479244e7ac94108059600ac33d0a423f734 Mon Sep 17 00:00:00 2001 From: Sherzod K Date: Mon, 5 Apr 2021 14:48:04 -0400 Subject: [PATCH 144/276] espace "." characters and fix output interpolation --- terraformutils/providerwrapper/provider.go | 16 ++++++++-------- terraformutils/terraformoutput/hcl.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index f85d5cedd9..8c3412621a 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -106,7 +106,7 @@ func (p *ProviderWrapper) GetReadOnlyAttributes(resourceTypes []string) (map[str for k, v := range obj.Block.Attributes { if !v.Optional && !v.Required { if v.Type.IsListType() || v.Type.IsSetType() { - readOnlyAttributes[resourceName] = append(readOnlyAttributes[resourceName], "^"+k+".(.*)") + readOnlyAttributes[resourceName] = append(readOnlyAttributes[resourceName], "^"+k+"\\.(.*)") } else { readOnlyAttributes[resourceName] = append(readOnlyAttributes[resourceName], "^"+k+"$") } @@ -124,7 +124,7 @@ func (p *ProviderWrapper) readObjBlocks(block map[string]*configschema.NestedBlo if parent == "-1" { readOnlyAttributes = p.readObjBlocks(v.BlockTypes, readOnlyAttributes, k) } else { - readOnlyAttributes = p.readObjBlocks(v.BlockTypes, readOnlyAttributes, parent+".[0-9]+."+k) + readOnlyAttributes = p.readObjBlocks(v.BlockTypes, readOnlyAttributes, parent+"\\.[0-9]+\\."+k) } } fieldCount := 0 @@ -134,20 +134,20 @@ func (p *ProviderWrapper) readObjBlocks(block map[string]*configschema.NestedBlo switch v.Nesting { case configschema.NestingList: if parent == "-1" { - readOnlyAttributes = append(readOnlyAttributes, "^"+k+".[0-9]+."+key+"($|\\.[0-9]+|\\.#)") + readOnlyAttributes = append(readOnlyAttributes, "^"+k+"\\.[0-9]+\\."+key+"($|\\.[0-9]+|\\.#)") } else { - readOnlyAttributes = append(readOnlyAttributes, "^"+parent+".(.*)."+key+"$") + readOnlyAttributes = append(readOnlyAttributes, "^"+parent+"\\.(.*)\\."+key+"$") } case configschema.NestingSet: if parent == "-1" { - readOnlyAttributes = append(readOnlyAttributes, "^"+k+".[0-9]+."+key+"$") + readOnlyAttributes = append(readOnlyAttributes, "^"+k+"\\.[0-9]+\\."+key+"$") } else { - readOnlyAttributes = append(readOnlyAttributes, "^"+parent+".(.*)."+key+"($|\\.(.*))") + readOnlyAttributes = append(readOnlyAttributes, "^"+parent+"\\.(.*)\\."+key+"($|\\.(.*))") } case configschema.NestingMap: - readOnlyAttributes = append(readOnlyAttributes, parent+"."+key) + readOnlyAttributes = append(readOnlyAttributes, parent+"\\."+key) default: - readOnlyAttributes = append(readOnlyAttributes, parent+"."+key+"$") + readOnlyAttributes = append(readOnlyAttributes, parent+"\\."+key+"$") } } } diff --git a/terraformutils/terraformoutput/hcl.go b/terraformutils/terraformoutput/hcl.go index ef0c58085e..de03ec3b5b 100644 --- a/terraformutils/terraformoutput/hcl.go +++ b/terraformutils/terraformoutput/hcl.go @@ -52,7 +52,7 @@ func OutputHclFiles(resources []terraformutils.Resource, provider terraformutils for i, r := range resources { outputState := map[string]*terraform.OutputState{} outputsByResource[r.InstanceInfo.Type+"_"+r.ResourceName+"_"+r.GetIDKey()] = map[string]interface{}{ - "value": r.InstanceInfo.Type + "." + r.ResourceName + "." + r.GetIDKey(), + "value": "${" + r.InstanceInfo.Type + "." + r.ResourceName + "." + r.GetIDKey() + "}", } outputState[r.InstanceInfo.Type+"_"+r.ResourceName+"_"+r.GetIDKey()] = &terraform.OutputState{ Type: "string", @@ -68,7 +68,7 @@ func OutputHclFiles(resources []terraformutils.Resource, provider terraformutils } linkKey := r.InstanceInfo.Type + "_" + r.ResourceName + "_" + key outputsByResource[linkKey] = map[string]interface{}{ - "value": r.InstanceInfo.Type + "." + r.ResourceName + "." + key, + "value": "${" + r.InstanceInfo.Type + "." + r.ResourceName + "." + key + "}", } outputState[linkKey] = &terraform.OutputState{ Type: "string", From 947924f1c0ef6732e74775d2f9698b7a9ab0b1ed Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Tue, 6 Apr 2021 03:57:16 -0500 Subject: [PATCH 145/276] Dependencies check --- go.sum | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index c290584661..296715dbd7 100644 --- a/go.sum +++ b/go.sum @@ -149,6 +149,7 @@ github.com/alecthomas/gometalinter v3.0.0+incompatible h1:e9Zfvfytsw/e6Kd/PYd75w github.com/alecthomas/gometalinter v3.0.0+incompatible/go.mod h1:qfIpQGGz3d+NmgyPBqv+LSh50emm1pt72EtcX2vKYQk= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= @@ -348,6 +349,7 @@ github.com/aws/aws-sdk-go-v2/service/xray v1.2.1/go.mod h1:MZS769M8/1Xm4XYQydDJb github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.3.0 h1:awbB2OJBZ/Txj+c4q+qhDQs3Ob0sRhBuIIkOD4Aq8yc= github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= @@ -494,6 +496,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj9zFpCNE+UDefwwFRijKjzvHNCM= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655 h1:hKQ7ba/nVgQ0sGq8KBWJ7hdm0CEN48AlIYjBmfzCQzQ= github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= @@ -540,6 +543,7 @@ github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhY github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730 h1:EuqwWLv/LPPjhvFqkeD2bz+FOlvw2DjvDI7vK8GVeyY= github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -781,6 +785,7 @@ github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352 github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= github.com/hashicorp/hcl2 v0.0.0-20190909202536-66c59f909e25 h1:hP3bdZpTEdjGFXQZyeeRsYH1oJgOBGx5sMLYPqZuqOU= github.com/hashicorp/hcl2 v0.0.0-20190909202536-66c59f909e25/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= +github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 h1:T1Q6ag9tCwun16AW+XK3tAql24P4uTGUMIn1/92WsQQ= github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= @@ -1012,6 +1017,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= @@ -1047,6 +1053,7 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -1134,9 +1141,9 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 h1:j3HKQAXXj5vV3oHyg9pjK3uIM4bidukvv+tR2iJCvFA= github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750/go.mod h1:ZafdZgk/axhT1cvZAPOhw+95nz2I/Ra5qMlU4gTRwIo= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= From 5d80a5f964c646bbc5ac9fa40dcca9bbb475d813 Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Tue, 6 Apr 2021 04:10:48 -0500 Subject: [PATCH 146/276] Dependency checks --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5520ec05f7..8cf022c672 100644 --- a/go.mod +++ b/go.mod @@ -117,7 +117,7 @@ require ( github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/nicksnyder/go-i18n v1.10.1 // indirect github.com/ns1/ns1-go v2.4.0+incompatible - github.com/packethost/packngo v0.9.0 + github.com/packethost/packngo v0.9.0 // indirect github.com/paultyng/go-newrelic/v4 v4.10.0 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.1.1 From bb8fb3bd98c53262d26ab7ec332b4dccbcb710bc Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Tue, 6 Apr 2021 12:21:54 -0500 Subject: [PATCH 147/276] Updates README to include resource coverage and usage for Equinix Metal --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 2ad03d7d57..16e956cd18 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [IBM Cloud](#use-with-ibm-cloud) * Cloud * [DigitalOcean](#use-with-digitalocean) + * [Equinix Metal](#use-with-equinixmetal) * [Fastly](#use-with-fastly) * [Heroku](#use-with-heroku) * [Linode](#use-with-linode) @@ -1084,6 +1085,27 @@ List of supported DigitalOcean resources: * `volume_snapshot` * `digitalocean_volume_snapshot` +### Use with Equinix Metal + +Example: + +``` +export METAL_AUTH_TOKEN=[METAL_AUTH_TOKEN] +export PACKET_PROJECT_ID=[PROJECT_ID] +./terraformer import metal -r volume,device +``` + +List of supported Equinix Metal resources: + +* `device` + * `metal_device` +* `volume` + * `metal_volume` +* `sshkey` + * `metal_ssh_key` +* `spotmarketrequest` + * `metal_spot_market_request` + ### Use with Fastly Example: From 7b44b7f5cdd772524e58122fd9e3f63777e76a15 Mon Sep 17 00:00:00 2001 From: "Joseph D. Marhee" Date: Tue, 6 Apr 2021 12:23:34 -0500 Subject: [PATCH 148/276] Updates link in README to Equinix Metal --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 16e956cd18..9c1b1f3645 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [IBM Cloud](#use-with-ibm-cloud) * Cloud * [DigitalOcean](#use-with-digitalocean) - * [Equinix Metal](#use-with-equinixmetal) + * [Equinix Metal](#use-with-equinix-metal) * [Fastly](#use-with-fastly) * [Heroku](#use-with-heroku) * [Linode](#use-with-linode) From 3033747fb5da8d0f5f6c61a7f1d93b6dd4994ca0 Mon Sep 17 00:00:00 2001 From: Sherzod K Date: Tue, 6 Apr 2021 15:19:48 -0400 Subject: [PATCH 149/276] Add resource connections and update dd client --- go.mod | 2 +- go.sum | 32 +++++--- providers/datadog/dashboard.go | 2 +- providers/datadog/datadog_provider.go | 105 ++++++++++++++++++++++++-- 4 files changed, 121 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index f05abe65d2..2bf9bfcfcd 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/Azure/azure-sdk-for-go v42.3.0+incompatible github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 - github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 + github.com/DataDog/datadog-api-client-go v1.0.0-beta.18 github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 diff --git a/go.sum b/go.sum index 9df7ff1868..ee25d578ee 100644 --- a/go.sum +++ b/go.sum @@ -90,10 +90,10 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.14 h1:NbJeCxYBhThksWgk6Z9QpaFc/z2k0mcs7ZVnCRREeZU= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.14/go.mod h1:/bMeu+q33QzX2JuO5PkGkhU1VYOXIXKEPF6Ck4yR06M= -github.com/DataDog/datadog-go v3.6.0+incompatible h1:ILg7c5Y1KvZFDOaVS0higGmJ5Fal5O1KQrkrT9j6dSM= -github.com/DataDog/datadog-go v3.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/datadog-api-client-go v1.0.0-beta.18 h1:4i51yRTWm8SEuc9iRxxFicm59jQcAo70v+3ddZhEq8Q= +github.com/DataDog/datadog-api-client-go v1.0.0-beta.18/go.mod h1:Gn0fZwIOBbSidO0OaPEh9nO5EmIPsxJrHfHvfVXEaoU= +github.com/DataDog/datadog-go v4.4.0+incompatible h1:R7WqXWP4fIOAqWJtUKmSfuc7eDsBT58k9AY5WSHVosk= +github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 h1:sUpBb2/GC8L6UOKDnbEZLRTxQB2RQgMv1mxbnOHOQW4= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= @@ -111,6 +111,8 @@ github.com/IBM/networking-go-sdk v0.13.0 h1:MKDL0c5Gnc6BT10lCS1S1pZVz71UmX4mJC4e github.com/IBM/networking-go-sdk v0.13.0/go.mod h1:3/QnBTwCXAWoz98dw3z37UUfpkIwAwi8qDGntNt6F6A= github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= @@ -417,9 +419,10 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj9zFpCNE+UDefwwFRijKjzvHNCM= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= -github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655 h1:hKQ7ba/nVgQ0sGq8KBWJ7hdm0CEN48AlIYjBmfzCQzQ= -github.com/go-bdd/gobdd v1.1.2-0.20200703080921-409b71954655/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= +github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786 h1:upeQpV8AFGWxWvlu2LpJojgvWOU2SyiG+XvYerMGaCw= +github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -565,11 +568,14 @@ github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210125172800-10e9aeb4a998/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -830,6 +836,7 @@ github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= @@ -860,6 +867,7 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -871,8 +879,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1188,6 +1196,7 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1233,9 +1242,10 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1420,8 +1430,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/DataDog/dd-trace-go.v1 v1.24.1 h1:CGQIcKZxAsFtMTUiXw0TxBWwj+l+b2bS2V8l1bIsfk4= -gopkg.in/DataDog/dd-trace-go.v1 v1.24.1/go.mod h1:DVp8HmDh8PuTu2Z0fVVlBsyWaC++fzwVCaGWylTe3tg= +gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484 h1:gv8e5qO2QJPaYAcGrgu4jex1zo4IlxKxzmUSQ++sufQ= +gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484/go.mod h1:H9vSLD4Qlnl3rH2fUT6jyP9qwq1lDo0ikaDqSJo8t/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/providers/datadog/dashboard.go b/providers/datadog/dashboard.go index 8559a56ae2..810b6e2143 100644 --- a/providers/datadog/dashboard.go +++ b/providers/datadog/dashboard.go @@ -33,7 +33,7 @@ type DashboardGenerator struct { DatadogService } -func (g *DashboardGenerator) createResources(dashboards []datadogV1.DashboardSummaryDashboards) []terraformutils.Resource { +func (g *DashboardGenerator) createResources(dashboards []datadogV1.DashboardSummaryDefinition) []terraformutils.Resource { resources := []terraformutils.Resource{} for _, dashboard := range dashboards { resourceName := dashboard.GetId() diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 111e59e2f0..542b91802f 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -95,11 +95,6 @@ func (p *DatadogProvider) Init(args []string) error { }) } configV1 := datadogV1.NewConfiguration() - - // Enable unstable operations - configV1.SetUnstableOperationEnabled("GetLogsIndex", true) - configV1.SetUnstableOperationEnabled("ListLogIndexes", true) - datadogClientV1 := datadogV1.NewAPIClient(configV1) // Initialize the Datadog V2 API client @@ -213,8 +208,104 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic } // GetResourceConnections return map of resource connections for Datadog -func (DatadogProvider) GetResourceConnections() map[string]map[string][]string { - return map[string]map[string][]string{} +func (p DatadogProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{ + "dashboard": { + "monitor": { + "widget.alert_graph_definition.alert_id", "id", + "widget.group_definition.widget.alert_graph_definition.alert_id", "id", + "widget.alert_value_definition.alert_id", "id", + "widget.group_definition.widget.alert_value_definition.alert_id", "id", + }, + "service_level_objective": { + "widget.service_level_objective_definition.slo_id", "id", + "widget.group_definition.widget.service_level_objective_definition.slo_id", "id", + }, + }, + "dashboard_list": { + "dashboard": { + "dash_item.dash_id", "id", + }, + }, + "downtime": { + "monitor": { + "monitor_id", "id", + }, + }, + "integration_aws_lambda_arn": { + "integration_aws": { + "account_id", "account_id", + }, + }, + "integration_aws_log_collection": { + "integration_aws": { + "account_id", "account_id", + }, + }, + "logs_archive": { + "integration_aws": { + "s3.account_id", "account_id", + "s3.role_name", "role_name", + "s3_archive.account_id", "account_id", + "s3_archive.role_name", "role_name", + }, + "integration_gcp": { + "gcs.project_id", "project_id", + "gcs.client_email", "client_email", + "gcs_archive.project_id", "project_id", + "gcs_archive.client_email", "client_email", + }, + "integration_azure": { + "azure.client_id", "client_id", + "azure.tenant_id", "tenant_name", + "azure_archive.client_id", "client_id", + "azure_archive.tenant_id", "tenant_name", + }, + }, + "logs_archive_order": { + "logs_archive": { + "archive_ids", "id", + }, + }, + "logs_index_order": { + "logs_index": { + "indexes", "id", + }, + }, + "logs_pipeline_order": { + "logs_integration_pipeline": { + "pipelines", "id", + }, + "logs_custom_pipeline": { + "pipelines", "id", + }, + }, + "monitor": { + "role": { + "restricted_roles", "id", + }, + }, + "service_level_objective": { + "monitor": { + "monitor_ids", "id", + }, + }, + "synthetics": { + "synthetics_private_location": { + "locations", "id", + }, + }, + "synthetics_global_variable": { + "synthetics": { + "parse_test_id", "id", + }, + }, + "user": { + "role": { + "roles", "id", + }, + }, + } } // GetProviderData return map of provider data for Datadog From 84491fb1a46efc0d33f557a286cb179e2b865d6e Mon Sep 17 00:00:00 2001 From: Mohamed chiheb Ben jemaa Date: Wed, 7 Apr 2021 10:38:47 +0100 Subject: [PATCH 150/276] Intial docs split [GCP] provider --- README.md | 176 ++-------------------------------------------------- docs/gcp.md | 169 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+), 171 deletions(-) create mode 100644 docs/gcp.md diff --git a/README.md b/README.md index 9c1b1f3645..c95db8d48d 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr ![Waze SRE logo](docs/waze-sre-logo.png) # Table of Contents - +- [Demo GCP](#demo-gcp) - [Capabilities](#capabilities) - [Installation](#installation) - [Supported Providers](/providers) * Major Cloud - * [Google Cloud](#use-with-gcp) + * [Google Cloud](/docs/gcp.md) * [AWS](#use-with-aws) * [Azure](#use-with-azure) * [AliCloud](#use-with-alicloud) @@ -58,6 +58,9 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr - [Infrastructure](#infrastructure) - [Stargazers over time](#stargazers-over-time) +## Demo GCP +[![asciicast](https://asciinema.org/a/243961.svg)](https://asciinema.org/a/243961) + ## Capabilities 1. Generate `tf`/`json` + `tfstate` files from existing infrastructure for all @@ -273,175 +276,6 @@ Links to download Terraform Providers: Information on provider plugins: https://www.terraform.io/docs/configuration/providers.html -### Use with GCP - -[![asciicast](https://asciinema.org/a/243961.svg)](https://asciinema.org/a/243961) - -Example: - -``` -terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --connect=true --regions=europe-west1,europe-west4 --projects=aaa,fff -terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --filter=compute_firewall=rule1:rule2:rule3 --regions=europe-west1 --projects=aaa,fff -``` - -For google-beta provider: - -``` -terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --regions=europe-west4 --projects=aaa --provider-type beta -``` - -List of supported GCP services: - -* `addresses` - * `google_compute_address` -* `autoscalers` - * `google_compute_autoscaler` -* `backendBuckets` - * `google_compute_backend_bucket` -* `backendServices` - * `google_compute_backend_service` -* `bigQuery` - * `google_bigquery_dataset` - * `google_bigquery_table` -* `cloudFunctions` - * `google_cloudfunctions_function` -* `cloudsql` - * `google_sql_database_instance` - * `google_sql_database` -* `dataProc` - * `google_dataproc_cluster` -* `disks` - * `google_compute_disk` -* `externalVpnGateways` - * `google_compute_external_vpn_gateway` -* `dns` - * `google_dns_managed_zone` - * `google_dns_record_set` -* `firewall` - * `google_compute_firewall` -* `forwardingRules` - * `google_compute_forwarding_rule` -* `gcs` - * `google_storage_bucket` - * `google_storage_bucket_acl` - * `google_storage_default_object_acl` - * `google_storage_bucket_iam_binding` - * `google_storage_bucket_iam_member` - * `google_storage_bucket_iam_policy` - * `google_storage_notification` -* `gke` - * `google_container_cluster` - * `google_container_node_pool` -* `globalAddresses` - * `google_compute_global_address` -* `globalForwardingRules` - * `google_compute_global_forwarding_rule` -* `healthChecks` - * `google_compute_health_check` -* `httpHealthChecks` - * `google_compute_http_health_check` -* `httpsHealthChecks` - * `google_compute_https_health_check` -* `iam` - * `google_project_iam_custom_role` - * `google_project_iam_member` - * `google_service_account` -* `images` - * `google_compute_image` -* `instanceGroupManagers` - * `google_compute_instance_group_manager` -* `instanceGroups` - * `google_compute_instance_group` -* `instanceTemplates` - * `google_compute_instance_template` -* `instances` - * `google_compute_instance` -* `interconnectAttachments` - * `google_compute_interconnect_attachment` -* `kms` - * `google_kms_key_ring` - * `google_kms_crypto_key` -* `logging` - * `google_logging_metric` -* `memoryStore` - * `google_redis_instance` -* `monitoring` - * `google_monitoring_alert_policy` - * `google_monitoring_group` - * `google_monitoring_notification_channel` - * `google_monitoring_uptime_check_config` -* `networks` - * `google_compute_network` -* `packetMirrorings` - * `google_compute_packet_mirroring` -* `nodeGroups` - * `google_compute_node_group` -* `nodeTemplates` - * `google_compute_node_template` -* `project` - * `google_project` -* `pubsub` - * `google_pubsub_subscription` - * `google_pubsub_topic` -* `regionAutoscalers` - * `google_compute_region_autoscaler` -* `regionBackendServices` - * `google_compute_region_backend_service` -* `regionDisks` - * `google_compute_region_disk` -* `regionHealthChecks` - * `google_compute_region_health_check` -* `regionInstanceGroups` - * `google_compute_region_instance_group` -* `regionSslCertificates` - * `google_compute_region_ssl_certificate` -* `regionTargetHttpProxies` - * `google_compute_region_target_http_proxy` -* `regionTargetHttpsProxies` - * `google_compute_region_target_https_proxy` -* `regionUrlMaps` - * `google_compute_region_url_map` -* `reservations` - * `google_compute_reservation` -* `resourcePolicies` - * `google_compute_resource_policy` -* `regionInstanceGroupManagers` - * `google_compute_region_instance_group_manager` -* `routers` - * `google_compute_router` -* `routes` - * `google_compute_route` -* `schedulerJobs` - * `google_cloud_scheduler_job` -* `securityPolicies` - * `google_compute_security_policy` -* `sslCertificates` - * `google_compute_managed_ssl_certificate` -* `sslPolicies` - * `google_compute_ssl_policy` -* `subnetworks` - * `google_compute_subnetwork` -* `targetHttpProxies` - * `google_compute_target_http_proxy` -* `targetHttpsProxies` - * `google_compute_target_https_proxy` -* `targetInstances` - * `google_compute_target_instance` -* `targetPools` - * `google_compute_target_pool` -* `targetSslProxies` - * `google_compute_target_ssl_proxy` -* `targetTcpProxies` - * `google_compute_target_tcp_proxy` -* `targetVpnGateways` - * `google_compute_vpn_gateway` -* `urlMaps` - * `google_compute_url_map` -* `vpnTunnels` - * `google_compute_vpn_tunnel` - -Your `tf` and `tfstate` files are written by default to -`generated/gcp/zone/service`. ### Use with AWS diff --git a/docs/gcp.md b/docs/gcp.md new file mode 100644 index 0000000000..ec3c1fd36b --- /dev/null +++ b/docs/gcp.md @@ -0,0 +1,169 @@ +### Use with GCP + +[![asciicast](https://asciinema.org/a/243961.svg)](https://asciinema.org/a/243961) + +Example: + +``` +terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --connect=true --regions=europe-west1,europe-west4 --projects=aaa,fff +terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --filter=compute_firewall=rule1:rule2:rule3 --regions=europe-west1 --projects=aaa,fff +``` + +For google-beta provider: + +``` +terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --regions=europe-west4 --projects=aaa --provider-type beta +``` + +List of supported GCP services: + +* `addresses` + * `google_compute_address` +* `autoscalers` + * `google_compute_autoscaler` +* `backendBuckets` + * `google_compute_backend_bucket` +* `backendServices` + * `google_compute_backend_service` +* `bigQuery` + * `google_bigquery_dataset` + * `google_bigquery_table` +* `cloudFunctions` + * `google_cloudfunctions_function` +* `cloudsql` + * `google_sql_database_instance` + * `google_sql_database` +* `dataProc` + * `google_dataproc_cluster` +* `disks` + * `google_compute_disk` +* `externalVpnGateways` + * `google_compute_external_vpn_gateway` +* `dns` + * `google_dns_managed_zone` + * `google_dns_record_set` +* `firewall` + * `google_compute_firewall` +* `forwardingRules` + * `google_compute_forwarding_rule` +* `gcs` + * `google_storage_bucket` + * `google_storage_bucket_acl` + * `google_storage_default_object_acl` + * `google_storage_bucket_iam_binding` + * `google_storage_bucket_iam_member` + * `google_storage_bucket_iam_policy` + * `google_storage_notification` +* `gke` + * `google_container_cluster` + * `google_container_node_pool` +* `globalAddresses` + * `google_compute_global_address` +* `globalForwardingRules` + * `google_compute_global_forwarding_rule` +* `healthChecks` + * `google_compute_health_check` +* `httpHealthChecks` + * `google_compute_http_health_check` +* `httpsHealthChecks` + * `google_compute_https_health_check` +* `iam` + * `google_project_iam_custom_role` + * `google_project_iam_member` + * `google_service_account` +* `images` + * `google_compute_image` +* `instanceGroupManagers` + * `google_compute_instance_group_manager` +* `instanceGroups` + * `google_compute_instance_group` +* `instanceTemplates` + * `google_compute_instance_template` +* `instances` + * `google_compute_instance` +* `interconnectAttachments` + * `google_compute_interconnect_attachment` +* `kms` + * `google_kms_key_ring` + * `google_kms_crypto_key` +* `logging` + * `google_logging_metric` +* `memoryStore` + * `google_redis_instance` +* `monitoring` + * `google_monitoring_alert_policy` + * `google_monitoring_group` + * `google_monitoring_notification_channel` + * `google_monitoring_uptime_check_config` +* `networks` + * `google_compute_network` +* `packetMirrorings` + * `google_compute_packet_mirroring` +* `nodeGroups` + * `google_compute_node_group` +* `nodeTemplates` + * `google_compute_node_template` +* `project` + * `google_project` +* `pubsub` + * `google_pubsub_subscription` + * `google_pubsub_topic` +* `regionAutoscalers` + * `google_compute_region_autoscaler` +* `regionBackendServices` + * `google_compute_region_backend_service` +* `regionDisks` + * `google_compute_region_disk` +* `regionHealthChecks` + * `google_compute_region_health_check` +* `regionInstanceGroups` + * `google_compute_region_instance_group` +* `regionSslCertificates` + * `google_compute_region_ssl_certificate` +* `regionTargetHttpProxies` + * `google_compute_region_target_http_proxy` +* `regionTargetHttpsProxies` + * `google_compute_region_target_https_proxy` +* `regionUrlMaps` + * `google_compute_region_url_map` +* `reservations` + * `google_compute_reservation` +* `resourcePolicies` + * `google_compute_resource_policy` +* `regionInstanceGroupManagers` + * `google_compute_region_instance_group_manager` +* `routers` + * `google_compute_router` +* `routes` + * `google_compute_route` +* `schedulerJobs` + * `google_cloud_scheduler_job` +* `securityPolicies` + * `google_compute_security_policy` +* `sslCertificates` + * `google_compute_managed_ssl_certificate` +* `sslPolicies` + * `google_compute_ssl_policy` +* `subnetworks` + * `google_compute_subnetwork` +* `targetHttpProxies` + * `google_compute_target_http_proxy` +* `targetHttpsProxies` + * `google_compute_target_https_proxy` +* `targetInstances` + * `google_compute_target_instance` +* `targetPools` + * `google_compute_target_pool` +* `targetSslProxies` + * `google_compute_target_ssl_proxy` +* `targetTcpProxies` + * `google_compute_target_tcp_proxy` +* `targetVpnGateways` + * `google_compute_vpn_gateway` +* `urlMaps` + * `google_compute_url_map` +* `vpnTunnels` + * `google_compute_vpn_tunnel` + +Your `tf` and `tfstate` files are written by default to +`generated/gcp/zone/service`. From 57dbe3d0bc16f486d768f1087bee17266bd6faae Mon Sep 17 00:00:00 2001 From: Mohamed chiheb Ben jemaa Date: Wed, 7 Apr 2021 10:45:17 +0100 Subject: [PATCH 151/276] Split Docs [AWS] provider --- README.md | 330 +--------------------------------------------------- docs/aws.md | 327 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 328 insertions(+), 329 deletions(-) create mode 100644 docs/aws.md diff --git a/README.md b/README.md index c95db8d48d..4b832717a3 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr - [Supported Providers](/providers) * Major Cloud * [Google Cloud](/docs/gcp.md) - * [AWS](#use-with-aws) + * [AWS](/docs/aws.md) * [Azure](#use-with-azure) * [AliCloud](#use-with-alicloud) * [IBM Cloud](#use-with-ibm-cloud) @@ -276,334 +276,6 @@ Links to download Terraform Providers: Information on provider plugins: https://www.terraform.io/docs/configuration/providers.html - -### Use with AWS - -Example: - -``` - terraformer import aws --resources=vpc,subnet --connect=true --regions=eu-west-1 --profile=prod - terraformer import aws --resources=vpc,subnet --filter=vpc=vpc_id1:vpc_id2:vpc_id3 --regions=eu-west-1 -``` - -#### Profiles support - -AWS configuration including environmental variables, shared credentials file (\~/.aws/credentials), and shared config file (\~/.aws/config) will be loaded by the tool by default. To use a specific profile, you can use the following command: - -``` -terraformer import aws --resources=vpc,subnet --regions=eu-west-1 --profile=prod -``` - -You can also provide no regions when importing resources: -``` -terraformer import aws --resources=cloudfront --profile=prod -``` -In that case terraformer will not know with which region resources are associated with and will not assume any region. That scenario is useful in case of global resources (e.g. CloudFront distributions or Route 53 records) and when region is passed implicitly through environmental variables or metadata service. - -#### Supported services - -* `accessanalyzer` - * `aws_accessanalyzer_analyzer` -* `acm` - * `aws_acm_certificate` -* `alb` (supports ALB and NLB) - * `aws_lb` - * `aws_lb_listener` - * `aws_lb_listener_rule` - * `aws_lb_listener_certificate` - * `aws_lb_target_group` - * `aws_lb_target_group_attachment` -* `api_gateway` - * `aws_api_gateway_authorizer` - * `aws_api_gateway_documentation_part` - * `aws_api_gateway_gateway_response` - * `aws_api_gateway_integration` - * `aws_api_gateway_integration_response` - * `aws_api_gateway_method` - * `aws_api_gateway_method_response` - * `aws_api_gateway_model` - * `aws_api_gateway_resource` - * `aws_api_gateway_rest_api` - * `aws_api_gateway_stage` - * `aws_api_gateway_usage_plan` - * `aws_api_gateway_vpc_link` -* `appsync` - * `aws_appsync_graphql_api` -* `auto_scaling` - * `aws_autoscaling_group` - * `aws_launch_configuration` - * `aws_launch_template` -* `budgets` - * `aws_budgets_budget` -* `cloud9` - * `aws_cloud9_environment_ec2` -* `cloudfront` - * `aws_cloudfront_distribution` -* `cloudformation` - * `aws_cloudformation_stack` - * `aws_cloudformation_stack_set` - * `aws_cloudformation_stack_set_instance` -* `cloudhsm` - * `aws_cloudhsm_v2_cluster` - * `aws_cloudhsm_v2_hsm` -* `cloudtrail` - * `aws_cloudtrail` -* `cloudwatch` - * `aws_cloudwatch_dashboard` - * `aws_cloudwatch_event_rule` - * `aws_cloudwatch_event_target` - * `aws_cloudwatch_metric_alarm` -* `codebuild` - * `aws_codebuild_project` -* `codecommit` - * `aws_codecommit_repository` -* `codedeploy` - * `aws_codedeploy_app` -* `codepipeline` - * `aws_codepipeline` - * `aws_codepipeline_webhook` -* `cognito` - * `aws_cognito_identity_pool` - * `aws_cognito_user_pool` -* `customer_gateway` - * `aws_customer_gateway` -* `config` - * `aws_config_config_rule` - * `aws_config_configuration_recorder` - * `aws_config_delivery_channel` -* `datapipeline` - * `aws_datapipeline_pipeline` -* `devicefarm` - * `aws_devicefarm_project` -* `dynamodb` - * `aws_dynamodb_table` -* `ec2_instance` - * `aws_instance` -* `eip` - * `aws_eip` -* `elasticache` - * `aws_elasticache_cluster` - * `aws_elasticache_parameter_group` - * `aws_elasticache_subnet_group` - * `aws_elasticache_replication_group` -* `ebs` - * `aws_ebs_volume` - * `aws_volume_attachment` -* `elastic_beanstalk` - * `aws_elastic_beanstalk_application` - * `aws_elastic_beanstalk_environment` -* `ecs` - * `aws_ecs_cluster` - * `aws_ecs_service` - * `aws_ecs_task_definition` -* `ecr` - * `aws_ecr_lifecycle_policy` - * `aws_ecr_repository` - * `aws_ecr_repository_policy` -* `ecrpublic` - * `aws_ecrpublic_repository` -* `efs` - * `aws_efs_access_point` - * `aws_efs_file_system` - * `aws_efs_file_system_policy` - * `aws_efs_mount_target` -* `eks` - * `aws_eks_cluster` -* `elb` - * `aws_elb` -* `emr` - * `aws_emr_cluster` - * `aws_emr_security_configuration` -* `eni` - * `aws_network_interface` -* `es` - * `aws_elasticsearch_domain` -* `firehose` - * `aws_kinesis_firehose_delivery_stream` -* `glue` - * `glue_crawler` - * `aws_glue_catalog_database` - * `aws_glue_catalog_table` -* `iam` - * `aws_iam_group` - * `aws_iam_group_policy` - * `aws_iam_group_policy_attachment` - * `aws_iam_instance_profile` - * `aws_iam_policy` - * `aws_iam_role` - * `aws_iam_role_policy` - * `aws_iam_role_policy_attachment` - * `aws_iam_user` - * `aws_iam_user_group_membership` - * `aws_iam_user_policy` - * `aws_iam_user_policy_attachment` -* `igw` - * `aws_internet_gateway` -* `iot` - * `aws_iot_thing` - * `aws_iot_thing_type` - * `aws_iot_topic_rule` - * `aws_iot_role_alias` -* `kinesis` - * `aws_kinesis_stream` -* `kms` - * `aws_kms_key` - * `aws_kms_alias` - * `aws_kms_grant` -* `lambda` - * `aws_lambda_event_source_mapping` - * `aws_lambda_function` - * `aws_lambda_function_event_invoke_config` - * `aws_lambda_layer_version` -* `logs` - * `aws_cloudwatch_log_group` -* `media_package` - * `aws_media_package_channel` -* `media_store` - * `aws_media_store_container` -* `msk` - * `aws_msk_cluster` -* `nat` - * `aws_nat_gateway` -* `nacl` - * `aws_network_acl` -* `organization` - * `aws_organizations_account` - * `aws_organizations_organization` - * `aws_organizations_organizational_unit` - * `aws_organizations_policy` - * `aws_organizations_policy_attachment` -* `qldb` - * `aws_qldb_ledger` -* `rds` - * `aws_db_instance` - * `aws_db_parameter_group` - * `aws_db_subnet_group` - * `aws_db_option_group` - * `aws_db_event_subscription` -* `resourcegroups` - * `aws_resourcegroups_group` -* `route53` - * `aws_route53_zone` - * `aws_route53_record` -* `route_table` - * `aws_route_table` - * `aws_main_route_table_association` - * `aws_route_table_association` -* `s3` - * `aws_s3_bucket` -* `secretsmanager` - * `aws_secretsmanager_secret` -* `securityhub` - * `aws_securityhub_account` - * `aws_securityhub_member` - * `aws_securityhub_standards_subscription` -* `servicecatalog` - * `aws_servicecatalog_portfolio` -* `ses` - * `aws_ses_configuration_set` - * `aws_ses_domain_identity` - * `aws_ses_email_identity` - * `aws_ses_receipt_rule` - * `aws_ses_receipt_rule_set` - * `aws_ses_template` -* `sfn` - * `aws_sfn_activity` - * `aws_sfn_state_machine` -* `sg` - * `aws_security_group` - * `aws_security_group_rule` (if a rule cannot be inlined) -* `sns` - * `aws_sns_topic` - * `aws_sns_topic_subscription` -* `sqs` - * `aws_sqs_queue` -* `ssm` - * `aws_ssm_parameter` -* `subnet` - * `aws_subnet` -* `swf` - * `aws_swf_domain` -* `transit_gateway` - * `aws_ec2_transit_gateway_route_table` - * `aws_ec2_transit_gateway_vpc_attachment` -* `waf` - * `aws_waf_byte_match_set` - * `aws_waf_geo_match_set` - * `aws_waf_ipset` - * `aws_waf_rate_based_rule` - * `aws_waf_regex_match_set` - * `aws_waf_regex_pattern_set` - * `aws_waf_rule` - * `aws_waf_rule_group` - * `aws_waf_size_constraint_set` - * `aws_waf_sql_injection_match_set` - * `aws_waf_web_acl` - * `aws_waf_xss_match_set` -* `waf_regional` - * `aws_wafregional_byte_match_set` - * `aws_wafregional_geo_match_set` - * `aws_wafregional_ipset` - * `aws_wafregional_rate_based_rule` - * `aws_wafregional_regex_match_set` - * `aws_wafregional_regex_pattern_set` - * `aws_wafregional_rule` - * `aws_wafregional_rule_group` - * `aws_wafregional_size_constraint_set` - * `aws_wafregional_sql_injection_match_set` - * `aws_wafregional_web_acl` - * `aws_wafregional_xss_match_set` -* `vpc` - * `aws_vpc` -* `vpc_peering` - * `aws_vpc_peering_connection` -* `vpn_connection` - * `aws_vpn_connection` -* `vpn_gateway` - * `aws_vpn_gateway` -* `workspaces` - * `aws_workspaces_directory` - * `aws_workspaces_ip_group` - * `aws_workspaces_workspace` -* `xray` - * `aws_xray_sampling_rule` - -#### Global services - -AWS services that are global will be imported without specified region even if several regions will be passed. It is to ensure only one representation of an AWS resource is imported. - -List of global AWS services: -* `budgets` -* `cloudfront` -* `ecrpublic` -* `iam` -* `organization` -* `route53` -* `waf` - -#### Attribute filters - -Attribute filters allow filtering across different resource types by its attributes. - -``` -terraformer import aws --resources=ec2_instance,ebs --filter="Name=tags.costCenter;Value=20000:'20001:1'" --regions=eu-west-1 -``` -Will only import AWS EC2 instances along with EBS volumes annotated with tag `costCenter` with values `20000` or `20001:1`. Attribute filters are by default applicable to all resource types although it's possible to specify to what resource type a given filter should be applicable to by providing `Type=` parameter. For example: -``` -terraformer import aws --resources=ec2_instance,ebs --filter=Type=ec2_instance;Name=tags.costCenter;Value=20000:'20001:1' --regions=eu-west-1 -``` -Will work as same as example above with a change the filter will be applicable only to `ec2_instance` resources. - -Due to fact API Gateway generates a lot of resources, it's possible to issue a filtering query to retrieve resources related to a given REST API by tags. To fetch resources related to a REST API resource with a tag `STAGE` and value `dev`, add parameter `--filter="Type=api_gateway_rest_api;Name=tags.STAGE;Value=dev"`. - -#### SQS queues retrieval - -Terraformer uses AWS [ListQueues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ListQueues.html) API call to fetch available queues. The API is able to return only up to 1000 queues and an additional name prefix should be passed to filter the list results. It's possible to pass `QueueNamePrefix` parameter by environmental variable `SQS_PREFIX`. - -#### Security groups and rules - -Terraformer by default will try to keep rules in security groups as long as no circular dependencies are detected. This approach is implemented to keep the rules as tidy as possible but there can be cases when this behaviour is not desirable (see [GoogleCloudPlatform/terraformer#493](https://github.com/GoogleCloudPlatform/terraformer/issues/493)). To make Terraformer split rules from security groups, add `SPLIT_SG_RULES` environmental variable with any value. - ### Use with Azure Support [Azure CLI](https://www.terraform.io/docs/providers/azurerm/guides/azure_cli.html), [Service Principal with Client Certificate](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_certificate.html) & [Service Principal with Client Secret](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_secret.html) diff --git a/docs/aws.md b/docs/aws.md new file mode 100644 index 0000000000..cfd6d9e3d7 --- /dev/null +++ b/docs/aws.md @@ -0,0 +1,327 @@ + +### Use with AWS + +Example: + +``` + terraformer import aws --resources=vpc,subnet --connect=true --regions=eu-west-1 --profile=prod + terraformer import aws --resources=vpc,subnet --filter=vpc=vpc_id1:vpc_id2:vpc_id3 --regions=eu-west-1 +``` + +#### Profiles support + +AWS configuration including environmental variables, shared credentials file (\~/.aws/credentials), and shared config file (\~/.aws/config) will be loaded by the tool by default. To use a specific profile, you can use the following command: + +``` +terraformer import aws --resources=vpc,subnet --regions=eu-west-1 --profile=prod +``` + +You can also provide no regions when importing resources: +``` +terraformer import aws --resources=cloudfront --profile=prod +``` +In that case terraformer will not know with which region resources are associated with and will not assume any region. That scenario is useful in case of global resources (e.g. CloudFront distributions or Route 53 records) and when region is passed implicitly through environmental variables or metadata service. + +#### Supported services + +* `accessanalyzer` + * `aws_accessanalyzer_analyzer` +* `acm` + * `aws_acm_certificate` +* `alb` (supports ALB and NLB) + * `aws_lb` + * `aws_lb_listener` + * `aws_lb_listener_rule` + * `aws_lb_listener_certificate` + * `aws_lb_target_group` + * `aws_lb_target_group_attachment` +* `api_gateway` + * `aws_api_gateway_authorizer` + * `aws_api_gateway_documentation_part` + * `aws_api_gateway_gateway_response` + * `aws_api_gateway_integration` + * `aws_api_gateway_integration_response` + * `aws_api_gateway_method` + * `aws_api_gateway_method_response` + * `aws_api_gateway_model` + * `aws_api_gateway_resource` + * `aws_api_gateway_rest_api` + * `aws_api_gateway_stage` + * `aws_api_gateway_usage_plan` + * `aws_api_gateway_vpc_link` +* `appsync` + * `aws_appsync_graphql_api` +* `auto_scaling` + * `aws_autoscaling_group` + * `aws_launch_configuration` + * `aws_launch_template` +* `budgets` + * `aws_budgets_budget` +* `cloud9` + * `aws_cloud9_environment_ec2` +* `cloudfront` + * `aws_cloudfront_distribution` +* `cloudformation` + * `aws_cloudformation_stack` + * `aws_cloudformation_stack_set` + * `aws_cloudformation_stack_set_instance` +* `cloudhsm` + * `aws_cloudhsm_v2_cluster` + * `aws_cloudhsm_v2_hsm` +* `cloudtrail` + * `aws_cloudtrail` +* `cloudwatch` + * `aws_cloudwatch_dashboard` + * `aws_cloudwatch_event_rule` + * `aws_cloudwatch_event_target` + * `aws_cloudwatch_metric_alarm` +* `codebuild` + * `aws_codebuild_project` +* `codecommit` + * `aws_codecommit_repository` +* `codedeploy` + * `aws_codedeploy_app` +* `codepipeline` + * `aws_codepipeline` + * `aws_codepipeline_webhook` +* `cognito` + * `aws_cognito_identity_pool` + * `aws_cognito_user_pool` +* `customer_gateway` + * `aws_customer_gateway` +* `config` + * `aws_config_config_rule` + * `aws_config_configuration_recorder` + * `aws_config_delivery_channel` +* `datapipeline` + * `aws_datapipeline_pipeline` +* `devicefarm` + * `aws_devicefarm_project` +* `dynamodb` + * `aws_dynamodb_table` +* `ec2_instance` + * `aws_instance` +* `eip` + * `aws_eip` +* `elasticache` + * `aws_elasticache_cluster` + * `aws_elasticache_parameter_group` + * `aws_elasticache_subnet_group` + * `aws_elasticache_replication_group` +* `ebs` + * `aws_ebs_volume` + * `aws_volume_attachment` +* `elastic_beanstalk` + * `aws_elastic_beanstalk_application` + * `aws_elastic_beanstalk_environment` +* `ecs` + * `aws_ecs_cluster` + * `aws_ecs_service` + * `aws_ecs_task_definition` +* `ecr` + * `aws_ecr_lifecycle_policy` + * `aws_ecr_repository` + * `aws_ecr_repository_policy` +* `ecrpublic` + * `aws_ecrpublic_repository` +* `efs` + * `aws_efs_access_point` + * `aws_efs_file_system` + * `aws_efs_file_system_policy` + * `aws_efs_mount_target` +* `eks` + * `aws_eks_cluster` +* `elb` + * `aws_elb` +* `emr` + * `aws_emr_cluster` + * `aws_emr_security_configuration` +* `eni` + * `aws_network_interface` +* `es` + * `aws_elasticsearch_domain` +* `firehose` + * `aws_kinesis_firehose_delivery_stream` +* `glue` + * `glue_crawler` + * `aws_glue_catalog_database` + * `aws_glue_catalog_table` +* `iam` + * `aws_iam_group` + * `aws_iam_group_policy` + * `aws_iam_group_policy_attachment` + * `aws_iam_instance_profile` + * `aws_iam_policy` + * `aws_iam_role` + * `aws_iam_role_policy` + * `aws_iam_role_policy_attachment` + * `aws_iam_user` + * `aws_iam_user_group_membership` + * `aws_iam_user_policy` + * `aws_iam_user_policy_attachment` +* `igw` + * `aws_internet_gateway` +* `iot` + * `aws_iot_thing` + * `aws_iot_thing_type` + * `aws_iot_topic_rule` + * `aws_iot_role_alias` +* `kinesis` + * `aws_kinesis_stream` +* `kms` + * `aws_kms_key` + * `aws_kms_alias` + * `aws_kms_grant` +* `lambda` + * `aws_lambda_event_source_mapping` + * `aws_lambda_function` + * `aws_lambda_function_event_invoke_config` + * `aws_lambda_layer_version` +* `logs` + * `aws_cloudwatch_log_group` +* `media_package` + * `aws_media_package_channel` +* `media_store` + * `aws_media_store_container` +* `msk` + * `aws_msk_cluster` +* `nat` + * `aws_nat_gateway` +* `nacl` + * `aws_network_acl` +* `organization` + * `aws_organizations_account` + * `aws_organizations_organization` + * `aws_organizations_organizational_unit` + * `aws_organizations_policy` + * `aws_organizations_policy_attachment` +* `qldb` + * `aws_qldb_ledger` +* `rds` + * `aws_db_instance` + * `aws_db_parameter_group` + * `aws_db_subnet_group` + * `aws_db_option_group` + * `aws_db_event_subscription` +* `resourcegroups` + * `aws_resourcegroups_group` +* `route53` + * `aws_route53_zone` + * `aws_route53_record` +* `route_table` + * `aws_route_table` + * `aws_main_route_table_association` + * `aws_route_table_association` +* `s3` + * `aws_s3_bucket` +* `secretsmanager` + * `aws_secretsmanager_secret` +* `securityhub` + * `aws_securityhub_account` + * `aws_securityhub_member` + * `aws_securityhub_standards_subscription` +* `servicecatalog` + * `aws_servicecatalog_portfolio` +* `ses` + * `aws_ses_configuration_set` + * `aws_ses_domain_identity` + * `aws_ses_email_identity` + * `aws_ses_receipt_rule` + * `aws_ses_receipt_rule_set` + * `aws_ses_template` +* `sfn` + * `aws_sfn_activity` + * `aws_sfn_state_machine` +* `sg` + * `aws_security_group` + * `aws_security_group_rule` (if a rule cannot be inlined) +* `sns` + * `aws_sns_topic` + * `aws_sns_topic_subscription` +* `sqs` + * `aws_sqs_queue` +* `ssm` + * `aws_ssm_parameter` +* `subnet` + * `aws_subnet` +* `swf` + * `aws_swf_domain` +* `transit_gateway` + * `aws_ec2_transit_gateway_route_table` + * `aws_ec2_transit_gateway_vpc_attachment` +* `waf` + * `aws_waf_byte_match_set` + * `aws_waf_geo_match_set` + * `aws_waf_ipset` + * `aws_waf_rate_based_rule` + * `aws_waf_regex_match_set` + * `aws_waf_regex_pattern_set` + * `aws_waf_rule` + * `aws_waf_rule_group` + * `aws_waf_size_constraint_set` + * `aws_waf_sql_injection_match_set` + * `aws_waf_web_acl` + * `aws_waf_xss_match_set` +* `waf_regional` + * `aws_wafregional_byte_match_set` + * `aws_wafregional_geo_match_set` + * `aws_wafregional_ipset` + * `aws_wafregional_rate_based_rule` + * `aws_wafregional_regex_match_set` + * `aws_wafregional_regex_pattern_set` + * `aws_wafregional_rule` + * `aws_wafregional_rule_group` + * `aws_wafregional_size_constraint_set` + * `aws_wafregional_sql_injection_match_set` + * `aws_wafregional_web_acl` + * `aws_wafregional_xss_match_set` +* `vpc` + * `aws_vpc` +* `vpc_peering` + * `aws_vpc_peering_connection` +* `vpn_connection` + * `aws_vpn_connection` +* `vpn_gateway` + * `aws_vpn_gateway` +* `workspaces` + * `aws_workspaces_directory` + * `aws_workspaces_ip_group` + * `aws_workspaces_workspace` +* `xray` + * `aws_xray_sampling_rule` + +#### Global services + +AWS services that are global will be imported without specified region even if several regions will be passed. It is to ensure only one representation of an AWS resource is imported. + +List of global AWS services: +* `budgets` +* `cloudfront` +* `ecrpublic` +* `iam` +* `organization` +* `route53` +* `waf` + +#### Attribute filters + +Attribute filters allow filtering across different resource types by its attributes. + +``` +terraformer import aws --resources=ec2_instance,ebs --filter="Name=tags.costCenter;Value=20000:'20001:1'" --regions=eu-west-1 +``` +Will only import AWS EC2 instances along with EBS volumes annotated with tag `costCenter` with values `20000` or `20001:1`. Attribute filters are by default applicable to all resource types although it's possible to specify to what resource type a given filter should be applicable to by providing `Type=` parameter. For example: +``` +terraformer import aws --resources=ec2_instance,ebs --filter=Type=ec2_instance;Name=tags.costCenter;Value=20000:'20001:1' --regions=eu-west-1 +``` +Will work as same as example above with a change the filter will be applicable only to `ec2_instance` resources. + +Due to fact API Gateway generates a lot of resources, it's possible to issue a filtering query to retrieve resources related to a given REST API by tags. To fetch resources related to a REST API resource with a tag `STAGE` and value `dev`, add parameter `--filter="Type=api_gateway_rest_api;Name=tags.STAGE;Value=dev"`. + +#### SQS queues retrieval + +Terraformer uses AWS [ListQueues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ListQueues.html) API call to fetch available queues. The API is able to return only up to 1000 queues and an additional name prefix should be passed to filter the list results. It's possible to pass `QueueNamePrefix` parameter by environmental variable `SQS_PREFIX`. + +#### Security groups and rules + +Terraformer by default will try to keep rules in security groups as long as no circular dependencies are detected. This approach is implemented to keep the rules as tidy as possible but there can be cases when this behaviour is not desirable (see [GoogleCloudPlatform/terraformer#493](https://github.com/GoogleCloudPlatform/terraformer/issues/493)). To make Terraformer split rules from security groups, add `SPLIT_SG_RULES` environmental variable with any value. From a0fbc6466dda335471021b28b5afe009aabd4d5b Mon Sep 17 00:00:00 2001 From: Mohamed chiheb Ben jemaa Date: Wed, 7 Apr 2021 10:49:30 +0100 Subject: [PATCH 152/276] Split Docs [Azure|AliCloud|IBMCloud] providers --- README.md | 271 +---------------------------------------------- docs/alicloud.md | 44 ++++++++ docs/azure.md | 116 ++++++++++++++++++++ docs/ibmcloud.md | 105 ++++++++++++++++++ 4 files changed, 268 insertions(+), 268 deletions(-) create mode 100644 docs/alicloud.md create mode 100644 docs/azure.md create mode 100644 docs/ibmcloud.md diff --git a/README.md b/README.md index 4b832717a3..54ce6865a4 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * Major Cloud * [Google Cloud](/docs/gcp.md) * [AWS](/docs/aws.md) - * [Azure](#use-with-azure) - * [AliCloud](#use-with-alicloud) - * [IBM Cloud](#use-with-ibm-cloud) + * [Azure](/docs/azure.md) + * [AliCloud](/docs/alicloud.md) + * [IBM Cloud](/docs/ibmcloud.md) * Cloud * [DigitalOcean](#use-with-digitalocean) * [Equinix Metal](#use-with-equinix-metal) @@ -276,273 +276,8 @@ Links to download Terraform Providers: Information on provider plugins: https://www.terraform.io/docs/configuration/providers.html -### Use with Azure -Support [Azure CLI](https://www.terraform.io/docs/providers/azurerm/guides/azure_cli.html), [Service Principal with Client Certificate](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_certificate.html) & [Service Principal with Client Secret](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_secret.html) -Example: - -``` -# Using Azure CLI (az login) -export ARM_SUBSCRIPTION_ID=[SUBSCRIPTION_ID] - -# Using Service Principal with Client Certificate -export ARM_SUBSCRIPTION_ID=[SUBSCRIPTION_ID] -export ARM_CLIENT_ID=[CLIENT_ID] -export ARM_CLIENT_CERTIFICATE_PATH="/path/to/my/client/certificate.pfx" -export ARM_CLIENT_CERTIFICATE_PASSWORD=[CLIENT_CERTIFICATE_PASSWORD] -export ARM_TENANT_ID=[TENANT_ID] - -# Service Principal with Client Secret -export ARM_SUBSCRIPTION_ID=[SUBSCRIPTION_ID] -export ARM_CLIENT_ID=[CLIENT_ID] -export ARM_CLIENT_SECRET=[CLIENT_SECRET] -export ARM_TENANT_ID=[TENANT_ID] - -./terraformer import azure -r resource_group -./terraformer import azure -R my_resource_group -r virtual_network,resource_group -``` - -List of supported Azure resources: - -* `analysis` - * `azurerm_analysis_services_server` -* `app_service` - * `azurerm_app_service` -* `container` - * `azurerm_container_group` - * `azurerm_container_registry` - * `azurerm_container_registry_webhook` -* `cosmosdb` - * `azurerm_cosmosdb_account` - * `azurerm_cosmosdb_sql_container` - * `azurerm_cosmosdb_sql_database` - * `azurerm_cosmosdb_table` -* `database` - * `azurerm_mariadb_configuration` - * `azurerm_mariadb_database` - * `azurerm_mariadb_firewall_rule` - * `azurerm_mariadb_server` - * `azurerm_mariadb_virtual_network_rule` - * `azurerm_mysql_configuration` - * `azurerm_mysql_database` - * `azurerm_mysql_firewall_rule` - * `azurerm_mysql_server` - * `azurerm_mysql_virtual_network_rule` - * `azurerm_postgresql_configuration` - * `azurerm_postgresql_database` - * `azurerm_postgresql_firewall_rule` - * `azurerm_postgresql_server` - * `azurerm_postgresql_virtual_network_rule` - * `azurerm_sql_database` - * `azurerm_sql_active_directory_administrator` - * `azurerm_sql_elasticpool` - * `azurerm_sql_failover_group` - * `azurerm_sql_firewall_rule` - * `azurerm_sql_server` - * `azurerm_sql_virtual_network_rule` -* `disk` - * `azurerm_managed_disk` -* `dns` - * `azurerm_dns_a_record` - * `azurerm_dns_aaaa_record` - * `azurerm_dns_caa_record` - * `azurerm_dns_cname_record` - * `azurerm_dns_mx_record` - * `azurerm_dns_ns_record` - * `azurerm_dns_ptr_record` - * `azurerm_dns_srv_record` - * `azurerm_dns_txt_record` - * `azurerm_dns_zone` -* `load_balancer` - * `azurerm_lb` - * `azurerm_lb_backend_address_pool` - * `azurerm_lb_nat_rule` - * `azurerm_lb_probe` -* `network_interface` - * `azurerm_network_interface` -* `network_security_group` - * `azurerm_network_security_group` -* `private_dns` - * `azurerm_private_dns_a_record` - * `azurerm_private_dns_aaaa_record` - * `azurerm_private_dns_cname_record` - * `azurerm_private_dns_mx_record` - * `azurerm_private_dns_ptr_record` - * `azurerm_private_dns_srv_record` - * `azurerm_private_dns_txt_record` - * `azurerm_private_dns_zone` - * `azurerm_private_dns_zone_virtual_network_link` -* `public_ip` - * `azurerm_public_ip` - * `azurerm_public_ip_prefix` -* `redis` - * `azurerm_redis_cache -* `resource_group` - * `azurerm_resource_group` -* `scaleset` - * `azurerm_virtual_machine_scale_set` -* `security_center` - * `azurerm_security_center_contact` - * `azurerm_security_center_subscription_pricing` -* `storage_account` - * `azurerm_storage_account` - * `azurerm_storage_blob` - * `azurerm_storage_container` -* `virtual_machine` - * `azurerm_virtual_machine` -* `virtual_network` - * `azurerm_virtual_network` - -### Use with AliCloud - -You can either edit your alicloud config directly, (usually it is `~/.aliyun/config.json`) -or run `aliyun configure` and enter the credentials when prompted. - -Terraformer will pick up the profile name specified in the `--profile` parameter. -It defaults to the first config in the config array. - -```sh -terraformer import alicloud --resources=ecs --regions=ap-southeast-3 --profile=default -``` - -List of supported AliCloud resources: - -* `dns` - * `alicloud_dns` - * `alicloud_dns_record` -* `ecs` - * `alicloud_instance` -* `keypair` - * `alicloud_key_pair` -* `nat` - * `alicloud_nat_gateway` -* `pvtz` - * `alicloud_pvtz_zone` - * `alicloud_pvtz_zone_attachment` - * `alicloud_pvtz_zone_record` -* `ram` - * `alicloud_ram_role` - * `alicloud_ram_role_policy_attachment` -* `rds` - * `alicloud_db_instance` -* `sg` - * `alicloud_security_group` - * `alicloud_security_group_rule` -* `slb` - * `alicloud_slb` - * `alicloud_slb_server_group` - * `alicloud_slb_listener` -* `vpc` - * `alicloud_vpc` -* `vswitch` - * `alicloud_vswitch` - - ### Use with IBM Cloud - -If you want to run Terraformer with the IBM Cloud provider plugin on your system, complete the following steps: - - -1. Export IBM Cloud API key as environment variables. - Example: - - ``` - export IC_API_KEY= - export IC_REGION= - terraformer import ibm -r ibm_cos,ibm_iam.... - ``` -2. Use flag for Resource Group to classify resources accordingly. - Example: - - ``` - export IC_API_KEY= - export IC_REGION= - terraformer import ibm --resources=ibm_is_vpc --resource_group=a0d5213d831a454ebace7ed38ca9c8ca - terraformer import ibm --resources=ibm_function --region=us-south - ``` -List of supported IBM Cloud resources: - -* `ibm_kp` - * `ibm_resource_instance` - * `ibm_kms_key` -* `ibm_cos` - * `ibm_resource_instance` - * `ibm_cos_bucket` -* `ibm_iam` - * `ibm_iam_user_policy` - * `ibm_iam_access_group` - * `ibm_iam_access_group_members` - * `ibm_iam_access_group_policy` - * `ibm_iam_access_group_dynamic_rule` -* `ibm_container_vpc_cluster` - * `ibm_container_vpc_cluster` - * `ibm_container_vpc_worker_pool` -* `ibm_database_etcd` - * `ibm_database` -* `ibm_database_mongo` - * `ibm_database` -* `ibm_database_postgresql` - * `ibm_database` -* `ibm_database_rabbitmq` - * `ibm_database` -* `ibm_database_redis` - * `ibm_database` -* `ibm_is_instance_group` - * `ibm_is_instance_group` - * `ibm_is_instance_group_manager` - * `ibm_is_instance_group_manager_policy` -* `ibm_cis` - * `ibm_cis` - * `ibm_cis_dns_record` - * `ibm_cis_firewall` - * `ibm_cis_domain_settings` - * `ibm_cis_global_load_balancer` - * `ibm_cis_edge_functions_action` - * `ibm_cis_edge_functions_trigger` - * `ibm_cis_healthcheck` - * `ibm_cis_rate_limit` -* `ibm_is_vpc` - * `ibm_is_vpc` - * `ibm_is_vpc_address_prefix` - * `ibm_is_vpc_route` - * `ibm_is_vpc_routing_table` - * `ibm_is_vpc_routing_table_route` -* `ibm_is_subnet` -* `ibm_is_instance` -* `ibm_is_security_group` - * `ibm_is_security_group_rule` -* `ibm_is_network_acl` -* `ibm_is_public_gateway` -* `ibm_is_volume` -* `ibm_is_vpn_gateway` - * `ibm_is_vpn_gateway_connections` -* `ibm_is_lb` - * `ibm_is_lb_pool` - * `ibm_is_lb_pool_member` - * `ibm_is_lb_listener` - * `ibm_is_lb_listener_policy` - * `ibm_is_lb_listener_policy_rule` -* `ibm_is_floating_ip` -* `ibm_is_flow_log` -* `ibm_is_ike_policy` -* `ibm_is_image` -* `ibm_is_instance_template` -* `ibm_is_ipsec_policy` -* `ibm_is_ssh_key` -* `ibm_function` - * `ibm_function_package` - * `ibm_function_action` - * `ibm_function_rule` - * `ibm_function_trigger` -* `ibm_private_dns` - * `ibm_resource_instance` - * `ibm_dns_zone` - * `ibm_dns_resource_record` - * `ibm_dns_permitted_network` - * `ibm_dns_glb_monitor` - * `ibm_dns_glb_pool` - * `ibm_dns_glb` - ### Use with DigitalOcean Example: diff --git a/docs/alicloud.md b/docs/alicloud.md new file mode 100644 index 0000000000..bc58838778 --- /dev/null +++ b/docs/alicloud.md @@ -0,0 +1,44 @@ + +### Use with AliCloud + +You can either edit your alicloud config directly, (usually it is `~/.aliyun/config.json`) +or run `aliyun configure` and enter the credentials when prompted. + +Terraformer will pick up the profile name specified in the `--profile` parameter. +It defaults to the first config in the config array. + +```sh +terraformer import alicloud --resources=ecs --regions=ap-southeast-3 --profile=default +``` + +List of supported AliCloud resources: + +* `dns` + * `alicloud_dns` + * `alicloud_dns_record` +* `ecs` + * `alicloud_instance` +* `keypair` + * `alicloud_key_pair` +* `nat` + * `alicloud_nat_gateway` +* `pvtz` + * `alicloud_pvtz_zone` + * `alicloud_pvtz_zone_attachment` + * `alicloud_pvtz_zone_record` +* `ram` + * `alicloud_ram_role` + * `alicloud_ram_role_policy_attachment` +* `rds` + * `alicloud_db_instance` +* `sg` + * `alicloud_security_group` + * `alicloud_security_group_rule` +* `slb` + * `alicloud_slb` + * `alicloud_slb_server_group` + * `alicloud_slb_listener` +* `vpc` + * `alicloud_vpc` +* `vswitch` + * `alicloud_vswitch` diff --git a/docs/azure.md b/docs/azure.md new file mode 100644 index 0000000000..e2cad48991 --- /dev/null +++ b/docs/azure.md @@ -0,0 +1,116 @@ +### Use with Azure +Support [Azure CLI](https://www.terraform.io/docs/providers/azurerm/guides/azure_cli.html), [Service Principal with Client Certificate](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_certificate.html) & [Service Principal with Client Secret](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_secret.html) + +Example: + +``` +# Using Azure CLI (az login) +export ARM_SUBSCRIPTION_ID=[SUBSCRIPTION_ID] + +# Using Service Principal with Client Certificate +export ARM_SUBSCRIPTION_ID=[SUBSCRIPTION_ID] +export ARM_CLIENT_ID=[CLIENT_ID] +export ARM_CLIENT_CERTIFICATE_PATH="/path/to/my/client/certificate.pfx" +export ARM_CLIENT_CERTIFICATE_PASSWORD=[CLIENT_CERTIFICATE_PASSWORD] +export ARM_TENANT_ID=[TENANT_ID] + +# Service Principal with Client Secret +export ARM_SUBSCRIPTION_ID=[SUBSCRIPTION_ID] +export ARM_CLIENT_ID=[CLIENT_ID] +export ARM_CLIENT_SECRET=[CLIENT_SECRET] +export ARM_TENANT_ID=[TENANT_ID] + +./terraformer import azure -r resource_group +./terraformer import azure -R my_resource_group -r virtual_network,resource_group +``` + +List of supported Azure resources: + +* `analysis` + * `azurerm_analysis_services_server` +* `app_service` + * `azurerm_app_service` +* `container` + * `azurerm_container_group` + * `azurerm_container_registry` + * `azurerm_container_registry_webhook` +* `cosmosdb` + * `azurerm_cosmosdb_account` + * `azurerm_cosmosdb_sql_container` + * `azurerm_cosmosdb_sql_database` + * `azurerm_cosmosdb_table` +* `database` + * `azurerm_mariadb_configuration` + * `azurerm_mariadb_database` + * `azurerm_mariadb_firewall_rule` + * `azurerm_mariadb_server` + * `azurerm_mariadb_virtual_network_rule` + * `azurerm_mysql_configuration` + * `azurerm_mysql_database` + * `azurerm_mysql_firewall_rule` + * `azurerm_mysql_server` + * `azurerm_mysql_virtual_network_rule` + * `azurerm_postgresql_configuration` + * `azurerm_postgresql_database` + * `azurerm_postgresql_firewall_rule` + * `azurerm_postgresql_server` + * `azurerm_postgresql_virtual_network_rule` + * `azurerm_sql_database` + * `azurerm_sql_active_directory_administrator` + * `azurerm_sql_elasticpool` + * `azurerm_sql_failover_group` + * `azurerm_sql_firewall_rule` + * `azurerm_sql_server` + * `azurerm_sql_virtual_network_rule` +* `disk` + * `azurerm_managed_disk` +* `dns` + * `azurerm_dns_a_record` + * `azurerm_dns_aaaa_record` + * `azurerm_dns_caa_record` + * `azurerm_dns_cname_record` + * `azurerm_dns_mx_record` + * `azurerm_dns_ns_record` + * `azurerm_dns_ptr_record` + * `azurerm_dns_srv_record` + * `azurerm_dns_txt_record` + * `azurerm_dns_zone` +* `load_balancer` + * `azurerm_lb` + * `azurerm_lb_backend_address_pool` + * `azurerm_lb_nat_rule` + * `azurerm_lb_probe` +* `network_interface` + * `azurerm_network_interface` +* `network_security_group` + * `azurerm_network_security_group` +* `private_dns` + * `azurerm_private_dns_a_record` + * `azurerm_private_dns_aaaa_record` + * `azurerm_private_dns_cname_record` + * `azurerm_private_dns_mx_record` + * `azurerm_private_dns_ptr_record` + * `azurerm_private_dns_srv_record` + * `azurerm_private_dns_txt_record` + * `azurerm_private_dns_zone` + * `azurerm_private_dns_zone_virtual_network_link` +* `public_ip` + * `azurerm_public_ip` + * `azurerm_public_ip_prefix` +* `redis` + * `azurerm_redis_cache +* `resource_group` + * `azurerm_resource_group` +* `scaleset` + * `azurerm_virtual_machine_scale_set` +* `security_center` + * `azurerm_security_center_contact` + * `azurerm_security_center_subscription_pricing` +* `storage_account` + * `azurerm_storage_account` + * `azurerm_storage_blob` + * `azurerm_storage_container` +* `virtual_machine` + * `azurerm_virtual_machine` +* `virtual_network` + * `azurerm_virtual_network` diff --git a/docs/ibmcloud.md b/docs/ibmcloud.md new file mode 100644 index 0000000000..f409d03832 --- /dev/null +++ b/docs/ibmcloud.md @@ -0,0 +1,105 @@ +### Use with IBM Cloud + +If you want to run Terraformer with the IBM Cloud provider plugin on your system, complete the following steps: + + +1. Export IBM Cloud API key as environment variables. + Example: + + ``` + export IC_API_KEY= + export IC_REGION= + terraformer import ibm -r ibm_cos,ibm_iam.... + ``` +2. Use flag for Resource Group to classify resources accordingly. + Example: + + ``` + export IC_API_KEY= + export IC_REGION= + terraformer import ibm --resources=ibm_is_vpc --resource_group=a0d5213d831a454ebace7ed38ca9c8ca + terraformer import ibm --resources=ibm_function --region=us-south + ``` +List of supported IBM Cloud resources: + +* `ibm_kp` + * `ibm_resource_instance` + * `ibm_kms_key` +* `ibm_cos` + * `ibm_resource_instance` + * `ibm_cos_bucket` +* `ibm_iam` + * `ibm_iam_user_policy` + * `ibm_iam_access_group` + * `ibm_iam_access_group_members` + * `ibm_iam_access_group_policy` + * `ibm_iam_access_group_dynamic_rule` +* `ibm_container_vpc_cluster` + * `ibm_container_vpc_cluster` + * `ibm_container_vpc_worker_pool` +* `ibm_database_etcd` + * `ibm_database` +* `ibm_database_mongo` + * `ibm_database` +* `ibm_database_postgresql` + * `ibm_database` +* `ibm_database_rabbitmq` + * `ibm_database` +* `ibm_database_redis` + * `ibm_database` +* `ibm_is_instance_group` + * `ibm_is_instance_group` + * `ibm_is_instance_group_manager` + * `ibm_is_instance_group_manager_policy` +* `ibm_cis` + * `ibm_cis` + * `ibm_cis_dns_record` + * `ibm_cis_firewall` + * `ibm_cis_domain_settings` + * `ibm_cis_global_load_balancer` + * `ibm_cis_edge_functions_action` + * `ibm_cis_edge_functions_trigger` + * `ibm_cis_healthcheck` + * `ibm_cis_rate_limit` +* `ibm_is_vpc` + * `ibm_is_vpc` + * `ibm_is_vpc_address_prefix` + * `ibm_is_vpc_route` + * `ibm_is_vpc_routing_table` + * `ibm_is_vpc_routing_table_route` +* `ibm_is_subnet` +* `ibm_is_instance` +* `ibm_is_security_group` + * `ibm_is_security_group_rule` +* `ibm_is_network_acl` +* `ibm_is_public_gateway` +* `ibm_is_volume` +* `ibm_is_vpn_gateway` + * `ibm_is_vpn_gateway_connections` +* `ibm_is_lb` + * `ibm_is_lb_pool` + * `ibm_is_lb_pool_member` + * `ibm_is_lb_listener` + * `ibm_is_lb_listener_policy` + * `ibm_is_lb_listener_policy_rule` +* `ibm_is_floating_ip` +* `ibm_is_flow_log` +* `ibm_is_ike_policy` +* `ibm_is_image` +* `ibm_is_instance_template` +* `ibm_is_ipsec_policy` +* `ibm_is_ssh_key` +* `ibm_function` + * `ibm_function_package` + * `ibm_function_action` + * `ibm_function_rule` + * `ibm_function_trigger` +* `ibm_private_dns` + * `ibm_resource_instance` + * `ibm_dns_zone` + * `ibm_dns_resource_record` + * `ibm_dns_permitted_network` + * `ibm_dns_glb_monitor` + * `ibm_dns_glb_pool` + * `ibm_dns_glb` + From 2f784ed5912f930c1dc22ab8cc9e5d831d1a40e2 Mon Sep 17 00:00:00 2001 From: Mohamed chiheb Ben jemaa Date: Wed, 7 Apr 2021 11:36:34 +0100 Subject: [PATCH 153/276] Split Docs providers to /docs & create assets dir --- README.md | 817 +---------------------------- {docs => assets}/waze-sre-logo.png | Bin docs/cloudflare.md | 35 ++ docs/commercetools.md | 33 ++ docs/datadog.md | 74 +++ docs/digitalocean.md | 47 ++ docs/fastly.md | 19 + docs/github.md | 35 ++ docs/gmailfilter.md | 27 + docs/heroku.md | 45 ++ docs/keycloak.md | 49 ++ docs/kubernetes.md | 49 ++ docs/linode.md | 32 ++ docs/logz.md | 14 + docs/mikrotik.md | 18 + docs/ns1.md | 17 + docs/octopus.md | 31 ++ docs/openstack.md | 19 + docs/rabbitmq.md | 29 + docs/relic.md | 21 + docs/tencentcloud.md | 55 ++ docs/vultr.md | 35 ++ docs/xen.md | 16 + docs/yandex.md | 23 + 24 files changed, 748 insertions(+), 792 deletions(-) rename {docs => assets}/waze-sre-logo.png (100%) create mode 100644 docs/cloudflare.md create mode 100644 docs/commercetools.md create mode 100644 docs/datadog.md create mode 100644 docs/digitalocean.md create mode 100644 docs/fastly.md create mode 100644 docs/github.md create mode 100644 docs/gmailfilter.md create mode 100644 docs/heroku.md create mode 100644 docs/keycloak.md create mode 100644 docs/kubernetes.md create mode 100644 docs/linode.md create mode 100644 docs/logz.md create mode 100644 docs/mikrotik.md create mode 100644 docs/ns1.md create mode 100644 docs/octopus.md create mode 100644 docs/openstack.md create mode 100644 docs/rabbitmq.md create mode 100644 docs/relic.md create mode 100644 docs/tencentcloud.md create mode 100644 docs/vultr.md create mode 100644 docs/xen.md create mode 100644 docs/yandex.md diff --git a/README.md b/README.md index 54ce6865a4..f86a8b6d14 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * Disclaimer: This is not an official Google product * Created by: Waze SRE -![Waze SRE logo](docs/waze-sre-logo.png) +![Waze SRE logo](assets/waze-sre-logo.png) # Table of Contents - [Demo GCP](#demo-gcp) - [Capabilities](#capabilities) - [Installation](#installation) -- [Supported Providers](/providers) +- [Supported Providers](/docs) * Major Cloud * [Google Cloud](/docs/gcp.md) * [AWS](/docs/aws.md) @@ -25,34 +25,34 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [AliCloud](/docs/alicloud.md) * [IBM Cloud](/docs/ibmcloud.md) * Cloud - * [DigitalOcean](#use-with-digitalocean) - * [Equinix Metal](#use-with-equinix-metal) - * [Fastly](#use-with-fastly) - * [Heroku](#use-with-heroku) - * [Linode](#use-with-linode) - * [NS1](#use-with-ns1) - * [OpenStack](#use-with-openstack) - * [TencentCloud](#use-with-tencentcloud) - * [Vultr](#use-with-vultr) - * [Yandex.Cloud](#use-with-yandex) + * [DigitalOcean](/docs/digitalocean.md) + * [Equinix Metal](/docs/eq) + * [Fastly](/docs/fastly.md) + * [Heroku](/docs/heroku.md) + * [Linode](/docs/linode.md) + * [NS1](/docs/ns1.md) + * [OpenStack](/docs/openstack.md) + * [TencentCloud](/docs/tencentcloud.md) + * [Vultr](/docs/vultr.md) + * [Yandex.Cloud](/docs/yandex.md) * Infrastructure Software - * [Kubernetes](#use-with-kubernetes) - * [OctopusDeploy](#use-with-octopusdeploy) - * [RabbitMQ](#use-with-rabbitmq) + * [Kubernetes](/docs/kubernetes.md) + * [OctopusDeploy](/docs/octopus.md) + * [RabbitMQ](/docs/rabbitmq.md) * Network - * [Cloudflare](#use-with-cloudflare) + * [Cloudflare](/docs/cloudflare.md) * VCS - * [GitHub](#use-with-github) + * [GitHub](/docs/github.md) * Monitoring & System Management - * [Datadog](#use-with-datadog) - * [New Relic](#use-with-new-relic) + * [Datadog](/docs/datadog.md) + * [New Relic](/docs/relic.md) * Community - * [Keycloak](#use-with-keycloak) - * [Logz.io](#use-with-logzio) - * [Commercetools](#use-with-commercetools) - * [Mikrotik](#use-with-mikrotik) - * [Xen Orchestra](#use-with-xenorchestra) - * [GmailFilter](#use-with-gmailfilter) + * [Keycloak](/docs/keycloak.md) + * [Logz.io](/docs/logz.md) + * [Commercetools](/docs/commercetools.md) + * [Mikrotik](/docs/mikrotik.md) + * [Xen Orchestra](/docs/xen.md) + * [GmailFilter](/docs/gmailfilter.md) - [Contributing](#contributing) - [Developing](#developing) - [Infrastructure](#infrastructure) @@ -277,773 +277,6 @@ Information on provider plugins: https://www.terraform.io/docs/configuration/providers.html - -### Use with DigitalOcean - -Example: - -``` -export DIGITALOCEAN_TOKEN=[DIGITALOCEAN_TOKEN] -./terraformer import digitalocean -r project,droplet -``` - -List of supported DigitalOcean resources: - -* `cdn` - * `digitalocean_cdn` -* `certificate` - * `digitalocean_certificate` -* `database_cluster` - * `digitalocean_database_cluster` - * `digitalocean_database_connection_pool` - * `digitalocean_database_db` - * `digitalocean_database_replica` - * `digitalocean_database_user` -* `domain` - * `digitalocean_domain` - * `digitalocean_record` -* `droplet` - * `digitalocean_droplet` -* `droplet_snapshot` - * `digitalocean_droplet_snapshot` -* `firewall` - * `digitalocean_firewall` -* `floating_ip` - * `digitalocean_floating_ip` -* `kubernetes_cluster` - * `digitalocean_kubernetes_cluster` - * `digitalocean_kubernetes_node_pool` -* `loadbalancer` - * `digitalocean_loadbalancer` -* `project` - * `digitalocean_project` -* `ssh_key` - * `digitalocean_ssh_key` -* `tag` - * `digitalocean_tag` -* `volume` - * `digitalocean_volume` -* `volume_snapshot` - * `digitalocean_volume_snapshot` - -### Use with Equinix Metal - -Example: - -``` -export METAL_AUTH_TOKEN=[METAL_AUTH_TOKEN] -export PACKET_PROJECT_ID=[PROJECT_ID] -./terraformer import metal -r volume,device -``` - -List of supported Equinix Metal resources: - -* `device` - * `metal_device` -* `volume` - * `metal_volume` -* `sshkey` - * `metal_ssh_key` -* `spotmarketrequest` - * `metal_spot_market_request` - -### Use with Fastly - -Example: - -``` -export FASTLY_API_KEY=[FASTLY_API_KEY] -export FASTLY_CUSTOMER_ID=[FASTLY_CUSTOMER_ID] -./terraformer import fastly -r service_v1,user -``` - -List of supported Fastly resources: - -* `service_v1` - * `fastly_service_acl_entries_v1` - * `fastly_service_dictionary_items_v1` - * `fastly_service_dynamic_snippet_content_v1` - * `fastly_service_v1` -* `user` - * `fastly_user_v1` - -### Use with Heroku - -Example: - -``` -export HEROKU_EMAIL=[HEROKU_EMAIL] -export HEROKU_API_KEY=[HEROKU_API_KEY] -./terraformer import heroku -r app,addon -``` - -List of supported Heroku resources: - -* `account_feature` - * `heroku_account_feature` -* `addon` - * `heroku_addon` -* `addon_attachment` - * `heroku_addon_attachment` -* `app` - * `heroku_app` -* `app_config_association` - * `heroku_app_config_association` -* `app_feature` - * `heroku_app_feature` -* `app_webhook` - * `heroku_app_webhook` -* `build` - * `heroku_build` -* `cert` - * `heroku_cert` -* `domain` - * `heroku_domain` -* `drain` - * `heroku_drain` -* `formation` - * `heroku_formation` -* `pipeline` - * `heroku_pipeline` -* `pipeline_coupling` - * `heroku_pipeline_coupling` -* `team_collaborator` - * `heroku_team_collaborator` -* `team_member` - * `heroku_team_member` - - -### Use with Linode - -Example: - -``` -export LINODE_TOKEN=[LINODE_TOKEN] -./terraformer import linode -r instance -``` - -List of supported Linode resources: - -* `domain` - * `linode_domain` - * `linode_domain_record` -* `image` - * `linode_image` -* `instance` - * `linode_instance` -* `nodebalancer` - * `linode_nodebalancer` - * `linode_nodebalancer_config` - * `linode_nodebalancer_node` -* `rdns` - * `linode_rdns` -* `sshkey` - * `linode_sshkey` -* `stackscript` - * `linode_stackscript` -* `token` - * `linode_token` -* `volume` - * `linode_volume` - -### Use with NS1 - -Example: - -``` -$ export NS1_APIKEY=[NS1_APIKEY] -$ terraformer import ns1 -r zone,monitoringjob,team -``` - -List of supported NS1 resources: - -* `zone` - * `ns1_zone` -* `monitoringjob` - * `ns1_monitoringjob` -* `team` - * `ns1_team` - -### Use with OpenStack - -Example: - -``` - terraformer import openstack --resources=compute,networking --regions=RegionOne -``` - -List of supported OpenStack services: - -* `blockstorage` - * `openstack_blockstorage_volume_v1` - * `openstack_blockstorage_volume_v2` - * `openstack_blockstorage_volume_v3` -* `compute` - * `openstack_compute_instance_v2` -* `networking` - * `openstack_networking_secgroup_v2` - * `openstack_networking_secgroup_rule_v2` - -### Use with TencentCloud - -Example: - -``` -$ export TENCENTCLOUD_SECRET_ID= -$ export TENCENTCLOUD_SECRET_KEY= -$ terraformer import tencentcloud --resources=cvm,cbs --regions=ap-guangzhou -``` - -List of supported TencentCloud services: - -* `as` - * `tencentcloud_as_scaling_group` - * `tencentcloud_as_scaling_config` -* `cbs` - * `tencentcloud_cbs_storage` -* `cdn` - * `tencentcloud_cdn_domain` -* `cfs` - * `tencentcloud_cfs_file_system` -* `clb` - * `tencentcloud_clb_instance` -* `cos` - * `tencentcloud_cos_bucket` -* `cvm` - * `tencentcloud_instance` -* `elasticsearch` - * `tencentcloud_elasticsearch_instance` -* `gaap` - * `tencentcloud_gaap_proxy` - * `tencentcloud_gaap_realserver` -* `key_pair` - * `tencentcloud_key_pair` -* `mongodb` - * `tencentcloud_mongodb_instance` -* `mysql` - * `tencentcloud_mysql_instance` - * `tencentcloud_mysql_readonly_instance` -* `redis` - * `tencentcloud_redis_instance` -* `scf` - * `tencentcloud_scf_function` -* `security_group` - * `tencentcloud_security_group` -* `ssl` - * `tencentcloud_ssl_certificate` -* `subnet` - * `tencentcloud_subnet` -* `tcaplus` - * `tencentcloud_tcaplus_cluster` -* `vpc` - * `tencentcloud_vpc` -* `vpc` - * `tencentcloud_vpn_gateway` - -### Use with Vultr - -Example: - -``` -export VULTR_API_KEY=[VULTR_API_KEY] -./terraformer import vultr -r server -``` - -List of supported Vultr resources: - -* `bare_metal_server` - * `vultr_bare_metal_server` -* `block_storage` - * `vultr_block_storage` -* `dns_domain` - * `vultr_dns_domain` - * `vultr_dns_record` -* `firewall_group` - * `vultr_firewall_group` - * `vultr_firewall_rule` -* `network` - * `vultr_network` -* `reserved_ip` - * `vultr_reserved_ip` -* `server` - * `vultr_server` -* `snapshot` - * `vultr_snapshot` -* `ssh_key` - * `vultr_ssh_key` -* `startup_script` - * `vultr_startup_script` -* `user` - * `vultr_user` - -### Use with Yandex - -Example: - -``` -export YC_TOKEN=[YANDEX_CLOUD_OAUTH_TOKEN] -export YC_FOLDER_ID=[YANDEX_FOLDER_ID] -./terraformer import yandex -r subnet -``` - -List of supported Yandex resources: - -* `instance` - * `yandex_compute_instance` -* `disk` - * `yandex_compute_disk` -* `subnet` - * `yandex_vpc_subnet` -* `network` - * `yandex_vpc_network` - -Your `tf` and `tfstate` files are written by default to -`generated/yandex/service`. - -### Use with Kubernetes - -Example: - -``` - terraformer import kubernetes --resources=deployments,services,storageclasses - terraformer import kubernetes --resources=deployments,services,storageclasses --filter=deployment=name1:name2:name3 -``` - -All Kubernetes resources that are currently supported by the Kubernetes provider, are also supported by this module. Here is the list of resources which are currently supported by Kubernetes provider v.1.4: - -* `clusterrolebinding` - * `kubernetes_cluster_role_binding` -* `configmaps` - * `kubernetes_config_map` -* `deployments` - * `kubernetes_deployment` -* `horizontalpodautoscalers` - * `kubernetes_horizontal_pod_autoscaler` -* `limitranges` - * `kubernetes_limit_range` -* `namespaces` - * `kubernetes_namespace` -* `persistentvolumes` - * `kubernetes_persistent_volume` -* `persistentvolumeclaims` - * `kubernetes_persistent_volume_claim` -* `pods` - * `kubernetes_pod` -* `replicationcontrollers` - * `kubernetes_replication_controller` -* `resourcequotas` - * `kubernetes_resource_quota` -* `secrets` - * `kubernetes_secret` -* `services` - * `kubernetes_service` -* `serviceaccounts` - * `kubernetes_service_account` -* `statefulsets` - * `kubernetes_stateful_set` -* `storageclasses` - * `kubernetes_storage_class` - -#### Known issues - -* Terraform Kubernetes provider is rejecting resources with ":" characters in their names (as they don't meet DNS-1123), while it's allowed for certain types in Kubernetes, e.g. ClusterRoleBinding. -* Because Terraform flatmap uses "." to detect the keys for unflattening the maps, some keys with "." in their names are being considered as the maps. -* Since the library assumes empty strings to be empty values (not "0"), there are some issues with optional integer keys that are restricted to be positive. - -### Use with OctopusDeploy - -Example: - -``` -export OCTOPUS_CLI_SERVER=http://localhost:8081/ -export OCTOPUS_CLI_API_KEY=API-CK7DQ8BMJCUUBSHAJCDIATXUO - -terraformer import octopusdeploy --resources=tagsets -``` - -* `accounts` - * `octopusdeploy_account` -* `certificates` - * `octopusdeploy_certificate` -* `environments` - * `octopusdeploy_environment` -* `feeds` - * `octopusdeploy_feed` -* `libraryvariablesets` - * `octopusdeploy_library_variable_set` -* `lifecycle` - * `octopusdeploy_lifecycle` -* `project` - * `octopusdeploy_project` -* `projectgroups` - * `octopusdeploy_project_group` -* `projecttriggers` - * `octopusdeploy_project_deployment_target_trigger` -* `tagsets` - * `octopusdeploy_tag_set` - -### Use with RabbitMQ - -Example: - -``` - export RABBITMQ_SERVER_URL=http://foo.bar.localdomain:15672 - export RABBITMQ_USERNAME=[RABBITMQ_USERNAME] - export RABBITMQ_PASSWORD=[RABBITMQ_PASSWORD] - - terraformer import rabbitmq --resources=vhosts,queues,exchanges - terraformer import rabbitmq --resources=vhosts,queues,exchanges --filter=vhost=name1:name2:name3 -``` - -All RabbitMQ resources that are currently supported by the RabbitMQ provider, are also supported by this module. Here is the list of resources which are currently supported by RabbitMQ provider v.1.1.0: - -* `bindings` - * `rabbitmq_binding` -* `exchanges` - * `rabbitmq_exchange` -* `permissions` - * `rabbitmq_permissions` -* `policies` - * `rabbitmq_policy` -* `queues` - * `rabbitmq_queue` -* `users` - * `rabbitmq_user` -* `vhosts` - * `rabbitmq_vhost` - -### Use with Cloudflare - -Example using a Cloudflare API Key and corresponding email: -``` -export CLOUDFLARE_API_KEY=[CLOUDFLARE_API_KEY] -export CLOUDFLARE_EMAIL=[CLOUDFLARE_EMAIL] -export CLOUDFLARE_ACCOUNT_ID=[CLOUDFLARE_ACCOUNT_ID] - ./terraformer import cloudflare --resources=firewall,dns -``` - -or using a Cloudflare API Token: - -``` -export CLOUDFLARE_API_TOKEN=[CLOUDFLARE_API_TOKEN] -export CLOUDFLARE_ACCOUNT_ID=[CLOUDFLARE_ACCOUNT_ID] - ./terraformer import cloudflare --resources=firewall,dns -``` - -List of supported Cloudflare services: - -* `access` - * `cloudflare_access_application` -* `dns` - * `cloudflare_zone` - * `cloudflare_record` -* `firewall` - * `cloudflare_access_rule` - * `cloudflare_filter` - * `cloudflare_firewall_rule` - * `cloudflare_zone_lockdown` - * `cloudflare_rate_limit` -* `page_rule` - * `cloudflare_page_rule` -* `account_member` - * `cloudflare_account_member` - -### Use with GitHub - -Example: - -``` - ./terraformer import github --organizations=YOUR_ORGANIZATION --resources=repositories --token=YOUR_TOKEN // or GITHUB_TOKEN in env - ./terraformer import github --organizations=YOUR_ORGANIZATION --resources=repositories --filter=repository=id1:id2:id4 --token=YOUR_TOKEN // or GITHUB_TOKEN in env -``` - -Supports only organizational resources. List of supported resources: - -* `members` - * `github_membership` -* `organization_blocks` - * `github_organization_block` -* `organization_projects` - * `github_organization_project` -* `organization_webhooks` - * `github_organization_webhook` -* `repositories` - * `github_repository` - * `github_repository_webhook` - * `github_branch_protection` - * `github_repository_collaborator` - * `github_repository_deploy_key` -* `teams` - * `github_team` - * `github_team_membership` - * `github_team_repository` -* `user_ssh_keys` - * `github_user_ssh_key` - -Notes: -* Terraformer can't get webhook secrets from the GitHub API. If you use a secret token in any of your webhooks, running `terraform plan` will result in a change being detected: -=> `configuration.#: "1" => "0"` in tfstate only. - -### Use with Datadog - -Example: - -``` - ./terraformer import datadog --resources=monitor --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env --api-url=DATADOG_API_URL // or DATADOG_HOST in env - ./terraformer import datadog --resources=monitor --filter=monitor=id1:id2:id4 --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env -``` - -List of supported Datadog services: - -* `dashboard` - * `datadog_dashboard` -* `dashboard_list` - * `datadog_dashboard_list` -* `downtime` - * `datadog_downtime` -* `logs_archive` - * `datadog_logs_archive` -* `logs_archive_order` - * `datadog_logs_archive_order` -* `logs_custom_pipeline` - * `datadog_logs_custom_pipeline` -* `logs_integration_pipeline` - * `datadog_logs_integration_pipeline` -* `logs_pipeline_order` - * `datadog_logs_pipeline_order` -* `logs_index` - * `datadog_logs_index` -* `logs_index_order` - * `datadog_logs_index_order` -* `integration_aws` - * `datadog_integration_aws` -* `integration_aws_lambda_arn` - * `datadog_integration_aws_lambda_arn` -* `integration_aws_log_collection` - * `datadog_integration_aws_log_collection` -* `integration_azure` - * `datadog_integration_azure` - * **_NOTE:_** Sensitive field `client_secret` is not generated and needs to be manually set -* `integration_gcp` - * `datadog_integration_gcp` - * **_NOTE:_** Sensitive fields `private_key, private_key_id, client_id` is not generated and needs to be manually set -* `integration_pagerduty` - * `datadog_integration_pagerduty` -* `integration_pagerduty_service_object` - * `datadog_integration_pagerduty_service_object` -* `metric_metadata` - * `datadog_metric_metadata` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option -* `monitor` - * `datadog_monitor` -* `role` - * `datadog_role` -* `screenboard` - * `datadog_screenboard` -* `security_monitoring_default_rule` - * `datadog_security_monitoring_default_rule` -* `security_monitoring_rule` - * `datadog_security_monitoring_rule` -* `service_level_objective` - * `datadog_service_level_objective` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option -* `synthetics` - * `datadog_synthetics_test` -* `synthetics_global_variables` - * `datadog_synthetics_global_variables` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option -* `synthetics_private_location` - * `datadog_synthetics_private_location` -* `timeboard` - * `datadog_timeboard` -* `user` - * `datadog_user` - -### Use with New Relic - -Example: - -``` -./terraformer import newrelic -r alert,dashboard,infra,synthetics --api-key=NRAK-XXXXXXXX --account-id=XXXXX -``` - -List of supported New Relic resources: - -* `alert` - * `newrelic_alert_channel` - * `newrelic_alert_condition` - * `newrelic_alert_policy` -* `dashboard` - * `newrelic_dashboard` -* `infra` - * `newrelic_infra_alert_condition` -* `synthetics` - * `newrelic_synthetics_monitor` - * `newrelic_synthetics_alert_condition` - -### Use with Keycloak - -Example: - -``` - export KEYCLOAK_URL=https://foo.bar.localdomain - export KEYCLOAK_CLIENT_ID=[KEYCLOAK_CLIENT_ID] - export KEYCLOAK_CLIENT_SECRET=[KEYCLOAK_CLIENT_SECRET] - - terraformer import keycloak --resources=realms - terraformer import keycloak --resources=realms --filter=realm=name1:name2:name3 - terraformer import keycloak --resources=realms --targets realmA,realmB -``` - -Here is the list of resources which are currently supported by Keycloak provider v.1.19.0: - -- `realms` - - `keycloak_default_groups` - - `keycloak_group` - - `keycloak_group_memberships` - - `keycloak_group_roles` - - `keycloak_ldap_full_name_mapper` - - `keycloak_ldap_group_mapper` - - `keycloak_ldap_hardcoded_group_mapper` - - `keycloak_ldap_hardcoded_role_mapper` - - `keycloak_ldap_msad_lds_user_account_control_mapper` - - `keycloak_ldap_msad_user_account_control_mapper` - - `keycloak_ldap_user_attribute_mapper` - - `keycloak_ldap_user_federation` - - `keycloak_openid_audience_protocol_mapper` - - `keycloak_openid_client` - - `keycloak_openid_client_default_scopes` - - `keycloak_openid_client_optional_scopes` - - `keycloak_openid_client_scope` - - `keycloak_openid_client_service_account_role` - - `keycloak_openid_full_name_protocol_mapper` - - `keycloak_openid_group_membership_protocol_mapper` - - `keycloak_openid_hardcoded_claim_protocol_mapper` - - `keycloak_openid_hardcoded_group_protocol_mapper` - - `keycloak_openid_hardcoded_role_protocol_mapper` (only for client roles) - - `keycloak_openid_user_attribute_protocol_mapper` - - `keycloak_openid_user_property_protocol_mapper` - - `keycloak_openid_user_realm_role_protocol_mapper` - - `keycloak_openid_user_client_role_protocol_mapper` - - `keycloak_openid_user_session_note_protocol_mapper` - - `keycloak_realm` - - `keycloak_required_action` - - `keycloak_role` - - `keycloak_user` - -### Use with Logz.io - -Example: - -``` - LOGZIO_API_TOKEN=foobar LOGZIO_BASE_URL=https://api-eu.logz.io ./terraformer import logzio -r=alerts,alert_notification_endpoints // Import Logz.io alerts and alert notification endpoints -``` - -List of supported Logz.io resources: - -* `alerts` - * `logzio_alert` -* `alert_notification_endpoints` - * `logzio_endpoint` - -### Use with [Commercetools](https://commercetools.com/de/) - -This provider use the [terraform-provider-commercetools](https://github.com/labd/terraform-provider-commercetools). The terraformer provider was build by [Dustin Deus](https://github.com/StarpTech). - -Example: - -``` -CTP_CLIENT_ID=foo CTP_CLIENT_SCOPE=scope CTP_CLIENT_SECRET=bar CTP_PROJECT_KEY=key ./terraformer plan commercetools -r=types // Only planning -CTP_CLIENT_ID=foo CTP_CLIENT_SCOPE=scope CTP_CLIENT_SECRET=bar CTP_PROJECT_KEY=key ./terraformer import commercetools -r=types // Import commercetools types -``` - -List of supported [commercetools](https://commercetools.com/de/) resources: - -* `api_extension` - * `commercetools_api_extension` -* `channel` - * `commercetools_channel` -* `product_type` - * `commercetools_product_type` -* `shipping_method` - * `commercetools_shipping_method` -* `shipping_zone` - * `commercetools_shipping_zone` -* `state` - * `commercetools_state` -* `store` - * `commercetools_store` -* `subscription` - * `commercetools_subscription` -* `tax_category` - * `commercetools_tax_category` -* `types` - * `commercetools_type` - -### Use with [Mikrotik](https://wiki.mikrotik.com/wiki/Manual:TOC) - -This provider uses the [terraform-provider-mikrotik](https://github.com/ddelnano/terraform-provider-mikrotik). The terraformer provider was built by [Dom Del Nano](https://github.com/ddelnano). - -Example: - -``` -## Warning! You should not expose your mikrotik creds through your bash history. Export them to your shell in a safe way when doing this for real! - -MIKROTIK_HOST=router-hostname:8728 MIKROTIK_USER=username MIKROTIK_PASSWORD=password terraformer import mikrotik -r=dhcp_lease - -# Import only static IPs -MIKROTIK_HOST=router-hostname:8728 MIKROTIK_USER=username MIKROTIK_PASSWORD=password terraformer import mikrotik -r=dhcp_lease --filter='Name=dynamic;Value=false' -``` - -List of supported mikrotik resources: - -* `mikrotik_dhcp_lease` - -### Use with [Xen Orchestra](https://xen-orchestra.com/) - -This provider uses the [terraform-provider-xenorchestra](https://github.com/ddelnano/terraform-provider-xenorchestra). The terraformer provider was built by [Dom Del Nano](https://github.com/ddelnano) on behalf of [Vates SAS](https://vates.fr/) who is sponsoring Dom to work on the project. - -Example: - -``` -## Warning! You should not expose your xenorchestra creds through your bash history. Export them to your shell in a safe way when doing this for real! - -XOA_URL=ws://your-xenorchestra-domain XOA_USER=username XOA_PASSWORD=password terraformer import xenorchestra -r=acl -``` - -List of supported xenorchestra resources: - -* `xenorchestra_acl` -* `xenorchestra_resource_set` - - -### Use with GmailFilter - -Support [Using Service Accounts](https://github.com/yamamoto-febc/terraform-provider-gmailfilter/blob/master/README.md#using-a-service-accountg-suite-users-only) or [Using Application Default Credentials](https://github.com/yamamoto-febc/terraform-provider-gmailfilter/blob/master/README.md#using-an-application-default-credential). - -Example: - -``` -# Using Service Accounts -export GOOGLE_CREDENTIALS=/path/to/client_secret.json -export IMPERSONATED_USER_EMAIL="foobar@example.com" - -# Using Application Default Credentials -gcloud auth application-default login \ - --client-id-file=client_secret.json \ - --scopes \ -https://www.googleapis.com/auth/gmail.labels,\ -https://www.googleapis.com/auth/gmail.settings.basic - -./terraformer import gmailfilter -r=filter,label -``` - -List of supported GmailFilter resources: - -* `label` - * `gmailfilter_label` -* `filter` - * `gmailfilter_filter` ## Contributing diff --git a/docs/waze-sre-logo.png b/assets/waze-sre-logo.png similarity index 100% rename from docs/waze-sre-logo.png rename to assets/waze-sre-logo.png diff --git a/docs/cloudflare.md b/docs/cloudflare.md new file mode 100644 index 0000000000..4715915760 --- /dev/null +++ b/docs/cloudflare.md @@ -0,0 +1,35 @@ +### Use with Cloudflare + +Example using a Cloudflare API Key and corresponding email: +``` +export CLOUDFLARE_API_KEY=[CLOUDFLARE_API_KEY] +export CLOUDFLARE_EMAIL=[CLOUDFLARE_EMAIL] +export CLOUDFLARE_ACCOUNT_ID=[CLOUDFLARE_ACCOUNT_ID] + ./terraformer import cloudflare --resources=firewall,dns +``` + +or using a Cloudflare API Token: + +``` +export CLOUDFLARE_API_TOKEN=[CLOUDFLARE_API_TOKEN] +export CLOUDFLARE_ACCOUNT_ID=[CLOUDFLARE_ACCOUNT_ID] + ./terraformer import cloudflare --resources=firewall,dns +``` + +List of supported Cloudflare services: + +* `access` + * `cloudflare_access_application` +* `dns` + * `cloudflare_zone` + * `cloudflare_record` +* `firewall` + * `cloudflare_access_rule` + * `cloudflare_filter` + * `cloudflare_firewall_rule` + * `cloudflare_zone_lockdown` + * `cloudflare_rate_limit` +* `page_rule` + * `cloudflare_page_rule` +* `account_member` + * `cloudflare_account_member` diff --git a/docs/commercetools.md b/docs/commercetools.md new file mode 100644 index 0000000000..f62fa98dc3 --- /dev/null +++ b/docs/commercetools.md @@ -0,0 +1,33 @@ +### Use with [Commercetools](https://commercetools.com/de/) + +This provider use the [terraform-provider-commercetools](https://github.com/labd/terraform-provider-commercetools). The terraformer provider was build by [Dustin Deus](https://github.com/StarpTech). + +Example: + +``` +CTP_CLIENT_ID=foo CTP_CLIENT_SCOPE=scope CTP_CLIENT_SECRET=bar CTP_PROJECT_KEY=key ./terraformer plan commercetools -r=types // Only planning +CTP_CLIENT_ID=foo CTP_CLIENT_SCOPE=scope CTP_CLIENT_SECRET=bar CTP_PROJECT_KEY=key ./terraformer import commercetools -r=types // Import commercetools types +``` + +List of supported [commercetools](https://commercetools.com/de/) resources: + +* `api_extension` + * `commercetools_api_extension` +* `channel` + * `commercetools_channel` +* `product_type` + * `commercetools_product_type` +* `shipping_method` + * `commercetools_shipping_method` +* `shipping_zone` + * `commercetools_shipping_zone` +* `state` + * `commercetools_state` +* `store` + * `commercetools_store` +* `subscription` + * `commercetools_subscription` +* `tax_category` + * `commercetools_tax_category` +* `types` + * `commercetools_type` diff --git a/docs/datadog.md b/docs/datadog.md new file mode 100644 index 0000000000..dd91eea2e7 --- /dev/null +++ b/docs/datadog.md @@ -0,0 +1,74 @@ +### Use with Datadog + +Example: + +``` + ./terraformer import datadog --resources=monitor --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env --api-url=DATADOG_API_URL // or DATADOG_HOST in env + ./terraformer import datadog --resources=monitor --filter=monitor=id1:id2:id4 --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env +``` + +List of supported Datadog services: + +* `dashboard` + * `datadog_dashboard` +* `dashboard_list` + * `datadog_dashboard_list` +* `downtime` + * `datadog_downtime` +* `logs_archive` + * `datadog_logs_archive` +* `logs_archive_order` + * `datadog_logs_archive_order` +* `logs_custom_pipeline` + * `datadog_logs_custom_pipeline` +* `logs_integration_pipeline` + * `datadog_logs_integration_pipeline` +* `logs_pipeline_order` + * `datadog_logs_pipeline_order` +* `logs_index` + * `datadog_logs_index` +* `logs_index_order` + * `datadog_logs_index_order` +* `integration_aws` + * `datadog_integration_aws` +* `integration_aws_lambda_arn` + * `datadog_integration_aws_lambda_arn` +* `integration_aws_log_collection` + * `datadog_integration_aws_log_collection` +* `integration_azure` + * `datadog_integration_azure` + * **_NOTE:_** Sensitive field `client_secret` is not generated and needs to be manually set +* `integration_gcp` + * `datadog_integration_gcp` + * **_NOTE:_** Sensitive fields `private_key, private_key_id, client_id` is not generated and needs to be manually set +* `integration_pagerduty` + * `datadog_integration_pagerduty` +* `integration_pagerduty_service_object` + * `datadog_integration_pagerduty_service_object` +* `metric_metadata` + * `datadog_metric_metadata` + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option +* `monitor` + * `datadog_monitor` +* `role` + * `datadog_role` +* `screenboard` + * `datadog_screenboard` +* `security_monitoring_default_rule` + * `datadog_security_monitoring_default_rule` +* `security_monitoring_rule` + * `datadog_security_monitoring_rule` +* `service_level_objective` + * `datadog_service_level_objective` + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option +* `synthetics` + * `datadog_synthetics_test` +* `synthetics_global_variables` + * `datadog_synthetics_global_variables` + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option +* `synthetics_private_location` + * `datadog_synthetics_private_location` +* `timeboard` + * `datadog_timeboard` +* `user` + * `datadog_user` diff --git a/docs/digitalocean.md b/docs/digitalocean.md new file mode 100644 index 0000000000..31af052f72 --- /dev/null +++ b/docs/digitalocean.md @@ -0,0 +1,47 @@ +### Use with DigitalOcean + +Example: + +``` +export DIGITALOCEAN_TOKEN=[DIGITALOCEAN_TOKEN] +./terraformer import digitalocean -r project,droplet +``` + +List of supported DigitalOcean resources: + +* `cdn` + * `digitalocean_cdn` +* `certificate` + * `digitalocean_certificate` +* `database_cluster` + * `digitalocean_database_cluster` + * `digitalocean_database_connection_pool` + * `digitalocean_database_db` + * `digitalocean_database_replica` + * `digitalocean_database_user` +* `domain` + * `digitalocean_domain` + * `digitalocean_record` +* `droplet` + * `digitalocean_droplet` +* `droplet_snapshot` + * `digitalocean_droplet_snapshot` +* `firewall` + * `digitalocean_firewall` +* `floating_ip` + * `digitalocean_floating_ip` +* `kubernetes_cluster` + * `digitalocean_kubernetes_cluster` + * `digitalocean_kubernetes_node_pool` +* `loadbalancer` + * `digitalocean_loadbalancer` +* `project` + * `digitalocean_project` +* `ssh_key` + * `digitalocean_ssh_key` +* `tag` + * `digitalocean_tag` +* `volume` + * `digitalocean_volume` +* `volume_snapshot` + * `digitalocean_volume_snapshot` diff --git a/docs/fastly.md b/docs/fastly.md new file mode 100644 index 0000000000..3be52a788f --- /dev/null +++ b/docs/fastly.md @@ -0,0 +1,19 @@ +### Use with Fastly + +Example: + +``` +export FASTLY_API_KEY=[FASTLY_API_KEY] +export FASTLY_CUSTOMER_ID=[FASTLY_CUSTOMER_ID] +./terraformer import fastly -r service_v1,user +``` + +List of supported Fastly resources: + +* `service_v1` + * `fastly_service_acl_entries_v1` + * `fastly_service_dictionary_items_v1` + * `fastly_service_dynamic_snippet_content_v1` + * `fastly_service_v1` +* `user` + * `fastly_user_v1` diff --git a/docs/github.md b/docs/github.md new file mode 100644 index 0000000000..28e4890f7b --- /dev/null +++ b/docs/github.md @@ -0,0 +1,35 @@ +### Use with GitHub + +Example: + +``` + ./terraformer import github --organizations=YOUR_ORGANIZATION --resources=repositories --token=YOUR_TOKEN // or GITHUB_TOKEN in env + ./terraformer import github --organizations=YOUR_ORGANIZATION --resources=repositories --filter=repository=id1:id2:id4 --token=YOUR_TOKEN // or GITHUB_TOKEN in env +``` + +Supports only organizational resources. List of supported resources: + +* `members` + * `github_membership` +* `organization_blocks` + * `github_organization_block` +* `organization_projects` + * `github_organization_project` +* `organization_webhooks` + * `github_organization_webhook` +* `repositories` + * `github_repository` + * `github_repository_webhook` + * `github_branch_protection` + * `github_repository_collaborator` + * `github_repository_deploy_key` +* `teams` + * `github_team` + * `github_team_membership` + * `github_team_repository` +* `user_ssh_keys` + * `github_user_ssh_key` + +Notes: +* Terraformer can't get webhook secrets from the GitHub API. If you use a secret token in any of your webhooks, running `terraform plan` will result in a change being detected: +=> `configuration.#: "1" => "0"` in tfstate only. diff --git a/docs/gmailfilter.md b/docs/gmailfilter.md new file mode 100644 index 0000000000..dc881aff0c --- /dev/null +++ b/docs/gmailfilter.md @@ -0,0 +1,27 @@ +### Use with GmailFilter + +Support [Using Service Accounts](https://github.com/yamamoto-febc/terraform-provider-gmailfilter/blob/master/README.md#using-a-service-accountg-suite-users-only) or [Using Application Default Credentials](https://github.com/yamamoto-febc/terraform-provider-gmailfilter/blob/master/README.md#using-an-application-default-credential). + +Example: + +``` +# Using Service Accounts +export GOOGLE_CREDENTIALS=/path/to/client_secret.json +export IMPERSONATED_USER_EMAIL="foobar@example.com" + +# Using Application Default Credentials +gcloud auth application-default login \ + --client-id-file=client_secret.json \ + --scopes \ +https://www.googleapis.com/auth/gmail.labels,\ +https://www.googleapis.com/auth/gmail.settings.basic + +./terraformer import gmailfilter -r=filter,label +``` + +List of supported GmailFilter resources: + +* `label` + * `gmailfilter_label` +* `filter` + * `gmailfilter_filter` diff --git a/docs/heroku.md b/docs/heroku.md new file mode 100644 index 0000000000..87474b4b21 --- /dev/null +++ b/docs/heroku.md @@ -0,0 +1,45 @@ +### Use with Heroku + +Example: + +``` +export HEROKU_EMAIL=[HEROKU_EMAIL] +export HEROKU_API_KEY=[HEROKU_API_KEY] +./terraformer import heroku -r app,addon +``` + +List of supported Heroku resources: + +* `account_feature` + * `heroku_account_feature` +* `addon` + * `heroku_addon` +* `addon_attachment` + * `heroku_addon_attachment` +* `app` + * `heroku_app` +* `app_config_association` + * `heroku_app_config_association` +* `app_feature` + * `heroku_app_feature` +* `app_webhook` + * `heroku_app_webhook` +* `build` + * `heroku_build` +* `cert` + * `heroku_cert` +* `domain` + * `heroku_domain` +* `drain` + * `heroku_drain` +* `formation` + * `heroku_formation` +* `pipeline` + * `heroku_pipeline` +* `pipeline_coupling` + * `heroku_pipeline_coupling` +* `team_collaborator` + * `heroku_team_collaborator` +* `team_member` + * `heroku_team_member` + diff --git a/docs/keycloak.md b/docs/keycloak.md new file mode 100644 index 0000000000..156fd6c549 --- /dev/null +++ b/docs/keycloak.md @@ -0,0 +1,49 @@ +### Use with Keycloak + +Example: + +``` + export KEYCLOAK_URL=https://foo.bar.localdomain + export KEYCLOAK_CLIENT_ID=[KEYCLOAK_CLIENT_ID] + export KEYCLOAK_CLIENT_SECRET=[KEYCLOAK_CLIENT_SECRET] + + terraformer import keycloak --resources=realms + terraformer import keycloak --resources=realms --filter=realm=name1:name2:name3 + terraformer import keycloak --resources=realms --targets realmA,realmB +``` + +Here is the list of resources which are currently supported by Keycloak provider v.1.19.0: + +- `realms` + - `keycloak_default_groups` + - `keycloak_group` + - `keycloak_group_memberships` + - `keycloak_group_roles` + - `keycloak_ldap_full_name_mapper` + - `keycloak_ldap_group_mapper` + - `keycloak_ldap_hardcoded_group_mapper` + - `keycloak_ldap_hardcoded_role_mapper` + - `keycloak_ldap_msad_lds_user_account_control_mapper` + - `keycloak_ldap_msad_user_account_control_mapper` + - `keycloak_ldap_user_attribute_mapper` + - `keycloak_ldap_user_federation` + - `keycloak_openid_audience_protocol_mapper` + - `keycloak_openid_client` + - `keycloak_openid_client_default_scopes` + - `keycloak_openid_client_optional_scopes` + - `keycloak_openid_client_scope` + - `keycloak_openid_client_service_account_role` + - `keycloak_openid_full_name_protocol_mapper` + - `keycloak_openid_group_membership_protocol_mapper` + - `keycloak_openid_hardcoded_claim_protocol_mapper` + - `keycloak_openid_hardcoded_group_protocol_mapper` + - `keycloak_openid_hardcoded_role_protocol_mapper` (only for client roles) + - `keycloak_openid_user_attribute_protocol_mapper` + - `keycloak_openid_user_property_protocol_mapper` + - `keycloak_openid_user_realm_role_protocol_mapper` + - `keycloak_openid_user_client_role_protocol_mapper` + - `keycloak_openid_user_session_note_protocol_mapper` + - `keycloak_realm` + - `keycloak_required_action` + - `keycloak_role` + - `keycloak_user` diff --git a/docs/kubernetes.md b/docs/kubernetes.md new file mode 100644 index 0000000000..f28615fae6 --- /dev/null +++ b/docs/kubernetes.md @@ -0,0 +1,49 @@ +### Use with Kubernetes + +Example: + +``` + terraformer import kubernetes --resources=deployments,services,storageclasses + terraformer import kubernetes --resources=deployments,services,storageclasses --filter=deployment=name1:name2:name3 +``` + +All Kubernetes resources that are currently supported by the Kubernetes provider, are also supported by this module. Here is the list of resources which are currently supported by Kubernetes provider v.1.4: + +* `clusterrolebinding` + * `kubernetes_cluster_role_binding` +* `configmaps` + * `kubernetes_config_map` +* `deployments` + * `kubernetes_deployment` +* `horizontalpodautoscalers` + * `kubernetes_horizontal_pod_autoscaler` +* `limitranges` + * `kubernetes_limit_range` +* `namespaces` + * `kubernetes_namespace` +* `persistentvolumes` + * `kubernetes_persistent_volume` +* `persistentvolumeclaims` + * `kubernetes_persistent_volume_claim` +* `pods` + * `kubernetes_pod` +* `replicationcontrollers` + * `kubernetes_replication_controller` +* `resourcequotas` + * `kubernetes_resource_quota` +* `secrets` + * `kubernetes_secret` +* `services` + * `kubernetes_service` +* `serviceaccounts` + * `kubernetes_service_account` +* `statefulsets` + * `kubernetes_stateful_set` +* `storageclasses` + * `kubernetes_storage_class` + +#### Known issues + +* Terraform Kubernetes provider is rejecting resources with ":" characters in their names (as they don't meet DNS-1123), while it's allowed for certain types in Kubernetes, e.g. ClusterRoleBinding. +* Because Terraform flatmap uses "." to detect the keys for unflattening the maps, some keys with "." in their names are being considered as the maps. +* Since the library assumes empty strings to be empty values (not "0"), there are some issues with optional integer keys that are restricted to be positive. diff --git a/docs/linode.md b/docs/linode.md new file mode 100644 index 0000000000..c31ec3f9f3 --- /dev/null +++ b/docs/linode.md @@ -0,0 +1,32 @@ +### Use with Linode + +Example: + +``` +export LINODE_TOKEN=[LINODE_TOKEN] +./terraformer import linode -r instance +``` + +List of supported Linode resources: + +* `domain` + * `linode_domain` + * `linode_domain_record` +* `image` + * `linode_image` +* `instance` + * `linode_instance` +* `nodebalancer` + * `linode_nodebalancer` + * `linode_nodebalancer_config` + * `linode_nodebalancer_node` +* `rdns` + * `linode_rdns` +* `sshkey` + * `linode_sshkey` +* `stackscript` + * `linode_stackscript` +* `token` + * `linode_token` +* `volume` + * `linode_volume` diff --git a/docs/logz.md b/docs/logz.md new file mode 100644 index 0000000000..7fe21a66aa --- /dev/null +++ b/docs/logz.md @@ -0,0 +1,14 @@ +### Use with Logz.io + +Example: + +``` + LOGZIO_API_TOKEN=foobar LOGZIO_BASE_URL=https://api-eu.logz.io ./terraformer import logzio -r=alerts,alert_notification_endpoints // Import Logz.io alerts and alert notification endpoints +``` + +List of supported Logz.io resources: + +* `alerts` + * `logzio_alert` +* `alert_notification_endpoints` + * `logzio_endpoint` diff --git a/docs/mikrotik.md b/docs/mikrotik.md new file mode 100644 index 0000000000..643899b5e1 --- /dev/null +++ b/docs/mikrotik.md @@ -0,0 +1,18 @@ +### Use with [Mikrotik](https://wiki.mikrotik.com/wiki/Manual:TOC) + +This provider uses the [terraform-provider-mikrotik](https://github.com/ddelnano/terraform-provider-mikrotik). The terraformer provider was built by [Dom Del Nano](https://github.com/ddelnano). + +Example: + +``` +## Warning! You should not expose your mikrotik creds through your bash history. Export them to your shell in a safe way when doing this for real! + +MIKROTIK_HOST=router-hostname:8728 MIKROTIK_USER=username MIKROTIK_PASSWORD=password terraformer import mikrotik -r=dhcp_lease + +# Import only static IPs +MIKROTIK_HOST=router-hostname:8728 MIKROTIK_USER=username MIKROTIK_PASSWORD=password terraformer import mikrotik -r=dhcp_lease --filter='Name=dynamic;Value=false' +``` + +List of supported mikrotik resources: + +* `mikrotik_dhcp_lease` \ No newline at end of file diff --git a/docs/ns1.md b/docs/ns1.md new file mode 100644 index 0000000000..52908a0853 --- /dev/null +++ b/docs/ns1.md @@ -0,0 +1,17 @@ +### Use with NS1 + +Example: + +``` +$ export NS1_APIKEY=[NS1_APIKEY] +$ terraformer import ns1 -r zone,monitoringjob,team +``` + +List of supported NS1 resources: + +* `zone` + * `ns1_zone` +* `monitoringjob` + * `ns1_monitoringjob` +* `team` + * `ns1_team` \ No newline at end of file diff --git a/docs/octopus.md b/docs/octopus.md new file mode 100644 index 0000000000..a8d5c5b6e5 --- /dev/null +++ b/docs/octopus.md @@ -0,0 +1,31 @@ +### Use with OctopusDeploy + +Example: + +``` +export OCTOPUS_CLI_SERVER=http://localhost:8081/ +export OCTOPUS_CLI_API_KEY=API-CK7DQ8BMJCUUBSHAJCDIATXUO + +terraformer import octopusdeploy --resources=tagsets +``` + +* `accounts` + * `octopusdeploy_account` +* `certificates` + * `octopusdeploy_certificate` +* `environments` + * `octopusdeploy_environment` +* `feeds` + * `octopusdeploy_feed` +* `libraryvariablesets` + * `octopusdeploy_library_variable_set` +* `lifecycle` + * `octopusdeploy_lifecycle` +* `project` + * `octopusdeploy_project` +* `projectgroups` + * `octopusdeploy_project_group` +* `projecttriggers` + * `octopusdeploy_project_deployment_target_trigger` +* `tagsets` + * `octopusdeploy_tag_set` diff --git a/docs/openstack.md b/docs/openstack.md new file mode 100644 index 0000000000..d27f1f8958 --- /dev/null +++ b/docs/openstack.md @@ -0,0 +1,19 @@ +### Use with OpenStack + +Example: + +``` + terraformer import openstack --resources=compute,networking --regions=RegionOne +``` + +List of supported OpenStack services: + +* `blockstorage` + * `openstack_blockstorage_volume_v1` + * `openstack_blockstorage_volume_v2` + * `openstack_blockstorage_volume_v3` +* `compute` + * `openstack_compute_instance_v2` +* `networking` + * `openstack_networking_secgroup_v2` + * `openstack_networking_secgroup_rule_v2` diff --git a/docs/rabbitmq.md b/docs/rabbitmq.md new file mode 100644 index 0000000000..f2ce35f9a4 --- /dev/null +++ b/docs/rabbitmq.md @@ -0,0 +1,29 @@ +### Use with RabbitMQ + +Example: + +``` + export RABBITMQ_SERVER_URL=http://foo.bar.localdomain:15672 + export RABBITMQ_USERNAME=[RABBITMQ_USERNAME] + export RABBITMQ_PASSWORD=[RABBITMQ_PASSWORD] + + terraformer import rabbitmq --resources=vhosts,queues,exchanges + terraformer import rabbitmq --resources=vhosts,queues,exchanges --filter=vhost=name1:name2:name3 +``` + +All RabbitMQ resources that are currently supported by the RabbitMQ provider, are also supported by this module. Here is the list of resources which are currently supported by RabbitMQ provider v.1.1.0: + +* `bindings` + * `rabbitmq_binding` +* `exchanges` + * `rabbitmq_exchange` +* `permissions` + * `rabbitmq_permissions` +* `policies` + * `rabbitmq_policy` +* `queues` + * `rabbitmq_queue` +* `users` + * `rabbitmq_user` +* `vhosts` + * `rabbitmq_vhost` diff --git a/docs/relic.md b/docs/relic.md new file mode 100644 index 0000000000..6a47dfa6de --- /dev/null +++ b/docs/relic.md @@ -0,0 +1,21 @@ +### Use with New Relic + +Example: + +``` +./terraformer import newrelic -r alert,dashboard,infra,synthetics --api-key=NRAK-XXXXXXXX --account-id=XXXXX +``` + +List of supported New Relic resources: + +* `alert` + * `newrelic_alert_channel` + * `newrelic_alert_condition` + * `newrelic_alert_policy` +* `dashboard` + * `newrelic_dashboard` +* `infra` + * `newrelic_infra_alert_condition` +* `synthetics` + * `newrelic_synthetics_monitor` + * `newrelic_synthetics_alert_condition` diff --git a/docs/tencentcloud.md b/docs/tencentcloud.md new file mode 100644 index 0000000000..699ec4483a --- /dev/null +++ b/docs/tencentcloud.md @@ -0,0 +1,55 @@ +### Use with TencentCloud + +Example: + +``` +$ export TENCENTCLOUD_SECRET_ID= +$ export TENCENTCLOUD_SECRET_KEY= +$ terraformer import tencentcloud --resources=cvm,cbs --regions=ap-guangzhou +``` + +List of supported TencentCloud services: + +* `as` + * `tencentcloud_as_scaling_group` + * `tencentcloud_as_scaling_config` +* `cbs` + * `tencentcloud_cbs_storage` +* `cdn` + * `tencentcloud_cdn_domain` +* `cfs` + * `tencentcloud_cfs_file_system` +* `clb` + * `tencentcloud_clb_instance` +* `cos` + * `tencentcloud_cos_bucket` +* `cvm` + * `tencentcloud_instance` +* `elasticsearch` + * `tencentcloud_elasticsearch_instance` +* `gaap` + * `tencentcloud_gaap_proxy` + * `tencentcloud_gaap_realserver` +* `key_pair` + * `tencentcloud_key_pair` +* `mongodb` + * `tencentcloud_mongodb_instance` +* `mysql` + * `tencentcloud_mysql_instance` + * `tencentcloud_mysql_readonly_instance` +* `redis` + * `tencentcloud_redis_instance` +* `scf` + * `tencentcloud_scf_function` +* `security_group` + * `tencentcloud_security_group` +* `ssl` + * `tencentcloud_ssl_certificate` +* `subnet` + * `tencentcloud_subnet` +* `tcaplus` + * `tencentcloud_tcaplus_cluster` +* `vpc` + * `tencentcloud_vpc` +* `vpc` + * `tencentcloud_vpn_gateway` diff --git a/docs/vultr.md b/docs/vultr.md new file mode 100644 index 0000000000..0ed659939b --- /dev/null +++ b/docs/vultr.md @@ -0,0 +1,35 @@ +### Use with Vultr + +Example: + +``` +export VULTR_API_KEY=[VULTR_API_KEY] +./terraformer import vultr -r server +``` + +List of supported Vultr resources: + +* `bare_metal_server` + * `vultr_bare_metal_server` +* `block_storage` + * `vultr_block_storage` +* `dns_domain` + * `vultr_dns_domain` + * `vultr_dns_record` +* `firewall_group` + * `vultr_firewall_group` + * `vultr_firewall_rule` +* `network` + * `vultr_network` +* `reserved_ip` + * `vultr_reserved_ip` +* `server` + * `vultr_server` +* `snapshot` + * `vultr_snapshot` +* `ssh_key` + * `vultr_ssh_key` +* `startup_script` + * `vultr_startup_script` +* `user` + * `vultr_user` diff --git a/docs/xen.md b/docs/xen.md new file mode 100644 index 0000000000..7b5d5dd05d --- /dev/null +++ b/docs/xen.md @@ -0,0 +1,16 @@ +### Use with [Xen Orchestra](https://xen-orchestra.com/) + +This provider uses the [terraform-provider-xenorchestra](https://github.com/ddelnano/terraform-provider-xenorchestra). The terraformer provider was built by [Dom Del Nano](https://github.com/ddelnano) on behalf of [Vates SAS](https://vates.fr/) who is sponsoring Dom to work on the project. + +Example: + +``` +## Warning! You should not expose your xenorchestra creds through your bash history. Export them to your shell in a safe way when doing this for real! + +XOA_URL=ws://your-xenorchestra-domain XOA_USER=username XOA_PASSWORD=password terraformer import xenorchestra -r=acl +``` + +List of supported xenorchestra resources: + +* `xenorchestra_acl` +* `xenorchestra_resource_set` diff --git a/docs/yandex.md b/docs/yandex.md new file mode 100644 index 0000000000..01c9d469f7 --- /dev/null +++ b/docs/yandex.md @@ -0,0 +1,23 @@ +### Use with Yandex + +Example: + +``` +export YC_TOKEN=[YANDEX_CLOUD_OAUTH_TOKEN] +export YC_FOLDER_ID=[YANDEX_FOLDER_ID] +./terraformer import yandex -r subnet +``` + +List of supported Yandex resources: + +* `instance` + * `yandex_compute_instance` +* `disk` + * `yandex_compute_disk` +* `subnet` + * `yandex_vpc_subnet` +* `network` + * `yandex_vpc_network` + +Your `tf` and `tfstate` files are written by default to +`generated/yandex/service`. \ No newline at end of file From 87b589d4d3804b9d03dbf70a84e5f010cca1f3d5 Mon Sep 17 00:00:00 2001 From: Mohamed chiheb Ben jemaa Date: Wed, 7 Apr 2021 11:47:31 +0100 Subject: [PATCH 154/276] Split EquinixMetal provider to /docs --- README.md | 2 +- docs/equinixmetal.md | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 docs/equinixmetal.md diff --git a/README.md b/README.md index f86a8b6d14..cd2a461194 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [IBM Cloud](/docs/ibmcloud.md) * Cloud * [DigitalOcean](/docs/digitalocean.md) - * [Equinix Metal](/docs/eq) + * [Equinix Metal](/docs/equinixmetal.md) * [Fastly](/docs/fastly.md) * [Heroku](/docs/heroku.md) * [Linode](/docs/linode.md) diff --git a/docs/equinixmetal.md b/docs/equinixmetal.md new file mode 100644 index 0000000000..2029336537 --- /dev/null +++ b/docs/equinixmetal.md @@ -0,0 +1,20 @@ +### Use with Equinix Metal + +Example: + +``` +export METAL_AUTH_TOKEN=[METAL_AUTH_TOKEN] +export PACKET_PROJECT_ID=[PROJECT_ID] +./terraformer import metal -r volume,device +``` + +List of supported Equinix Metal resources: + +* `device` + * `metal_device` +* `volume` + * `metal_volume` +* `sshkey` + * `metal_ssh_key` +* `spotmarketrequest` + * `metal_spot_market_request` From 7c0dc227dd424030c5d179de5ed547a74afcdecf Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Fri, 9 Apr 2021 00:54:48 -0400 Subject: [PATCH 155/276] Add support for integration_slack_channel resource for Datadog provider (#868) * add slack channels resource * update datadog provider doc * lint * lint --- docs/datadog.md | 11 ++- providers/datadog/datadog_provider.go | 1 + .../datadog/integration_slack_channel.go | 88 +++++++++++++++++++ 3 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 providers/datadog/integration_slack_channel.go diff --git a/docs/datadog.md b/docs/datadog.md index dd91eea2e7..ae20370e02 100644 --- a/docs/datadog.md +++ b/docs/datadog.md @@ -45,9 +45,12 @@ List of supported Datadog services: * `datadog_integration_pagerduty` * `integration_pagerduty_service_object` * `datadog_integration_pagerduty_service_object` +* `integration_slack_channel` + * `datadog_integration_slack_channel` + * **_NOTE:_** Importing resource requires resource ID or `account_name` to be passed via [Filter][1] option * `metric_metadata` * `datadog_metric_metadata` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter][1] option * `monitor` * `datadog_monitor` * `role` @@ -60,15 +63,17 @@ List of supported Datadog services: * `datadog_security_monitoring_rule` * `service_level_objective` * `datadog_service_level_objective` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter][1] option * `synthetics` * `datadog_synthetics_test` * `synthetics_global_variables` * `datadog_synthetics_global_variables` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter](#filtering) option + * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter][1] option * `synthetics_private_location` * `datadog_synthetics_private_location` * `timeboard` * `datadog_timeboard` * `user` * `datadog_user` + +[1]: https://github.com/GoogleCloudPlatform/terraformer/blob/master/README.md#filtering \ No newline at end of file diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 542b91802f..266464228e 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -192,6 +192,7 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "integration_gcp": &IntegrationGCPGenerator{}, "integration_pagerduty": &IntegrationPagerdutyGenerator{}, "integration_pagerduty_service_object": &IntegrationPagerdutyServiceObjectGenerator{}, + "integration_slack_channel": &IntegrationSlackChannelGenerator{}, "metric_metadata": &MetricMetadataGenerator{}, "monitor": &MonitorGenerator{}, "screenboard": &ScreenboardGenerator{}, diff --git a/providers/datadog/integration_slack_channel.go b/providers/datadog/integration_slack_channel.go new file mode 100644 index 0000000000..7f8d6b44d6 --- /dev/null +++ b/providers/datadog/integration_slack_channel.go @@ -0,0 +1,88 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + "log" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // IntegrationSlackChannelAllowEmptyValues ... + IntegrationSlackChannelAllowEmptyValues = []string{} +) + +// IntegrationSlackChannelGenerator ... +type IntegrationSlackChannelGenerator struct { + DatadogService +} + +func (g *IntegrationSlackChannelGenerator) createResources(accountID string, slackChannels []datadogV1.SlackIntegrationChannel) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, slackChannel := range slackChannels { + id := fmt.Sprintf("%s:%s", accountID, slackChannel.GetName()) + resources = append(resources, g.createResource(id)) + } + + return resources +} + +func (g *IntegrationSlackChannelGenerator) createResource(id string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + id, + fmt.Sprintf("integration_slack_channel_%s", id), + "datadog_integration_slack_channel", + "datadog", + IntegrationSlackChannelAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each slack channel create 1 TerraformResource. +func (g *IntegrationSlackChannelGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + resources := []terraformutils.Resource{} + for _, filter := range g.Filter { + if filter.FieldPath == "account_name" && filter.IsApplicable("integration_slack_channel") { + for _, value := range filter.AcceptableValues { + slackChannels, _, err := datadogClientV1.SlackIntegrationApi.GetSlackIntegrationChannels(authV1, value).Execute() + if err != nil { + return err + } + + resources = g.createResources(value, slackChannels) + } + } + if filter.FieldPath == "id" && filter.IsApplicable("integration_slack_channel") { + for _, value := range filter.AcceptableValues { + resources = append(resources, g.createResource(value)) + } + } + } + + if len(resources) == 0 { + log.Print("Filter(account_name or resource id) is required to import datadog_integration_slack_channel resource") + return nil + } + g.Resources = resources + return nil +} From 792325f51c8669ddfd38ee1bf24d495b51e59b7b Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Fri, 9 Apr 2021 16:36:16 -0400 Subject: [PATCH 156/276] Remove filter requirement for Datadog SLO resource (#870) * remove filter requirement for SLO resource * lint --- docs/datadog.md | 1 - providers/datadog/service_level_objective.go | 23 ++++---------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/docs/datadog.md b/docs/datadog.md index ae20370e02..80065b5278 100644 --- a/docs/datadog.md +++ b/docs/datadog.md @@ -63,7 +63,6 @@ List of supported Datadog services: * `datadog_security_monitoring_rule` * `service_level_objective` * `datadog_service_level_objective` - * **_NOTE:_** Importing resource requires resource ID's to be passed via [Filter][1] option * `synthetics` * `datadog_synthetics_test` * `synthetics_global_variables` diff --git a/providers/datadog/service_level_objective.go b/providers/datadog/service_level_objective.go index 46308524b6..45a93a1aae 100644 --- a/providers/datadog/service_level_objective.go +++ b/providers/datadog/service_level_objective.go @@ -17,7 +17,6 @@ package datadog import ( "context" "fmt" - "log" datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" @@ -62,26 +61,12 @@ func (g *ServiceLevelObjectiveGenerator) InitResources() error { authV1 := g.Args["authV1"].(context.Context) var slos []datadogV1.ServiceLevelObjective - for _, filter := range g.Filter { - if filter.FieldPath == "id" && filter.IsApplicable("service_level_objective") { - for _, v := range filter.AcceptableValues { - resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.GetSLO(authV1, v).Execute() - if err != nil { - log.Printf("error retrieving slo id:%s - %s", v, err) - continue - } - - data := resp.GetData() - slos = append(slos, data) - } - } - } - - if len(slos) == 0 { - log.Print("Filter(SLO IDs) is required for importing datadog_service_level_objective resource") - return nil + resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.ListSLOs(authV1).Execute() + if err != nil { + return err } + slos = append(slos, resp.GetData()...) g.Resources = g.createResources(slos) return nil } From 15b167800b9d0c45ad82648f0e03c0f8c005785b Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Fri, 9 Apr 2021 14:20:15 -0700 Subject: [PATCH 157/276] doc: update credential information (#869) This resolves Issue #777 by adding some documentation to the Google Cloud process. --- docs/gcp.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/gcp.md b/docs/gcp.md index ec3c1fd36b..125c8184de 100644 --- a/docs/gcp.md +++ b/docs/gcp.md @@ -1,5 +1,9 @@ ### Use with GCP +In order to access the information from your Google Project, you need to provide authentication credentials +by setting up the environment variable `GOOGLE_APPLICATION_CREDENTIALS` with the file path of the JSON +file that contains your service account key. + [![asciicast](https://asciinema.org/a/243961.svg)](https://asciinema.org/a/243961) Example: From 782096cf76f4f9d067630c3ca7836e65660bab35 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sat, 10 Apr 2021 00:42:39 +0300 Subject: [PATCH 158/276] fix lint (#872) --- .../equinixmetal/equinixmetal_provider.go | 14 ++++++------- providers/equinixmetal/spot_market_request.go | 12 +++++------ providers/equinixmetal/ssh_key.go | 20 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/providers/equinixmetal/equinixmetal_provider.go b/providers/equinixmetal/equinixmetal_provider.go index 64e9f247d1..8d2000ff1e 100644 --- a/providers/equinixmetal/equinixmetal_provider.go +++ b/providers/equinixmetal/equinixmetal_provider.go @@ -23,20 +23,20 @@ import ( type EquinixMetalProvider struct { //nolint terraformutils.Provider - auth_token string - project_id string + authToken string + projectID string } func (p *EquinixMetalProvider) Init(args []string) error { if os.Getenv("PACKET_AUTH_TOKEN") == "" { return errors.New("set PACKET_AUTH_TOKEN env var") } - p.auth_token = os.Getenv("PACKET_AUTH_TOKEN") + p.authToken = os.Getenv("PACKET_AUTH_TOKEN") if os.Getenv("METAL_PROJECT_ID") == "" { return errors.New("set METAL_PROJECT_ID env var") } - p.project_id = os.Getenv("METAL_PROJECT_ID") + p.projectID = os.Getenv("METAL_PROJECT_ID") return nil } @@ -56,7 +56,7 @@ func (EquinixMetalProvider) GetResourceConnections() map[string]map[string][]str func (p *EquinixMetalProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ "device": &DeviceGenerator{}, - "sshkey": &SshKeyGenerator{}, + "sshkey": &SSHKeyGenerator{}, "spotmarketrequest": &SpotMarketRequestGenerator{}, "volume": &VolumeGenerator{}, } @@ -72,8 +72,8 @@ func (p *EquinixMetalProvider) InitService(serviceName string, verbose bool) err p.Service.SetVerbose(verbose) p.Service.SetProviderName(p.GetName()) p.Service.SetArgs(map[string]interface{}{ - "auth_token": p.auth_token, - "project_id": p.project_id, + "auth_token": p.authToken, + "project_id": p.projectID, }) return nil } diff --git a/providers/equinixmetal/spot_market_request.go b/providers/equinixmetal/spot_market_request.go index 7cb7e2c9cf..61f85dddfc 100644 --- a/providers/equinixmetal/spot_market_request.go +++ b/providers/equinixmetal/spot_market_request.go @@ -24,20 +24,20 @@ type SpotMarketRequestGenerator struct { } func (g SpotMarketRequestGenerator) listSpotMarketRequests(client *packngo.Client) ([]packngo.SpotMarketRequest, error) { - spot_market_requests, _, err := client.SpotMarketRequests.List(g.GetArgs()["project_id"].(string), nil) + spotMarketRequests, _, err := client.SpotMarketRequests.List(g.GetArgs()["project_id"].(string), nil) if err != nil { return nil, err } - return spot_market_requests, nil + return spotMarketRequests, nil } -func (g SpotMarketRequestGenerator) createResources(spot_market_requestList []packngo.SpotMarketRequest) []terraformutils.Resource { +func (g SpotMarketRequestGenerator) createResources(spotMarketRequestsList []packngo.SpotMarketRequest) []terraformutils.Resource { var resources []terraformutils.Resource - for _, spot_market_request := range spot_market_requestList { + for _, spotMarketRequests := range spotMarketRequestsList { resources = append(resources, terraformutils.NewSimpleResource( - spot_market_request.ID, - spot_market_request.ID, + spotMarketRequests.ID, + spotMarketRequests.ID, "metal_spot_market_request", "equinixmetal", []string{})) diff --git a/providers/equinixmetal/ssh_key.go b/providers/equinixmetal/ssh_key.go index 623c9b3b74..bc08328bc0 100644 --- a/providers/equinixmetal/ssh_key.go +++ b/providers/equinixmetal/ssh_key.go @@ -19,25 +19,25 @@ import ( "github.com/packethost/packngo" ) -type SshKeyGenerator struct { +type SSHKeyGenerator struct { EquinixMetalService } -func (g SshKeyGenerator) listSshKeys(client *packngo.Client) ([]packngo.SSHKey, error) { - ssh_keys, _, err := client.SSHKeys.List() +func (g SSHKeyGenerator) listSSHKeys(client *packngo.Client) ([]packngo.SSHKey, error) { + sshKeys, _, err := client.SSHKeys.List() if err != nil { return nil, err } - return ssh_keys, nil + return sshKeys, nil } -func (g SshKeyGenerator) createResources(ssh_keyList []packngo.SSHKey) []terraformutils.Resource { +func (g SSHKeyGenerator) createResources(sshLeyList []packngo.SSHKey) []terraformutils.Resource { var resources []terraformutils.Resource - for _, ssh_key := range ssh_keyList { + for _, sshKey := range sshLeyList { resources = append(resources, terraformutils.NewSimpleResource( - ssh_key.ID, - ssh_key.Label, + sshKey.ID, + sshKey.Label, "metal_ssh_key", "equinixmetal", []string{})) @@ -45,9 +45,9 @@ func (g SshKeyGenerator) createResources(ssh_keyList []packngo.SSHKey) []terrafo return resources } -func (g *SshKeyGenerator) InitResources() error { +func (g *SSHKeyGenerator) InitResources() error { client := g.generateClient() - output, err := g.listSshKeys(client) + output, err := g.listSSHKeys(client) if err != nil { return err } From 001f9922dba3246d9b12201e2916eabf476b786d Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sat, 10 Apr 2021 01:01:16 +0300 Subject: [PATCH 159/276] fix release action (#873) --- .github/workflows/codeql-analysis.yml | 68 --------------------------- .github/workflows/release.yaml | 15 +++--- 2 files changed, 8 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 6ac8e0b43e..0000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,68 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# ******** NOTE ******** - -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '20 15 * * 0' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1c2d21e4d9..88042b3d90 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,11 +1,10 @@ name: "tagged-release" -on: - push: - tags: - - "*" +on: workflow_dispatch: - tags: - description: 'Release' + inputs: + version: + description: Bump Version + required: true jobs: tagged-release: name: "Tagged Release" @@ -33,4 +32,6 @@ jobs: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false files: | - terraformer-* \ No newline at end of file + terraformer-* + - name: Create new tag + run: git tag ${{ github.event.inputs.version }} \ No newline at end of file From a90c6cd0438a9315fe1a1d2a1f812c254c2dd7ef Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sat, 10 Apr 2021 13:42:04 +0800 Subject: [PATCH 160/276] Fixed route53 (#875) * #874 fixed route53 listing of records * #874 defaulted page size * #874 added all parameters for pagination * #874 simplified code --- providers/aws/route53.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/providers/aws/route53.go b/providers/aws/route53.go index 508be717ac..5b0ab72194 100644 --- a/providers/aws/route53.go +++ b/providers/aws/route53.go @@ -66,21 +66,18 @@ func (g *Route53Generator) createZonesResources(svc *route53.Client) []terraform func (Route53Generator) createRecordsResources(svc *route53.Client, zoneID string) []terraformutils.Resource { var resources []terraformutils.Resource - var startRecordIdentifier *string var sets *route53.ListResourceRecordSetsOutput var err error listParams := &route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String(zoneID), - StartRecordIdentifier: startRecordIdentifier, + HostedZoneId: aws.String(zoneID), } - sets, err = svc.ListResourceRecordSets(context.TODO(), listParams) - if err != nil { - log.Println(err) - return resources - } - - for sets == nil || sets.NextRecordIdentifier != nil { + for { + sets, err = svc.ListResourceRecordSets(context.TODO(), listParams) + if err != nil { + log.Println(err) + return resources + } for _, record := range sets.ResourceRecordSets { recordName := wildcardUnescape(StringValue(record.Name)) typeString := string(record.Type) @@ -99,6 +96,14 @@ func (Route53Generator) createRecordsResources(svc *route53.Client, zoneID strin route53AdditionalFields, )) } + + if sets.IsTruncated { + listParams.StartRecordName = sets.NextRecordName + listParams.StartRecordType = sets.NextRecordType + listParams.StartRecordIdentifier = sets.NextRecordIdentifier + } else { + break + } } return resources } From 750177b69161a230a9f32faac0c8a51c3344e938 Mon Sep 17 00:00:00 2001 From: Patryk Orwat Date: Sat, 10 Apr 2021 16:35:35 +0800 Subject: [PATCH 161/276] AWS Opswork (#876) * #874 fixed route53 listing of records * #874 defaulted page size * #874 added all parameters for pagination * #874 simplified code * #778 added AWS OpsWorks * #778 linting --- docs/aws.md | 10 ++ go.mod | 3 +- go.sum | 224 +--------------------------------- providers/aws/aws_provider.go | 1 + providers/aws/opsworks.go | 209 +++++++++++++++++++++++++++++++ 5 files changed, 228 insertions(+), 219 deletions(-) create mode 100644 providers/aws/opsworks.go diff --git a/docs/aws.md b/docs/aws.md index cfd6d9e3d7..768a7b1608 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -189,6 +189,16 @@ In that case terraformer will not know with which region resources are associate * `aws_nat_gateway` * `nacl` * `aws_network_acl` +* `opsworks` + * `aws_opsworks_application` + * `aws_opsworks_custom_layer` + * `aws_opsworks_instance` + * `aws_opsworks_java_app_layer` + * `aws_opsworks_php_app_layer` + * `aws_opsworks_rds_db_instance` + * `aws_opsworks_stack` + * `aws_opsworks_static_web_layer` + * `aws_opsworks_user_profile` * `organization` * `aws_organizations_account` * `aws_organizations_organization` diff --git a/go.mod b/go.mod index 5d25adc5f4..8f7bf119ce 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go-v2 v1.3.1 + github.com/aws/aws-sdk-go-v2 v1.3.2 github.com/aws/aws-sdk-go-v2/config v1.1.4 github.com/aws/aws-sdk-go-v2/credentials v1.1.4 github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 @@ -70,6 +70,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/lambda v1.2.1 github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1 github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.4 + github.com/aws/aws-sdk-go-v2/service/opsworks v1.2.2 github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 github.com/aws/aws-sdk-go-v2/service/rds v1.2.1 diff --git a/go.sum b/go.sum index f0afab1f19..dc4be7c960 100644 --- a/go.sum +++ b/go.sum @@ -24,19 +24,15 @@ cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNF cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0 h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/logging v1.1.2 h1:KNALX0NZn8UJhqKnqoHxhMqyoZfBZoh5wF7CQJZ5XrU= cloud.google.com/go/logging v1.1.2/go.mod h1:KrljuAHIw631j9+QXsnq9vDwsrwmdxfGpivMR68M7DY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= @@ -45,7 +41,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.12.0 h1:4y3gHptW1EHVtcPAVE0eBBlFuGqEejTTG3KdIE0lUX4= cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= @@ -90,13 +85,10 @@ github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-api-client-go v1.0.0-beta.18 h1:4i51yRTWm8SEuc9iRxxFicm59jQcAo70v+3ddZhEq8Q= github.com/DataDog/datadog-api-client-go v1.0.0-beta.18/go.mod h1:Gn0fZwIOBbSidO0OaPEh9nO5EmIPsxJrHfHvfVXEaoU= @@ -121,46 +113,32 @@ github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409 h1:DTQ/38ao/CfXsrK0cSAL+h4R/u0VVvfWLZEOlLwEROI= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= -github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= -github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KMJuWmfCkcxl09JwdlqwDZZ6U14= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 h1:fJ4XPqxuZfm11zauw9XX7c30P8xwDyucdWu8H6Htrxs= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 h1:oUQYOKpPm4h7shYEdPJ0T8EzVpu7Zz34qTof9XaMDxY= github.com/aliyun/alibaba-cloud-sdk-go v1.60.295/go.mod h1:mNZkuqaeM5UCiAdkV4r+lrheu8Q5fe/487bRFrGYZ8A= -github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70 h1:FrF4uxA24DF3ARNXVbUin3wa5fDLaB1Cy8mKks/LRz4= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= -github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e h1:ptBAamGVd6CfRsUtyHD+goy2JGhv1QC32v3gqM8mYAM= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= -github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0 h1:JaCC8jz0zdMLk2m+qCCVLLLM/PL93p84w4pK3aJWj60= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= @@ -173,14 +151,10 @@ github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2 github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= -github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171 h1:19Seu/H5gq3Ugtx+CGenwF89SDG3S1REX5i6PJj3RK4= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= @@ -188,7 +162,6 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aslakhellesoy/gox v1.0.100 h1:IP+x+v9Wya7OHP1OmaetTFZkL4OYY2/9t+7Ndc61mMo= github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -196,8 +169,9 @@ github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZve github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go-v2 v1.3.0/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+testmuQeRY= -github.com/aws/aws-sdk-go-v2 v1.3.1 h1:KKstwh6zsuUhQH3GvSor7M3am/+imPqydFOZHzlkTKc= github.com/aws/aws-sdk-go-v2 v1.3.1/go.mod h1:5SmWRTjN6uTRFNCc7rR69xHsdcUJnthmaRHGDsYhpTE= +github.com/aws/aws-sdk-go-v2 v1.3.2 h1:RQj8l98yKUm0UV2Wd3w/Ms+TXV9Rs1E6Kr5tRRMfyU4= +github.com/aws/aws-sdk-go-v2 v1.3.2/go.mod h1:7OaACgj2SX3XGWnrIjGlJM22h6yD6MEWKvm7levnnM8= github.com/aws/aws-sdk-go-v2/config v1.1.4 h1:2hjdDldmJJjb+rFieQySfOFt4WwxKZJVTEB6RBI74T4= github.com/aws/aws-sdk-go-v2/config v1.1.4/go.mod h1:op05ummoVoAqctpA80jVt/+hvEtLfuKmDyx0bIuvfbE= github.com/aws/aws-sdk-go-v2/credentials v1.1.4 h1:whYYw2srG+zUQzUw4LhML83f+xd22Vm7gv0I7aJglc8= @@ -302,6 +276,8 @@ github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1 h1:/NgTgipY3ADAqLp18q1d github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1/go.mod h1:S3JR8Z73bcaBwD1ddXzMcEkR1FFptmmY9pbsmCVWfn0= github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.4 h1:7ho72LnawdmIm8J8KdkLoLWgcsqLcS8oKBDuT3005wg= github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.4/go.mod h1:kXoBJPOMmUdpMEqWUhEPolBoycGzLGUHS5a/mL1+y1k= +github.com/aws/aws-sdk-go-v2/service/opsworks v1.2.2 h1:CMif3Cy79NfLPcYuyYidNdynqeEZCK0i2LTPKB4sMQQ= +github.com/aws/aws-sdk-go-v2/service/opsworks v1.2.2/go.mod h1:elwiAmL4KdGNzNE5HjyxgKBoj7pjOhyOof0KGciJRAg= github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 h1:TvDVD1mBXP60NIHrqbP8uuzTf4vu48HlOm5jtoQQcW0= github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1/go.mod h1:iy7PhC7Wxk3aRePrvaUU7ngXjcAedbTBeKYAYVhnvfI= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 h1:mQUBlaWu2q7RftA5O8psLn2wQTIJAQEX0eIp3dZOtxQ= @@ -345,43 +321,32 @@ github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1/go.mod h1:8k9EEz8LMNPUDEN github.com/aws/aws-sdk-go-v2/service/xray v1.2.1 h1:RiTWbH90tIuJNnZZys9HeqBfpT3oSPulh7fM7anPQiY= github.com/aws/aws-sdk-go-v2/service/xray v1.2.1/go.mod h1:MZS769M8/1Xm4XYQydDJbvugo7dG8fXzsVU3J84QXzY= github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.3.0 h1:awbB2OJBZ/Txj+c4q+qhDQs3Ob0sRhBuIIkOD4Aq8yc= github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= +github.com/aws/smithy-go v1.3.1 h1:xJFO4pK0y9J8fCl34uGsSJX5KNnGbdARDlA5BPhXnwE= +github.com/aws/smithy-go v1.3.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= -github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee h1:BnPxIde0gjtTnc9Er7cxvBk8DHLWhEux0SxayC8dP6I= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= @@ -389,30 +354,20 @@ github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuij github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/gherkin-go/v13 v13.0.0 h1:d09AwPZldyOFlCADAIZQMt7T+VHCrGdp5106+BCIfZU= github.com/cucumber/gherkin-go/v13 v13.0.0/go.mod h1:pzMEPEIPcPOBDkE8HaWC+Ck6eDBtBmIWVksUkSin/2E= @@ -431,7 +386,6 @@ github.com/dghubble/sling v1.1.0 h1:DLu20Bq2qsB9cI5Hldaxj+TMPEaPpPE8IR2kvD22Atg= github.com/dghubble/sling v1.1.0/go.mod h1:ZcPRuLm0qrcULW2gOrjXrAWgf76sahqSyxXyVOvkunE= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.57.0 h1:uCpe0sRIZ/sJWxWDsJyBPBjUfSvxop+WHkHiSf+tjjM= github.com/digitalocean/godo v1.57.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= @@ -440,35 +394,25 @@ github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQ github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 h1:Od9CDqwkw5F3vjN8Lp8CQhkMOEjC70eTW+AJlTepE6g= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884/go.mod h1:SB2lZXXkyipTEoPLxR3A5YglkZ7QwoXSsyI9h6yUeFc= -github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= -github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1 h1:r1oACdS2XYiAWcfF8BJXkoU8l1J71KehGR+d99yWEDA= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 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 h1:EmNYJhPYy0pOFjCx2PrgtaBXmee0iUX9hLlxE1xHOJE= 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 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fastly/go-fastly v1.18.0 h1:fyVq/142VTFz5ZkNE5d57K+NkTmtwxt2K2Mh5sV5scg= github.com/fastly/go-fastly v1.18.0/go.mod h1:fwYSSnZ6zEClwRS65T0f57Yh83Tc4gL12GgttQwJZfA= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90 h1:WXb3TSNmHp2vHoCroCIB1foO/yQ36swABL8aOVeDpgg= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= @@ -479,19 +423,14 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d h1:zQazu3kApPoajWmXj9zFpCNE+UDefwwFRijKjzvHNCM= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786 h1:upeQpV8AFGWxWvlu2LpJojgvWOU2SyiG+XvYerMGaCw= github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= @@ -500,12 +439,9 @@ github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= @@ -513,7 +449,6 @@ github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/Id github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -526,48 +461,35 @@ github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhY github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730 h1:EuqwWLv/LPPjhvFqkeD2bz+FOlvw2DjvDI7vK8GVeyY= github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd h1:hSkbZ9XSyjyBirMeqSqUrK+9HboWrweVlzRNqoBi2d4= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0 h1:31atYa/UW9V5q8vMJ+W6wd64OaaTHUrCUXER358zLM4= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3 h1:3GQ53z7E3o00C/yy7Ko8VXqQXoJGLkrTQCLTF1EjoXU= github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1 h1:iQ0D6SpNXIxu52WESsD+KoQ7af2e3nCfnSBoSF/hKe0= github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211 h1:mSVZ4vj4khv+oThUfS+SQU3UuFIZ5Zo6UNcvK8E8Mz8= github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1 h1:dLg+zb+uOyd/mKeQUYIbwbNmfRsr9hd/WtYWepmayhI= github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2 h1:8thhT+kUJMTMy3HlX4+y9Da+BNJck+p109tqqKp7WDs= github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2 h1:fq9WcL1BYrm36SzK6+aAnZ8hcp+SrmnDyAxhNx8dvJk= github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0 h1:4sGKOD8yaYJ+dek1FDkwcxCHA40M4kfKgFHx8N2kwbU= github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0 h1:Ir9W9XIm9j7bhhkKE9cokvtTl1vBm62A/fene/ZCj6A= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754 h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -576,11 +498,8 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d h1:lBXNCxVENCipq4D1Is42JVOP4eQjlB8TQ6H69Yx5J9Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -613,10 +532,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -653,14 +570,11 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e h1:41CTEDOoUXp+FxbPYuEhth5dE/s+NT1cRuhSoqhBQ1E= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210125172800-10e9aeb4a998/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -672,7 +586,6 @@ github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3i github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.13.0 h1:1XkslZZRm6Ks0bLup+hBNth+KQf+0JA1UeoB7YKw9E8= github.com/gophercloud/gophercloud v0.13.0/go.mod h1:VX0Ibx85B60B5XOrZr6kaNwrmPUzcmMpwxvQ1WQIIWM= -github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01 h1:OgCNGSnEalfkRpn//WGJHhpo7fkP+LhTpvEITZ7CkK4= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -680,30 +593,21 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= -github.com/hashicorp/aws-sdk-go-base v0.4.0 h1:zH9hNUdsS+2G0zJaU85ul8D59BGnZBaKM+KMNPAHGwk= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= -github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089 h1:1eDpXAxTh0iPv+1kc9/gfSI2pxRERDsTk/lNGolwHn8= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= -github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1 h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.10.0 h1:KhjDnQhCqEMKlt4yH00MCevJQPJ6LkHFdSveXINO6vE= github.com/hashicorp/go-azure-helpers v0.10.0/go.mod h1:YuAtHxm2v74s+IjQwUG88dHBJPd5jL+cXr5BGVzSKhE= -github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.0.0-20170211013415-3573b8b52aa7/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -719,10 +623,8 @@ github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v0.5.4 h1:SFT72YqIkOcLdWJUYcriVX7hbrZpwc/f7h8aW2NUqrA= github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -735,18 +637,13 @@ github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6 github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-slug v0.4.1 h1:/jAo8dNuLgSImoLXaX7Od7QB4TfYCVPam+OpAt5bZqc= github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-tfe v0.8.1 h1:J6ulpLaKPHrcnwudRjxvlMYIGzqQFlnPhg3SVFh5N4E= github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnOn8E8stHc= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= @@ -755,10 +652,8 @@ github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -768,15 +663,11 @@ github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggU github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= -github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= -github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= -github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/terraform v0.12.29 h1:UkuApT6qh6KONIT1Jz7HoV8f4B+x71db3bmGcBzjBB0= github.com/hashicorp/terraform v0.12.29/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhkKZNlHPcr4P55U= @@ -787,7 +678,6 @@ github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2 github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/vault v0.10.4 h1:4x0lHxui/ZRp/B3E0Auv1QNBJpzETqHR2kQD3mHSBJU= github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= @@ -796,19 +686,16 @@ github.com/heroku/heroku-go/v5 v5.1.0 h1:3Qx1MxjzczSakhAZN4yRsvCI7kP0ldijK1XvfoY github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZOdlm26Sr73U= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570 h1:scAwHAovDCnGeG+6q16cAYngtzYqgy3q6lSyG42K7oQ= github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570/go.mod h1:4X9u5iNUePRrRDdwjok6skjlQBXTcNfWa4C3uS1+5SQ= github.com/jarcoal/httpmock v1.0.5 h1:cHtVEcTxRSX4J0je7mWPfc9BpDpqzXSJ5HbymZmyHck= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= @@ -827,7 +714,6 @@ github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0 github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= github.com/jonboydell/logzio_client v1.2.0/go.mod h1:ZXJYF4M9/chuG+4fQDS9BN6CqXqokUjtQOjdMqzGC/Y= -github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 h1:kie3qOosvRKqwij2HGzXWffwpXvcqfPPXRUw8I4F/mg= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -839,35 +725,24 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3 h1:lOpSw2vJP0y5eLBW906QwKsUK/fe/QDyoqM5rnnuPDY= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -879,34 +754,24 @@ github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= -github.com/likexian/gokit v0.20.15 h1:DgtIqqTRFqtbiLJFzuRESwVrxWxfs8OlY6hnPYBa3BM= github.com/likexian/gokit v0.20.15/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= -github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b h1:tNa5q0zLsg6EzUI4npXeUYwk/xuTtMcKdVnRsYdOHzk= github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= github.com/linode/linodego v0.24.1 h1:3s7/F54z9XZfefzrFqnHMD9DIEYVyOddPm+gyTEFFzc= github.com/linode/linodego v0.24.1/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= -github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82 h1:wnfcqULT+N2seWf6y4yHzmi7GD2kNx4Ute0qArktD48= github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 h1:JgVTCPf0uBVcUSWpyXmGpgOc62nK5HWUBKAGc3Qqa5k= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9 h1:SmVbOZFWAlyQshuMfOkiAx1f5oUTsOGG5IXplAEYeeM= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b h1:/1RFh2SLCJ+tEnT73+Fh5R2AO89sQqs8ba7o+hx1G0Y= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -922,16 +787,12 @@ github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW1 github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-shellwords v1.0.4 h1:xmZZyxuP+bYKAKkA9ABYXVNJ+G/Wf3R8d8vAP3LDJJk= github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee h1:7Ac2RNGC8DAwDNd5uZyuYLoJOlVXyBGbO1VtFboDamk= github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee/go.mod h1:yd3I5pyIO5TrBH7+Ym94u8qp9xc6NTHAqESeI8kOJY8= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -942,7 +803,6 @@ github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFW github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb h1:GRiLv4rgyqjqzxbhJke65IYUf4NCOOvrPOJbV/sPxkM= github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= @@ -950,20 +810,16 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/panicwrap v1.0.0 h1:67zIyVakCIvcs69A0FGfZjBdPleaonSgGlXRSRlb6fE= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= -github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51 h1:eD92Am0Qf3rqhsOeA1zwBHSfRkoHrt4o6uORamdmJP8= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= @@ -974,19 +830,14 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 h1:TLDEP4t/KAbbIBVqMQlmf0MaLBm0eMAGHKtrOFNGHUM= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409/go.mod h1:q1krA85sGCNuxTOIcH9WSFf4nEO7he+IDDf5SW+xs1s= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d h1:7PxY7LVfSZm7PEeBTyK1rj1gABdCO2mbri6GKO1cMDs= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= @@ -994,16 +845,13 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M= -github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1020,13 +868,10 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/packethost/packngo v0.9.0 h1:dcrJFDNdbW+xCCNzWCmtol1x+hanEZmff5Myv/ku82U= github.com/packethost/packngo v0.9.0/go.mod h1:YrtUNN9IRjjqN6zK+cy2IYoi3EjHfoWTWxJkI1I1Vk0= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paultyng/go-newrelic/v4 v4.10.0 h1:6R2aC3vONWnfxbW00nAYZ9YSj7nJ3IvQRw2rG5KGijY= github.com/paultyng/go-newrelic/v4 v4.10.0/go.mod h1:RmSnSvZnV267IBAqv2/2RACv1YVmxaf+/ujOFS9DRb8= @@ -1035,13 +880,10 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1054,49 +896,35 @@ github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6D github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1104,23 +932,19 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:X github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 h1:j3HKQAXXj5vV3oHyg9pjK3uIM4bidukvv+tR2iJCvFA= github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750/go.mod h1:ZafdZgk/axhT1cvZAPOhw+95nz2I/Ra5qMlU4gTRwIo= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -1129,7 +953,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= -github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1142,9 +965,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible h1:q+D/Y9jla3afgsIihtyhwyl0c2W+eRWNM9ohVwPiiPw= @@ -1152,25 +973,20 @@ github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible/go.mod h1:0PfY github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= github.com/tencentyun/cos-go-sdk-v5 v0.7.19 h1:janAfTO4MglOrUFuKGTQJBuMc66+F7TgtEIt1wPsJ+k= github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= -github.com/terraform-providers/terraform-provider-openstack v1.15.0 h1:adpjqej+F8BAX9dHmuPF47sUIkgifeqBu6p7iCsyj0Y= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y= github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= -github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= @@ -1181,18 +997,12 @@ github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37w github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= -github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc h1:n+nNi93yXLkJvKwXNP9d55HC7lGK4H/SRcwB5IaUZLo= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557 h1:Jpn2j6wHkC9wJv5iMfJhKqrZJx3TahFx+7sbZ7zQdxs= github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 h1:ujojfQqu+1XfDMOVzAcKIJ3pRSF5f3gAmVGxuLcFWn4= github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= @@ -1201,7 +1011,6 @@ github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13/go.mod h1:LEdA github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= @@ -1213,7 +1022,6 @@ github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpUR github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= -go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= @@ -1227,12 +1035,9 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1271,7 +1076,6 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -1286,7 +1090,6 @@ golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= @@ -1430,7 +1233,6 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1443,7 +1245,6 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1523,7 +1324,6 @@ gonum.org/v1/gonum v0.7.0 h1:Hdks0L0hgznZLG9nzXb8vZ0rRvqNvAcgAp84y7Mwkgw= gonum.org/v1/gonum v0.7.0/go.mod h1:L02bwd0sqlsvRv41G7wGWFCsVNZFv/k1xzGIxeANHGM= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1634,18 +1434,14 @@ google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484 h1:gv8e5qO2QJPaYAcGrgu4jex1zo4IlxKxzmUSQ++sufQ= gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484/go.mod h1:H9vSLD4Qlnl3rH2fUT6jyP9qwq1lDo0ikaDqSJo8t/U= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= @@ -1660,7 +1456,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1684,7 +1479,6 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= @@ -1692,22 +1486,16 @@ k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/client-go v0.20.2 h1:uuf+iIAbfnCSw8IGAv/Rg0giM+2bOzHLOsbbrwrdhNQ= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac h1:sAvhNk5RRuc6FNYGqe7Ygz3PSo/2wGWbulskmzRX8Vs= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index 65001ff61f..83a71ad6ec 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -280,6 +280,7 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "msk": &AwsFacade{service: &MskGenerator{}}, "nacl": &AwsFacade{service: &NaclGenerator{}}, "nat": &AwsFacade{service: &NatGatewayGenerator{}}, + "opsworks": &AwsFacade{service: &OpsworksGenerator{}}, "organization": &AwsFacade{service: &OrganizationGenerator{}}, "qldb": &AwsFacade{service: &QLDBGenerator{}}, "rds": &AwsFacade{service: &RDSGenerator{}}, diff --git a/providers/aws/opsworks.go b/providers/aws/opsworks.go new file mode 100644 index 0000000000..8c4ae30e1c --- /dev/null +++ b/providers/aws/opsworks.go @@ -0,0 +1,209 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aws + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/service/opsworks" + "github.com/aws/aws-sdk-go-v2/service/opsworks/types" + "log" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type OpsworksGenerator struct { + AWSService +} + +func (g *OpsworksGenerator) InitResources() error { + config, e := g.generateConfig() + if e != nil { + return e + } + svc := opsworks.NewFromConfig(config) + + e = g.fetchStacks(svc) + if e != nil { + return e + } + + e = g.fetchUserProfile(svc) + if e != nil { + return e + } + + return nil +} + +func (g *OpsworksGenerator) fetchApps(stackID *string, svc *opsworks.Client) error { + apps, err := svc.DescribeApps(context.TODO(), &opsworks.DescribeAppsInput{ + StackId: stackID, + }) + if err != nil { + return err + } + for _, app := range apps.Apps { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(app.AppId), + StringValue(app.AppId), + "aws_opsworks_application", + "aws", + []string{"tags."}, + )) + } + return nil +} + +func (g *OpsworksGenerator) fetchLayers(stackID *string, svc *opsworks.Client) error { + apps, err := svc.DescribeLayers(context.TODO(), &opsworks.DescribeLayersInput{ + StackId: stackID, + }) + if err != nil { + return err + } + for _, layer := range apps.Layers { + switch layer.Type { + case types.LayerTypeCustom: + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(layer.LayerId), + StringValue(layer.LayerId), + "aws_opsworks_custom_layer", + "aws", + []string{"tags."}, + )) + case types.LayerTypePhpApp: + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(layer.LayerId), + StringValue(layer.LayerId), + "aws_opsworks_php_app_layer", + "aws", + []string{"tags."}, + )) + case types.LayerTypeJavaApp: + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(layer.LayerId), + StringValue(layer.LayerId), + "aws_opsworks_java_app_layer", + "aws", + []string{"tags."}, + )) + case types.LayerTypeWeb: + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(layer.LayerId), + StringValue(layer.LayerId), + "aws_opsworks_static_web_layer", + "aws", + []string{"tags."}, + )) + } + } + return nil +} + +func (g *OpsworksGenerator) fetchInstances(stackID *string, svc *opsworks.Client) error { + apps, err := svc.DescribeInstances(context.TODO(), &opsworks.DescribeInstancesInput{ + StackId: stackID, + }) + if err != nil { + return err + } + for _, instances := range apps.Instances { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(instances.InstanceId), + StringValue(instances.InstanceId), + "aws_opsworks_instance", + "aws", + []string{"tags."}, + )) + } + return nil +} +func (g *OpsworksGenerator) fetchRdsInstances(stackID *string, svc *opsworks.Client) error { + apps, err := svc.DescribeRdsDbInstances(context.TODO(), &opsworks.DescribeRdsDbInstancesInput{ + StackId: stackID, + }) + if err != nil { + return err + } + for _, rdsDbInstance := range apps.RdsDbInstances { + g.Resources = append(g.Resources, terraformutils.NewResource( + StringValue(rdsDbInstance.RdsDbInstanceArn), + StringValue(rdsDbInstance.RdsDbInstanceArn), + "aws_opsworks_instance", + "aws", + map[string]string{ + "rds_db_instance_arn": StringValue(rdsDbInstance.RdsDbInstanceArn), + "stack_id": StringValue(stackID), + }, + []string{"tags."}, + map[string]interface{}{}, + )) + } + return nil +} + +func (g *OpsworksGenerator) fetchStacks(svc *opsworks.Client) error { + apps, err := svc.DescribeStacks(context.TODO(), &opsworks.DescribeStacksInput{}) + if err != nil { + return err + } + for _, stack := range apps.Stacks { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(stack.StackId), + StringValue(stack.StackId), + "aws_opsworks_stack", + "aws", + []string{"tags."}, + )) + + e := g.fetchApps(stack.StackId, svc) + if e != nil { + log.Println(err) + } + + e = g.fetchInstances(stack.StackId, svc) + if e != nil { + log.Println(err) + } + + e = g.fetchRdsInstances(stack.StackId, svc) + if e != nil { + log.Println(err) + } + + e = g.fetchLayers(stack.StackId, svc) + if e != nil { + log.Println(err) + } + } + return nil +} + +func (g *OpsworksGenerator) fetchUserProfile(svc *opsworks.Client) error { + apps, err := svc.DescribeUserProfiles(context.TODO(), &opsworks.DescribeUserProfilesInput{}) + if err != nil { + return err + } + for _, userProfile := range apps.UserProfiles { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + StringValue(userProfile.IamUserArn), + StringValue(userProfile.IamUserArn), + "aws_opsworks_user_profile", + "aws", + []string{"tags."}, + )) + } + return nil +} From 172dc60e71483360fd57ca10ea384b80d7e95e8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Apr 2021 10:24:50 +0300 Subject: [PATCH 162/276] Bump github.com/aws/aws-sdk-go-v2/service/cloudfront from 1.2.1 to 1.3.0 (#878) Bumps [github.com/aws/aws-sdk-go-v2/service/cloudfront](https://github.com/aws/aws-sdk-go-v2) from 1.2.1 to 1.3.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.2.1...v1.3.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8f7bf119ce..316dae0e2f 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3 github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0 - github.com/aws/aws-sdk-go-v2/service/cloudfront v1.2.1 + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.3.0 github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.3 github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.2.1 github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0 diff --git a/go.sum b/go.sum index dc4be7c960..0116ab4563 100644 --- a/go.sum +++ b/go.sum @@ -194,8 +194,8 @@ github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 h1:I2V5IX5pwXq/+TL5QeDcoq4MIc github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3/go.mod h1:bT6aHBpfi2TFnyOvBe3IjZkI7cXYaZ0uEErZE1bMABM= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0 h1:+eHZIcEQ7jMuAAWL9uS9RfQz8ElLcRksWqXSIQ7essE= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0/go.mod h1:9PLAEZCkzDVh+/fq7OwOloe/RqSpqwes2x+ozcRyloM= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.2.1 h1:7Zh+ShMr7awq0s76kwca8efPiWOZaWV5267fa6avwOQ= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.2.1/go.mod h1:AlMkBlBn/pyqVYIDcHRkf2FQRm9q0czFdMOMn1SV8oQ= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.3.0 h1:8fOeCj6bb2JtkWvxP6McS4RR/CV20IG4JzZWYz4Z12E= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.3.0/go.mod h1:J04vwlb6n/oVJNtNyT+sLx2KDgzyo7nDRyHPnnZQYnk= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.3 h1:otg0eUT5LROwUixNpOtjhYksgBurDIRi6ykUmsBBrA8= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.1.3/go.mod h1:mtJg2sJe7X8jm/cL/OIxJkPPPGQbHNgQnipZgN6a4MU= github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.2.1 h1:egAyiJ8xpfed+I+8t+71OxyNr4Vbw1xRA+9EjSu15tU= From 72dd0bfe7737be596880e0c855881b41f94ff8a8 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Thu, 15 Apr 2021 03:33:26 +0300 Subject: [PATCH 163/276] add support enterprise github (#871) --- cmd/provider_cmd_github.go | 10 ++++--- docs/github.md | 6 ++-- providers/github/github_provider.go | 26 ++++++++++++------ providers/github/github_service.go | 35 +++++++++++++++++++++++- providers/github/members.go | 11 +++----- providers/github/organizationWebhooks.go | 11 +++----- providers/github/organization_block.go | 11 +++----- providers/github/organization_project.go | 11 +++----- providers/github/repositories.go | 11 +++----- providers/github/teams.go | 11 +++----- providers/github/user_ssh_keys.go | 11 +++----- 11 files changed, 89 insertions(+), 65 deletions(-) diff --git a/cmd/provider_cmd_github.go b/cmd/provider_cmd_github.go index 4c4f7b52ea..42371a2848 100644 --- a/cmd/provider_cmd_github.go +++ b/cmd/provider_cmd_github.go @@ -24,19 +24,20 @@ import ( func newCmdGithubImporter(options ImportOptions) *cobra.Command { token := "" - organizations := []string{} + baseURL := "" + owner := []string{} cmd := &cobra.Command{ Use: "github", Short: "Import current state to Terraform configuration from GitHub", Long: "Import current state to Terraform configuration from GitHub", RunE: func(cmd *cobra.Command, args []string) error { originalPathPattern := options.PathPattern - for _, organization := range organizations { + for _, organization := range owner { provider := newGitHubProvider() options.PathPattern = originalPathPattern options.PathPattern = strings.ReplaceAll(options.PathPattern, "{provider}", "{provider}/"+organization) log.Println(provider.GetName() + " importing organization " + organization) - err := Import(provider, options, []string{organization, token}) + err := Import(provider, options, []string{organization, token, baseURL}) if err != nil { return err } @@ -47,7 +48,8 @@ func newCmdGithubImporter(options ImportOptions) *cobra.Command { cmd.AddCommand(listCmd(newGitHubProvider())) baseProviderFlags(cmd.PersistentFlags(), &options, "repository", "repository=id1:id2:id4") cmd.PersistentFlags().StringVarP(&token, "token", "t", "", "YOUR_GITHUB_TOKEN or env param GITHUB_TOKEN") - cmd.PersistentFlags().StringSliceVarP(&organizations, "organizations", "", []string{}, "") + cmd.PersistentFlags().StringSliceVarP(&owner, "owner", "", []string{}, "") + cmd.PersistentFlags().StringVarP(&baseURL, "base-url", "", "", "") return cmd } diff --git a/docs/github.md b/docs/github.md index 28e4890f7b..40e25bde9e 100644 --- a/docs/github.md +++ b/docs/github.md @@ -3,8 +3,10 @@ Example: ``` - ./terraformer import github --organizations=YOUR_ORGANIZATION --resources=repositories --token=YOUR_TOKEN // or GITHUB_TOKEN in env - ./terraformer import github --organizations=YOUR_ORGANIZATION --resources=repositories --filter=repository=id1:id2:id4 --token=YOUR_TOKEN // or GITHUB_TOKEN in env + ./terraformer import github --owner=YOUR_ORGANIZATION --resources=repositories --token=YOUR_TOKEN // or GITHUB_TOKEN in env + ./terraformer import github --owner=YOUR_ORGANIZATION --resources=repositories --filter=repository=id1:id2:id4 --token=YOUR_TOKEN // or GITHUB_TOKEN in env + + ./terraformer import github --owner=YOUR_ORGANIZATION --resources=repositories --base-url=https://your-enterprise-github-url ``` Supports only organizational resources. List of supported resources: diff --git a/providers/github/github_provider.go b/providers/github/github_provider.go index 46e74b1cf2..c974a3dec2 100644 --- a/providers/github/github_provider.go +++ b/providers/github/github_provider.go @@ -24,8 +24,9 @@ import ( type GithubProvider struct { //nolint terraformutils.Provider - organization string - token string + owner string + token string + baseURL string } func (p GithubProvider) GetResourceConnections() map[string]map[string][]string { @@ -36,7 +37,7 @@ func (p GithubProvider) GetProviderData(arg ...string) map[string]interface{} { return map[string]interface{}{ "provider": map[string]interface{}{ "github": map[string]interface{}{ - "organization": p.organization, + "owner": p.owner, }, }, } @@ -44,14 +45,15 @@ func (p GithubProvider) GetProviderData(arg ...string) map[string]interface{} { func (p *GithubProvider) GetConfig() cty.Value { return cty.ObjectVal(map[string]cty.Value{ - "organization": cty.StringVal(p.organization), - "token": cty.StringVal(p.token), + "owner": cty.StringVal(p.owner), + "token": cty.StringVal(p.token), + "base_url": cty.StringVal(p.baseURL), }) } -// Init GithubProvider with organization +// Init GithubProvider with owner func (p *GithubProvider) Init(args []string) error { - p.organization = args[0] + p.owner = args[0] if len(args) < 2 { if os.Getenv("GITHUB_TOKEN") == "" { return errors.New("token requirement") @@ -60,6 +62,11 @@ func (p *GithubProvider) Init(args []string) error { } else { p.token = args[1] } + if len(args) > 2 { + if args[2] != "" { + p.baseURL = args[2] + } + } return nil } @@ -77,8 +84,9 @@ func (p *GithubProvider) InitService(serviceName string, verbose bool) error { p.Service.SetVerbose(verbose) p.Service.SetProviderName(p.GetName()) p.Service.SetArgs(map[string]interface{}{ - "organization": p.organization, - "token": p.token, + "owner": p.owner, + "token": p.token, + "base_url": p.baseURL, }) return nil } diff --git a/providers/github/github_service.go b/providers/github/github_service.go index 781e2f416f..88a32d77a0 100644 --- a/providers/github/github_service.go +++ b/providers/github/github_service.go @@ -14,8 +14,41 @@ package github -import "github.com/GoogleCloudPlatform/terraformer/terraformutils" +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v25/github" + "golang.org/x/oauth2" +) type GithubService struct { //nolint terraformutils.Service } + +func (g *GithubService) createClient() (*github.Client, error) { + if g.GetArgs()["base_url"].(string) == "" { + return g.createRegularClient(), nil + } + return g.createEnterpriseClient() +} + +func (g *GithubService) createRegularClient() *github.Client { + ctx := context.Background() + ts := oauth2.StaticTokenSource( + &oauth2.Token{AccessToken: g.Args["token"].(string)}, + ) + tc := oauth2.NewClient(ctx, ts) + return githubAPI.NewClient(tc) +} + +func (g *GithubService) createEnterpriseClient() (*github.Client, error) { + ctx := context.Background() + ts := oauth2.StaticTokenSource( + &oauth2.Token{AccessToken: g.Args["token"].(string)}, + ) + tc := oauth2.NewClient(ctx, ts) + baseURL := g.GetArgs()["base_url"].(string) + "/api/v3/" + return githubAPI.NewEnterpriseClient(baseURL, baseURL, tc) +} diff --git a/providers/github/members.go b/providers/github/members.go index a6bc903a3a..ec49265b58 100644 --- a/providers/github/members.go +++ b/providers/github/members.go @@ -21,7 +21,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" githubAPI "github.com/google/go-github/v25/github" - "golang.org/x/oauth2" ) // MembersGenerator holds GithubService struct of Terraform service information @@ -32,12 +31,10 @@ type MembersGenerator struct { // InitResources generates TerraformResources from Github API, func (g *MembersGenerator) InitResources() error { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: g.Args["token"].(string)}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := githubAPI.NewClient(tc) + client, err := g.createClient() + if err != nil { + return err + } opt := &githubAPI.ListMembersOptions{ ListOptions: githubAPI.ListOptions{PerPage: 100}, diff --git a/providers/github/organizationWebhooks.go b/providers/github/organizationWebhooks.go index e5ad848f77..c0e708bf7f 100644 --- a/providers/github/organizationWebhooks.go +++ b/providers/github/organizationWebhooks.go @@ -22,7 +22,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" githubAPI "github.com/google/go-github/v25/github" - "golang.org/x/oauth2" ) type OrganizationWebhooksGenerator struct { @@ -32,12 +31,10 @@ type OrganizationWebhooksGenerator struct { // Generate TerraformResources from Github API, func (g *OrganizationWebhooksGenerator) InitResources() error { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: g.Args["token"].(string)}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := githubAPI.NewClient(tc) + client, err := g.createClient() + if err != nil { + return err + } opt := &githubAPI.ListOptions{PerPage: 100} diff --git a/providers/github/organization_block.go b/providers/github/organization_block.go index 632cdbf152..53e715ed95 100644 --- a/providers/github/organization_block.go +++ b/providers/github/organization_block.go @@ -21,7 +21,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" githubAPI "github.com/google/go-github/v25/github" - "golang.org/x/oauth2" ) type OrganizationBlockGenerator struct { @@ -31,12 +30,10 @@ type OrganizationBlockGenerator struct { // Generate TerraformResources from Github API, func (g *OrganizationBlockGenerator) InitResources() error { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: g.Args["token"].(string)}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := githubAPI.NewClient(tc) + client, err := g.createClient() + if err != nil { + return err + } opt := &githubAPI.ListOptions{PerPage: 100} diff --git a/providers/github/organization_project.go b/providers/github/organization_project.go index 143d765c9c..dfc6f77582 100644 --- a/providers/github/organization_project.go +++ b/providers/github/organization_project.go @@ -22,7 +22,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" githubAPI "github.com/google/go-github/v25/github" - "golang.org/x/oauth2" ) type OrganizationProjectGenerator struct { @@ -32,12 +31,10 @@ type OrganizationProjectGenerator struct { // Generate TerraformResources from Github API, func (g *OrganizationProjectGenerator) InitResources() error { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: g.Args["token"].(string)}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := githubAPI.NewClient(tc) + client, err := g.createClient() + if err != nil { + return err + } opt := &githubAPI.ProjectListOptions{ ListOptions: githubAPI.ListOptions{PerPage: 100}, diff --git a/providers/github/repositories.go b/providers/github/repositories.go index d8d84fd434..7f915ba456 100644 --- a/providers/github/repositories.go +++ b/providers/github/repositories.go @@ -21,7 +21,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" githubAPI "github.com/google/go-github/v25/github" - "golang.org/x/oauth2" ) type RepositoriesGenerator struct { @@ -31,12 +30,10 @@ type RepositoriesGenerator struct { // Generate TerraformResources from github API, func (g *RepositoriesGenerator) InitResources() error { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: g.GetArgs()["token"].(string)}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := githubAPI.NewClient(tc) + client, err := g.createClient() + if err != nil { + return err + } opt := &githubAPI.RepositoryListByOrgOptions{ ListOptions: githubAPI.ListOptions{PerPage: 100}, diff --git a/providers/github/teams.go b/providers/github/teams.go index 142f95f2f4..03ae11efff 100644 --- a/providers/github/teams.go +++ b/providers/github/teams.go @@ -22,7 +22,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" githubAPI "github.com/google/go-github/v25/github" - "golang.org/x/oauth2" ) type TeamsGenerator struct { @@ -86,12 +85,10 @@ func (g *TeamsGenerator) createTeamRepositoriesResources(ctx context.Context, te // InitResources generates TerraformResources from Github API, func (g *TeamsGenerator) InitResources() error { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: g.Args["token"].(string)}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := githubAPI.NewClient(tc) + client, err := g.createClient() + if err != nil { + return err + } opt := &githubAPI.ListOptions{PerPage: 1} diff --git a/providers/github/user_ssh_keys.go b/providers/github/user_ssh_keys.go index 1711935dbd..f37baafa38 100644 --- a/providers/github/user_ssh_keys.go +++ b/providers/github/user_ssh_keys.go @@ -22,7 +22,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" githubAPI "github.com/google/go-github/v25/github" - "golang.org/x/oauth2" ) type UserSSHKeyGenerator struct { @@ -32,12 +31,10 @@ type UserSSHKeyGenerator struct { // Generate TerraformResources from Github API, func (g *UserSSHKeyGenerator) InitResources() error { ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: g.Args["token"].(string)}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := githubAPI.NewClient(tc) + client, err := g.createClient() + if err != nil { + return err + } opt := &githubAPI.ListOptions{PerPage: 100} From afaf8825eb736a122ee9e02cf421969b44ef86a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Apr 2021 03:33:36 +0300 Subject: [PATCH 164/276] Bump cloud.google.com/go/storage from 1.12.0 to 1.14.0 (#879) Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.12.0 to 1.14.0. - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/master/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.12.0...spanner/v1.14.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 31 +++++++++++++------------------ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 316dae0e2f..7408b97201 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( cloud.google.com/go v0.77.0 cloud.google.com/go/logging v1.1.2 - cloud.google.com/go/storage v1.12.0 + cloud.google.com/go/storage v1.14.0 github.com/Azure/azure-sdk-for-go v42.3.0+incompatible github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 @@ -130,11 +130,11 @@ require ( github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 github.com/zclconf/go-cty v1.7.1 github.com/zorkian/go-datadog-api v2.30.0+incompatible - golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 + golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 golang.org/x/text v0.3.5 gonum.org/v1/gonum v0.7.0 google.golang.org/api v0.40.0 - google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d + google.golang.org/genproto v0.0.0-20210226172003-ab064af71705 gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect k8s.io/apimachinery v0.20.2 k8s.io/client-go v0.20.2 diff --git a/go.sum b/go.sum index 0116ab4563..7f343140fc 100644 --- a/go.sum +++ b/go.sum @@ -13,10 +13,10 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.77.0 h1:qA5V5+uQf6Mgr+tmFI8UT3D/ELyhIYkPwNGao/3Y+sQ= cloud.google.com/go v0.77.0/go.mod h1:R8fYSLIilC247Iu8WS2OGHw1E/Ufn7Pd7HiDjTqiURs= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -39,8 +39,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.12.0 h1:4y3gHptW1EHVtcPAVE0eBBlFuGqEejTTG3KdIE0lUX4= -cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho= +cloud.google.com/go/storage v1.14.0 h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= @@ -567,9 +567,9 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210125172800-10e9aeb4a998/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -1140,7 +1140,6 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1148,6 +1147,7 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1158,8 +1158,9 @@ golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 h1:BaN3BAqnopnKjvl+15DYP6LLrbBHfbfmlFYzmFj/Q9Q= golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 h1:5vD4XjIc0X5+kHZjx4UecYdjA6mJo+XXNoaW0EjU5Os= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1222,7 +1223,6 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1231,8 +1231,9 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1301,10 +1302,7 @@ golang.org/x/tools v0.0.0-20200624163319-25775e59acb7/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201030143252-cf7a54d06671/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1312,6 +1310,7 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1341,8 +1340,6 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= -google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= @@ -1387,18 +1384,17 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d h1:Edhcm0CKDPLQIecHCp5Iz57Lo7MfT6zUFBAlocmOjcY= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705 h1:PYBmACG+YEv8uQPW0r1kJj8tR+gkF0UWq7iFdUezwEw= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1415,7 +1411,6 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= From 6e9500bd69bf09caed8515fae4606bd9eeff6b3a Mon Sep 17 00:00:00 2001 From: Mark van Holsteijn Date: Mon, 19 Apr 2021 10:59:31 +0200 Subject: [PATCH 165/276] add apple silicon release binaries (#885) --- .github/workflows/release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 88042b3d90..a54ec6a321 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,8 @@ jobs: run: go build -o terraformer-all-linux-amd64 - name: Build for mac run: GOOS=darwin go build -o terraformer-all-darwin-amd64 + - name: Build for mac Apple Silicon + run: GOOS=darwin GOARCH=arm64 go build -o terraformer-all-darwin-arm64 - name: Build for windows run: GOOS=windows go build -o terraformer-all-windows-amd64 - name: Build for all providers @@ -34,4 +36,4 @@ jobs: files: | terraformer-* - name: Create new tag - run: git tag ${{ github.event.inputs.version }} \ No newline at end of file + run: git tag ${{ github.event.inputs.version }} From 80bfc09c905b1fdbf4ac1dfd10b2a2f9a4a69af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Ag=C3=BCero?= Date: Tue, 20 Apr 2021 11:02:38 -0300 Subject: [PATCH 166/276] Add commercetools custom_object resource (#887) --- docs/commercetools.md | 64 ++++++++++++------- go.mod | 2 +- go.sum | 6 ++ providers/commercetools/api_extension.go | 4 +- providers/commercetools/channel.go | 4 +- .../commercetools/commercetools_provider.go | 1 + providers/commercetools/custom_object.go | 57 +++++++++++++++++ providers/commercetools/product_type.go | 4 +- providers/commercetools/shipping_method.go | 4 +- providers/commercetools/shipping_zone.go | 4 +- providers/commercetools/state.go | 4 +- providers/commercetools/store.go | 4 +- providers/commercetools/subscription.go | 4 +- providers/commercetools/tax_category.go | 4 +- providers/commercetools/types.go | 4 +- 15 files changed, 137 insertions(+), 33 deletions(-) create mode 100644 providers/commercetools/custom_object.go diff --git a/docs/commercetools.md b/docs/commercetools.md index f62fa98dc3..3e2bf9f8e0 100644 --- a/docs/commercetools.md +++ b/docs/commercetools.md @@ -4,30 +4,50 @@ This provider use the [terraform-provider-commercetools](https://github.com/labd Example: +Export required variables: + +```bash +export CTP_PROJECT_KEY=key +export CTP_CLIENT_ID=foo +export CTP_CLIENT_SECRET=bar +export CTP_CLIENT_SCOPE=scope +``` + +Export optional variables in case default values are not appropiate: + +```bash +export CTP_BASE_URL=base_url # default: https://api.sphere.io +export CTP_TOKEN_URL=token_url # default: https://auth.sphere.io ``` -CTP_CLIENT_ID=foo CTP_CLIENT_SCOPE=scope CTP_CLIENT_SECRET=bar CTP_PROJECT_KEY=key ./terraformer plan commercetools -r=types // Only planning -CTP_CLIENT_ID=foo CTP_CLIENT_SCOPE=scope CTP_CLIENT_SECRET=bar CTP_PROJECT_KEY=key ./terraformer import commercetools -r=types // Import commercetools types + +Run terraformer + +```bash +./terraformer plan commercetools -r=types # Only planning +./terraformer import commercetools -r=types # Import commercetools types ``` List of supported [commercetools](https://commercetools.com/de/) resources: -* `api_extension` - * `commercetools_api_extension` -* `channel` - * `commercetools_channel` -* `product_type` - * `commercetools_product_type` -* `shipping_method` - * `commercetools_shipping_method` -* `shipping_zone` - * `commercetools_shipping_zone` -* `state` - * `commercetools_state` -* `store` - * `commercetools_store` -* `subscription` - * `commercetools_subscription` -* `tax_category` - * `commercetools_tax_category` -* `types` - * `commercetools_type` +- `api_extension` + - `commercetools_api_extension` +- `channel` + - `commercetools_channel` +- `custom_object` + - `commercetools_custom_object` +- `product_type` + - `commercetools_product_type` +- `shipping_method` + - `commercetools_shipping_method` +- `shipping_zone` + - `commercetools_shipping_zone` +- `state` + - `commercetools_state` +- `store` + - `commercetools_store` +- `subscription` + - `commercetools_subscription` +- `tax_category` + - `commercetools_tax_category` +- `types` + - `commercetools_type` diff --git a/go.mod b/go.mod index 7408b97201..f07b79fad7 100644 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 - github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d + github.com/labd/commercetools-go-sdk v0.3.1 github.com/linode/linodego v0.24.1 github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/nicksnyder/go-i18n v1.10.1 // indirect diff --git a/go.sum b/go.sum index 7f343140fc..98a7791e9f 100644 --- a/go.sum +++ b/go.sum @@ -152,6 +152,8 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= +github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc h1:LoL75er+LKDHDUfU5tRvFwxH0LjPpZN8OoG8Ll+liGU= +github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc/go.mod h1:w648aMHEgFYS6xb0KVMMtZ2uMeemhiKCuD2vj6gY52A= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -373,6 +375,7 @@ github.com/cucumber/gherkin-go/v13 v13.0.0 h1:d09AwPZldyOFlCADAIZQMt7T+VHCrGdp51 github.com/cucumber/gherkin-go/v13 v13.0.0/go.mod h1:pzMEPEIPcPOBDkE8HaWC+Ck6eDBtBmIWVksUkSin/2E= github.com/cucumber/messages-go/v12 v12.0.0 h1:ZlZYZrYDDc35zCe0HK2y95GUcxHHqr8yB9kdrXCjnzU= github.com/cucumber/messages-go/v12 v12.0.0/go.mod h1:5zuJu21U6rB+BBqyGoQr839a4h4GUElPnSozdHyhCOQ= +github.com/dave/jennifer v1.4.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -752,6 +755,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc33M4Weg78J/fDFsKWTiEsAvriH6x4EHbcR3zus= github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= +github.com/labd/commercetools-go-sdk v0.3.1 h1:Fk8/VKKDSNHhyVhDywJdmzUt3JSpNoFZbHJndwjVBls= +github.com/labd/commercetools-go-sdk v0.3.1/go.mod h1:I+KKNALlg6PcSertsVA7E442koO99GT7gldWqwZlUGo= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -817,6 +822,7 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= diff --git a/providers/commercetools/api_extension.go b/providers/commercetools/api_extension.go index 92833c09fd..5203877447 100644 --- a/providers/commercetools/api_extension.go +++ b/providers/commercetools/api_extension.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *APIExtensionGenerator) InitResources() error { client := cfg.NewClient() - extensions, err := client.ExtensionQuery(&commercetools.QueryInput{}) + extensions, err := client.ExtensionQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/channel.go b/providers/commercetools/channel.go index d898fcb402..22d1d0e9b1 100644 --- a/providers/commercetools/channel.go +++ b/providers/commercetools/channel.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *ChannelGenerator) InitResources() error { client := cfg.NewClient() - channels, err := client.ChannelQuery(&commercetools.QueryInput{}) + channels, err := client.ChannelQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/commercetools_provider.go b/providers/commercetools/commercetools_provider.go index f5a56d9999..6dd6f7de1f 100644 --- a/providers/commercetools/commercetools_provider.go +++ b/providers/commercetools/commercetools_provider.go @@ -77,6 +77,7 @@ func (p *CommercetoolsProvider) GetSupportedService() map[string]terraformutils. return map[string]terraformutils.ServiceGenerator{ "api_extension": &APIExtensionGenerator{}, "channel": &ChannelGenerator{}, + "custom_object": &CustomObjectGenerator{}, "product_type": &ProductTypeGenerator{}, "shipping_zone": &ShippingZoneGenerator{}, "shipping_method": &ShippingMethodGenerator{}, diff --git a/providers/commercetools/custom_object.go b/providers/commercetools/custom_object.go new file mode 100644 index 0000000000..3860e5436e --- /dev/null +++ b/providers/commercetools/custom_object.go @@ -0,0 +1,57 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package commercetools + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/labd/commercetools-go-sdk/commercetools" +) + +type CustomObjectGenerator struct { + CommercetoolsService +} + +// InitResources generates Terraform Resources from Commercetools API +func (g *CustomObjectGenerator) InitResources() error { + cfg := connectivity.Config{ + ClientID: g.GetArgs()["client_id"].(string), + ClientSecret: g.GetArgs()["client_secret"].(string), + ClientScope: g.GetArgs()["client_scope"].(string), + TokenURL: g.GetArgs()["token_url"].(string) + "/oauth/token", + BaseURL: g.GetArgs()["base_url"].(string), + } + + client := cfg.NewClient() + + customObjects, err := client.CustomObjectQuery(context.Background(), &commercetools.QueryInput{}) + if err != nil { + return err + } + for _, customObject := range customObjects.Results { + g.Resources = append(g.Resources, terraformutils.NewResource( + customObject.ID, + customObject.Key, + "commercetools_custom_object", + "commercetools", + map[string]string{}, + []string{}, + map[string]interface{}{}, + )) + } + return nil +} diff --git a/providers/commercetools/product_type.go b/providers/commercetools/product_type.go index 8fa6eb9cba..c752174c91 100644 --- a/providers/commercetools/product_type.go +++ b/providers/commercetools/product_type.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *ProductTypeGenerator) InitResources() error { client := cfg.NewClient() - productTypes, err := client.ProductTypeQuery(&commercetools.QueryInput{}) + productTypes, err := client.ProductTypeQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/shipping_method.go b/providers/commercetools/shipping_method.go index 45d74e63c9..2f99111a14 100644 --- a/providers/commercetools/shipping_method.go +++ b/providers/commercetools/shipping_method.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *ShippingMethodGenerator) InitResources() error { client := cfg.NewClient() - zones, err := client.ShippingMethodQuery(&commercetools.QueryInput{}) + zones, err := client.ShippingMethodQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/shipping_zone.go b/providers/commercetools/shipping_zone.go index 5d9214b7d4..f6e8a8be80 100644 --- a/providers/commercetools/shipping_zone.go +++ b/providers/commercetools/shipping_zone.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *ShippingZoneGenerator) InitResources() error { client := cfg.NewClient() - zones, err := client.ZoneQuery(&commercetools.QueryInput{}) + zones, err := client.ZoneQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/state.go b/providers/commercetools/state.go index d987e327c2..2a7ae8b728 100644 --- a/providers/commercetools/state.go +++ b/providers/commercetools/state.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *StateGenerator) InitResources() error { client := cfg.NewClient() - states, err := client.StateQuery(&commercetools.QueryInput{}) + states, err := client.StateQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/store.go b/providers/commercetools/store.go index 4a88233a5d..ee432ae5ae 100644 --- a/providers/commercetools/store.go +++ b/providers/commercetools/store.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *StoreGenerator) InitResources() error { client := cfg.NewClient() - stores, err := client.StoreQuery(&commercetools.QueryInput{}) + stores, err := client.StoreQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/subscription.go b/providers/commercetools/subscription.go index 0f2308cb47..092a60277b 100644 --- a/providers/commercetools/subscription.go +++ b/providers/commercetools/subscription.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *SubscriptionGenerator) InitResources() error { client := cfg.NewClient() - subscriptions, err := client.SubscriptionQuery(&commercetools.QueryInput{}) + subscriptions, err := client.SubscriptionQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/tax_category.go b/providers/commercetools/tax_category.go index f998933717..1236b264c0 100644 --- a/providers/commercetools/tax_category.go +++ b/providers/commercetools/tax_category.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *TaxCategoryGenerator) InitResources() error { client := cfg.NewClient() - categories, err := client.TaxCategoryQuery(&commercetools.QueryInput{}) + categories, err := client.TaxCategoryQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } diff --git a/providers/commercetools/types.go b/providers/commercetools/types.go index f9db1e386a..a379ff0491 100644 --- a/providers/commercetools/types.go +++ b/providers/commercetools/types.go @@ -15,6 +15,8 @@ package commercetools import ( + "context" + "github.com/GoogleCloudPlatform/terraformer/providers/commercetools/connectivity" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/labd/commercetools-go-sdk/commercetools" @@ -36,7 +38,7 @@ func (g *TypesGenerator) InitResources() error { client := cfg.NewClient() - types, err := client.TypeQuery(&commercetools.QueryInput{}) + types, err := client.TypeQuery(context.Background(), &commercetools.QueryInput{}) if err != nil { return err } From a08ca013f3bf142269e688ffcc2f6a29e2ccfa3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20B=C3=BCcker?= Date: Tue, 20 Apr 2021 16:50:14 +0200 Subject: [PATCH 167/276] Add Grafana provider (#886) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adding grafana provider Co-authored-by: Mark Howard Co-authored-by: Peter Bücker --- README.md | 1 + cmd/provider_cmd_grafana.go | 44 +++++++++ cmd/root.go | 1 + docs/grafana.md | 29 ++++++ go.mod | 2 + go.sum | 4 + providers/grafana/dashboard.go | 67 +++++++++++++ providers/grafana/folder.go | 49 ++++++++++ providers/grafana/grafana_provider.go | 132 ++++++++++++++++++++++++++ providers/grafana/grafana_service.go | 86 +++++++++++++++++ terraformutils/resource.go | 1 + terraformutils/terraformoutput/hcl.go | 16 ++++ terraformutils/walk.go | 3 +- 13 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 cmd/provider_cmd_grafana.go create mode 100644 docs/grafana.md create mode 100644 providers/grafana/dashboard.go create mode 100644 providers/grafana/folder.go create mode 100644 providers/grafana/grafana_provider.go create mode 100644 providers/grafana/grafana_service.go diff --git a/README.md b/README.md index cd2a461194..bc2b914eb0 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [Mikrotik](/docs/mikrotik.md) * [Xen Orchestra](/docs/xen.md) * [GmailFilter](/docs/gmailfilter.md) + * [Grafana](/docs/grafana.md) - [Contributing](#contributing) - [Developing](#developing) - [Infrastructure](#infrastructure) diff --git a/cmd/provider_cmd_grafana.go b/cmd/provider_cmd_grafana.go new file mode 100644 index 0000000000..3c06b90e1f --- /dev/null +++ b/cmd/provider_cmd_grafana.go @@ -0,0 +1,44 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + "github.com/GoogleCloudPlatform/terraformer/providers/grafana" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdGrafanaImporter(options ImportOptions) *cobra.Command { + cmd := &cobra.Command{ + Use: "grafana", + Short: "Import current state to Terraform configuration from Grafana", + Long: "Import current state to Terraform configuration from Grafana", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newGrafanaProvider() + err := Import(provider, options, []string{}) + if err != nil { + return err + } + return nil + }, + } + cmd.AddCommand(listCmd(newGrafanaProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "grafana_dashboard", "dashboard=slug1") + return cmd +} + +func newGrafanaProvider() terraformutils.ProviderGenerator { + return &grafana.GrafanaProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index ade35e2085..605e361534 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -66,6 +66,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command // Monitoring & System Management newCmdDatadogImporter, newCmdNewRelicImporter, + newCmdGrafanaImporter, // Community newCmdKeycloakImporter, newCmdLogzioImporter, diff --git a/docs/grafana.md b/docs/grafana.md new file mode 100644 index 0000000000..149a3dc26f --- /dev/null +++ b/docs/grafana.md @@ -0,0 +1,29 @@ +### Use with [Grafana](https://grafana.com) + +This provider uses the [terraform-provider-grafana](https://registry.terraform.io/providers/grafana/grafana/latest). + +#### Example + +``` +GRAFANA_AUTH=api_token GRAFANA_URL=https://stack.grafana.net ./terraformer import grafana -r=dashboards // Import with Grafana API token +GRAFANA_AUTH=username:password GRAFANA_URL=https://stack.grafana.net ./terraformer import grafana -r=dashboards // Import with HTTP basic auth +``` + +#### Configuration + +| Env variable | Description | Required | Default | +| -------------------------- | -------------------------------------------------------------------- | --- | - | +| GRAFANA_AUTH | API token or HTTP basic auth (if pattern is `username:password`) | yes | - | +| GRAFANA_URL | URL to the Grafana instance, e.g. https://stack.grafana.net | yes | - | +| GRAFANA_ORG_ID | Grafana organisation ID | no | 1 | +| HTTPS_TLS_KEY | Path to TLS key file | no | - | +| HTTPS_TLS_CERT | Path to TLS cert file | no | - | +| HTTPS_CA_CERT | Path to CA cert file | no | - | +| HTTPS_INSECURE_SKIP_VERIFY | Whether to skip TLS certificate validation (1 for true, 0 for false) | no | 0 | + +List of supported [Grafana](https://grafana.com) resources: + +* `dashboard` + * `grafana_dashboard` +* `folder` + * `grafana_folder` diff --git a/go.mod b/go.mod index f07b79fad7..ef43fb2ec5 100644 --- a/go.mod +++ b/go.mod @@ -103,7 +103,9 @@ require ( github.com/fastly/go-fastly v1.18.0 github.com/google/go-github/v25 v25.1.3 github.com/gophercloud/gophercloud v0.13.0 + github.com/grafana/grafana-api-golang-client v0.0.0-20210218192924-9ccd2365d2a6 github.com/hashicorp/go-azure-helpers v0.10.0 + github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-hclog v0.15.0 github.com/hashicorp/go-plugin v1.4.0 github.com/hashicorp/hcl v1.0.0 diff --git a/go.sum b/go.sum index 98a7791e9f..2670022bf0 100644 --- a/go.sum +++ b/go.sum @@ -470,6 +470,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b h1:/vQ+oYKu+JoyaMPDsv5FzwuL2wwWBgBbtj/YLCi4LuA= +github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b/go.mod h1:Xo4aNUOrJnVruqWQJBtW6+bTBDTniY8yZum5rF3b5jw= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -596,6 +598,8 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/grafana-api-golang-client v0.0.0-20210218192924-9ccd2365d2a6 h1:jFAfnEad6JNc0EFbCGxL75m8GoBG/J7/1fAAXseaIf8= +github.com/grafana/grafana-api-golang-client v0.0.0-20210218192924-9ccd2365d2a6/go.mod h1:jFjwT3lvwl4JKqCw3guRJvlQ1/fmhER1h3Zgix3z7jw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= diff --git a/providers/grafana/dashboard.go b/providers/grafana/dashboard.go new file mode 100644 index 0000000000..a40dba018b --- /dev/null +++ b/providers/grafana/dashboard.go @@ -0,0 +1,67 @@ +package grafana + +import ( + "encoding/json" + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + gapi "github.com/grafana/grafana-api-golang-client" +) + +type DashboardGenerator struct { + GrafanaService +} + +func (g *DashboardGenerator) InitResources() error { + client, err := g.buildClient() + if err != nil { + return fmt.Errorf("unable to build grafana client: %v", err) + } + + err = g.createDashboardResources(client) + if err != nil { + return err + } + + return nil +} + +func (g *DashboardGenerator) createDashboardResources(client *gapi.Client) error { + dashboards, err := client.Dashboards() + if err != nil { + return fmt.Errorf("unable to list grafana dashboards: %v", err) + } + + for _, dashboard := range dashboards { + // search result doesn't include slug, so need to look up dashboard. + dash, err := client.DashboardByUID(dashboard.UID) + if err != nil { + return fmt.Errorf("unable to read grafana dashboard %s: %v", dashboard.Title, err) + } + + configJSON, err := json.MarshalIndent(dash.Model, "", " ") + if err != nil { + return fmt.Errorf("unable to marshal configuration for grafana dashboard %s: %v", dashboard.Title, err) + } + + filename := fmt.Sprintf("dashboard-%s.json", dash.Meta.Slug) + resource := terraformutils.NewResource( + dash.Meta.Slug, + dashboard.Title, + "grafana_dashboard", + "grafana", + map[string]string{}, + []string{}, + map[string]interface{}{ + "config_json": fmt.Sprintf("file(\"data/%s\")", filename), + "folder": dashboard.FolderID, + }, + ) + resource.DataFiles = map[string][]byte{ + filename: configJSON, + } + g.Resources = append(g.Resources, resource) + } + + return nil +} diff --git a/providers/grafana/folder.go b/providers/grafana/folder.go new file mode 100644 index 0000000000..4ccb5cc4d2 --- /dev/null +++ b/providers/grafana/folder.go @@ -0,0 +1,49 @@ +package grafana + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + gapi "github.com/grafana/grafana-api-golang-client" +) + +type FolderGenerator struct { + GrafanaService +} + +func (g *FolderGenerator) InitResources() error { + client, err := g.buildClient() + if err != nil { + return fmt.Errorf("unable to build grafana client: %v", err) + } + + err = g.createFolderResources(client) + if err != nil { + return err + } + + return nil +} + +func (g *FolderGenerator) createFolderResources(client *gapi.Client) error { + folders, err := client.Folders() + if err != nil { + return fmt.Errorf("unable to list grafana folders: %v", err) + } + + for _, folder := range folders { + g.Resources = append(g.Resources, terraformutils.NewResource( + fmt.Sprint(folder.ID), + folder.Title, + "grafana_folder", + "grafana", + map[string]string{ + "uid": folder.UID, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return nil +} diff --git a/providers/grafana/grafana_provider.go b/providers/grafana/grafana_provider.go new file mode 100644 index 0000000000..273997ce9e --- /dev/null +++ b/providers/grafana/grafana_provider.go @@ -0,0 +1,132 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package grafana + +import ( + "os" + "strconv" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/pkg/errors" + "github.com/zclconf/go-cty/cty" +) + +type GrafanaProvider struct { //nolint + terraformutils.Provider + auth string + url string + orgID int + tlsKey string + tlsCert string + caCert string + insecureSkipVerify bool +} + +func (p GrafanaProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{ + "grafana_dashboard": { + "grafana_folder": []string{"folder", "id"}, + }, + } +} + +func (p GrafanaProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{ + "provider": map[string]interface{}{ + "grafana": map[string]interface{}{ + "org_id": p.orgID, + "url": p.url, + "auth": p.auth, + "tls_key": p.tlsKey, + "tls_cert": p.tlsCert, + "ca_cert": p.caCert, + "insecure_skip_verify": p.insecureSkipVerify, + }, + }, + } +} + +func (p *GrafanaProvider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "org_id": cty.NumberIntVal(int64(p.orgID)), + "url": cty.StringVal(p.url), + "auth": cty.StringVal(p.auth), + "tls_key": cty.StringVal(p.tlsKey), + "tls_cert": cty.StringVal(p.tlsCert), + "ca_cert": cty.StringVal(p.caCert), + "insecure_skip_verify": cty.BoolVal(p.insecureSkipVerify), + }) +} + +func (p *GrafanaProvider) Init(args []string) error { + p.auth = os.Getenv("GRAFANA_AUTH") + if p.auth == "" { + return errors.New("Grafana API authentication must be set through `GRAFANA_AUTH` env var, either as an API token or as username:password for HTTP basic auth") + } + + p.url = os.Getenv("GRAFANA_URL") + if p.url == "" { + return errors.New("Grafana API URL must be set through `GRAFANA_URL` env var") + } + + orgID, err := strconv.Atoi(os.Getenv("GRAFANA_ORG_ID")) + if err != nil { + orgID = 1 + } + p.orgID = orgID + + p.tlsKey = os.Getenv("HTTPS_TLS_KEY") + p.tlsCert = os.Getenv("HTTPS_TLS_CERT") + p.caCert = os.Getenv("HTTPS_CA_CERT") + + if os.Getenv("HTTPS_INSECURE_SKIP_VERIFY") == "1" { + p.insecureSkipVerify = true + } + + return nil +} + +func (p *GrafanaProvider) GetName() string { + return "grafana" +} + +func (p *GrafanaProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New(p.GetName() + ": " + serviceName + " not supported service") + } + + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "org_id": p.orgID, + "url": p.url, + "auth": p.auth, + "tls_key": p.tlsKey, + "tls_cert": p.tlsCert, + "ca_cert": p.caCert, + "insecure_skip_verify": p.insecureSkipVerify, + }) + return nil +} + +func (p *GrafanaProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "grafana_dashboard": &DashboardGenerator{}, + "grafana_folder": &FolderGenerator{}, + } +} diff --git a/providers/grafana/grafana_service.go b/providers/grafana/grafana_service.go new file mode 100644 index 0000000000..8ceff5866f --- /dev/null +++ b/providers/grafana/grafana_service.go @@ -0,0 +1,86 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package grafana + +import ( + "crypto/tls" + "crypto/x509" + "io/ioutil" + "net/url" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + gapi "github.com/grafana/grafana-api-golang-client" + "github.com/hashicorp/go-cleanhttp" + "github.com/hashicorp/terraform/helper/logging" +) + +type GrafanaService struct { //nolint + terraformutils.Service +} + +func (s *GrafanaService) buildClient() (*gapi.Client, error) { + auth := strings.SplitN(s.Args["auth"].(string), ":", 2) + cli := cleanhttp.DefaultClient() + transport := cleanhttp.DefaultTransport() + transport.TLSClientConfig = &tls.Config{} + + // TLS Config + tlsKey := s.Args["tls_key"].(string) + tlsCert := s.Args["tls_cert"].(string) + caCert := s.Args["ca_cert"].(string) + insecure := s.Args["insecure_skip_verify"].(bool) + + if caCert != "" { + ca, err := ioutil.ReadFile(caCert) + if err != nil { + return nil, err + } + pool := x509.NewCertPool() + pool.AppendCertsFromPEM(ca) + transport.TLSClientConfig.RootCAs = pool + } + + if tlsKey != "" && tlsCert != "" { + cert, err := tls.LoadX509KeyPair(tlsCert, tlsKey) + if err != nil { + return nil, err + } + transport.TLSClientConfig.Certificates = []tls.Certificate{cert} + } + + if insecure { + transport.TLSClientConfig.InsecureSkipVerify = true + } + + cli.Transport = logging.NewTransport("Grafana", transport) + cfg := gapi.Config{ + Client: cli, + OrgID: int64(s.Args["org_id"].(int)), + } + + if len(auth) == 2 { + cfg.BasicAuth = url.UserPassword(auth[0], auth[1]) + } else { + cfg.APIKey = auth[0] + } + + client, err := gapi.New(s.Args["url"].(string), cfg) + if err != nil { + return nil, err + } + + return client, nil +} diff --git a/terraformutils/resource.go b/terraformutils/resource.go index 9af1de944f..04766a694b 100644 --- a/terraformutils/resource.go +++ b/terraformutils/resource.go @@ -37,6 +37,7 @@ type Resource struct { AllowEmptyValues []string `json:",omitempty"` AdditionalFields map[string]interface{} `json:",omitempty"` SlowQueryRequired bool + DataFiles map[string][]byte } type ApplicableFilter interface { diff --git a/terraformutils/terraformoutput/hcl.go b/terraformutils/terraformoutput/hcl.go index de03ec3b5b..abdd3578a2 100644 --- a/terraformutils/terraformoutput/hcl.go +++ b/terraformutils/terraformoutput/hcl.go @@ -112,6 +112,21 @@ func OutputHclFiles(resources []terraformutils.Resource, provider terraformutils } func printFile(v []terraformutils.Resource, fileName, path, output string) error { + for _, res := range v { + if res.DataFiles == nil { + continue + } + for fileName, content := range res.DataFiles { + if err := os.MkdirAll(path+"/data/", os.ModePerm); err != nil { + return err + } + err := ioutil.WriteFile(path+"/data/"+fileName, content, os.ModePerm) + if err != nil { + return err + } + } + } + tfFile, err := terraformutils.HclPrintResource(v, map[string]interface{}{}, output) if err != nil { return err @@ -120,6 +135,7 @@ func printFile(v []terraformutils.Resource, fileName, path, output string) error if err != nil { return err } + return nil } diff --git a/terraformutils/walk.go b/terraformutils/walk.go index 214262e557..f4382cd7dd 100644 --- a/terraformutils/walk.go +++ b/terraformutils/walk.go @@ -15,6 +15,7 @@ package terraformutils import ( + "fmt" "reflect" "strings" ) @@ -109,7 +110,7 @@ func walkAndOverride(pathSegments []string, oldValue, newValue string, data inte valss[idx] = newValue } } - case oldValue == v.Interface().(string): + case oldValue == fmt.Sprint(v.Interface()): val.Interface().(map[string]interface{})[pathSegments[0]] = newValue } } From 207b4384b870c69cefe72a47cf5e4c9585f92538 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 17:50:29 +0300 Subject: [PATCH 168/276] Bump github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs (#883) Bumps [github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs](https://github.com/aws/aws-sdk-go-v2) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.2.1...service/pi/v1.2.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ef43fb2ec5..d0b69f9741 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.2.1 github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0 github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0 - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.1 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.2 github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1 github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.3 github.com/aws/aws-sdk-go-v2/service/codedeploy v1.2.1 diff --git a/go.sum b/go.sum index 2670022bf0..13cdc8cc95 100644 --- a/go.sum +++ b/go.sum @@ -206,8 +206,8 @@ github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0 h1:fyDRD5nYw4WlTQpX7p5Mjt github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0/go.mod h1:2qNhOhvtzQHNKkwipEb/n95O4pAfJy4ObXv0n+Ldkn8= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0 h1:gXHyajuXD6lC4iaznrJcFzxOyg0E7f94MpRKmJ4hwvU= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0/go.mod h1:oqhgyu/GPZZpma8mHoiUhqSwx2gSlxjccE9Lny3RR2g= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.1 h1:WWUXM0mAA5ktH0Z3lM75sCg0R0BI6piPShKad3+vwzA= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.1/go.mod h1:iSmaYEKTakAa/tT8Kal8gh14QUXNx+7/lHRjM7naTR0= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.2 h1:n0upYlo6IRQI7WwoThLTDziit6r4zo2oWNB8AY28rdE= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.2/go.mod h1:d7EGzmjLiXW+mk2OnkanXsrGQ6PuPRwouhxLjjRbO30= github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1 h1:Kn8KgAStqC7/FMP927qsWUUQJH9gw/ubKTuMqyKUpds= github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1/go.mod h1:n5wJZmnZAZxSQDf7CnNpyTCOP9cjTGsmH1xkCs8Giy4= github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.3 h1:Fw5BXP0L4PNdneYOv0B2znzErlgj70QNEc7HIjwJrUs= From 9a8e0e49e319f67d9cb88d162e1824cd03511dab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 17:50:40 +0300 Subject: [PATCH 169/276] Bump github.com/aws/aws-sdk-go-v2/service/kms from 1.2.1 to 1.2.2 (#882) Bumps [github.com/aws/aws-sdk-go-v2/service/kms](https://github.com/aws/aws-sdk-go-v2) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.2.1...service/pi/v1.2.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d0b69f9741..b4e41dd7b7 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/iot v1.2.0 github.com/aws/aws-sdk-go-v2/service/kafka v1.2.1 github.com/aws/aws-sdk-go-v2/service/kinesis v1.2.1 - github.com/aws/aws-sdk-go-v2/service/kms v1.2.1 + github.com/aws/aws-sdk-go-v2/service/kms v1.2.2 github.com/aws/aws-sdk-go-v2/service/lambda v1.2.1 github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1 github.com/aws/aws-sdk-go-v2/service/mediastore v1.1.4 diff --git a/go.sum b/go.sum index 13cdc8cc95..2108156f34 100644 --- a/go.sum +++ b/go.sum @@ -270,8 +270,8 @@ github.com/aws/aws-sdk-go-v2/service/kafka v1.2.1 h1:70IRtg4hU1mQ5aAtjEHPQR+KCeV github.com/aws/aws-sdk-go-v2/service/kafka v1.2.1/go.mod h1:2gy+VDVpxUvxQRdjpFlZNhXSjybrxnYrb9Byuzz855I= github.com/aws/aws-sdk-go-v2/service/kinesis v1.2.1 h1:MXy6AyLlbBYypXEsmK94l9yGjKKtxNaD/jFzVVOsnYQ= github.com/aws/aws-sdk-go-v2/service/kinesis v1.2.1/go.mod h1:ZdVDeEkxSDTPYDtb8kVxXzyOSBkAQVXCA9fanM45a/c= -github.com/aws/aws-sdk-go-v2/service/kms v1.2.1 h1:X77wgZdglt2hU9zZS3DufyJiR4ZGW4F5x72OauDMSsM= -github.com/aws/aws-sdk-go-v2/service/kms v1.2.1/go.mod h1:VJL8/fcYPX11A7hdOPAXtzU6+yDifhKW5MgwaA6HIwY= +github.com/aws/aws-sdk-go-v2/service/kms v1.2.2 h1:9CJBrElBVX699f4ugbwsD2EPyHYWEdf9rGZZJwDzPSU= +github.com/aws/aws-sdk-go-v2/service/kms v1.2.2/go.mod h1:aDkYNnoS4NikbSA7AiTomko1eJIZgrIG0ZE0yPJRn+w= github.com/aws/aws-sdk-go-v2/service/lambda v1.2.1 h1:U1AhnZgIHWCh6kIXuq6RkTptzU6szpDHjRbrA7g+99s= github.com/aws/aws-sdk-go-v2/service/lambda v1.2.1/go.mod h1:lczLef9EKYeQQ23eksYHU/Qf8j+66FSlX+g+15ZEP+k= github.com/aws/aws-sdk-go-v2/service/mediapackage v1.2.1 h1:/NgTgipY3ADAqLp18q1dDomqHYULUrcD3v3XGdqIhT8= From 02fa858cf50519ed783fe0f92304db99d2a45c9c Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Tue, 20 Apr 2021 20:07:48 +0300 Subject: [PATCH 170/276] Update version.go (#888) --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index ffcd02560e..aff3f35b8e 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.12" +const version = "v0.8.13" var versionCmd = &cobra.Command{ Use: "version", From 0d626aa63cbe41030f406b8de4f8e4211c287259 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Tue, 20 Apr 2021 21:47:26 +0300 Subject: [PATCH 171/276] Update release.yaml (#889) --- .github/workflows/release.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a54ec6a321..1bf4669159 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,8 +32,7 @@ jobs: - uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ github.event.inputs.version }} prerelease: false files: | terraformer-* - - name: Create new tag - run: git tag ${{ github.event.inputs.version }} From a7b7798456817123a7ef9c37d1b369cf9d3a4587 Mon Sep 17 00:00:00 2001 From: Jeffrey <61218880+plan-do-break-fix@users.noreply.github.com> Date: Sun, 25 Apr 2021 01:07:30 -0500 Subject: [PATCH 172/276] fix(docs): corrects typo in project documentation (#892) --- docs/commercetools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/commercetools.md b/docs/commercetools.md index 3e2bf9f8e0..eebdea5eb2 100644 --- a/docs/commercetools.md +++ b/docs/commercetools.md @@ -13,7 +13,7 @@ export CTP_CLIENT_SECRET=bar export CTP_CLIENT_SCOPE=scope ``` -Export optional variables in case default values are not appropiate: +Export optional variables in case default values are not appropriate: ```bash export CTP_BASE_URL=base_url # default: https://api.sphere.io From 767f22a336f0cba1c641b4da24967fdc2a1013cb Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Sun, 25 Apr 2021 09:21:23 +0300 Subject: [PATCH 173/276] fix github provider (#894) --- providers/github/members.go | 4 ++-- providers/github/organizationWebhooks.go | 2 +- providers/github/organization_block.go | 2 +- providers/github/organization_project.go | 2 +- providers/github/repositories.go | 10 +++++----- providers/github/teams.go | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/providers/github/members.go b/providers/github/members.go index ec49265b58..8c9ae8586f 100644 --- a/providers/github/members.go +++ b/providers/github/members.go @@ -42,7 +42,7 @@ func (g *MembersGenerator) InitResources() error { // List all organization members for the authenticated user for { - members, resp, err := client.Organizations.ListMembers(ctx, g.Args["organization"].(string), opt) + members, resp, err := client.Organizations.ListMembers(ctx, g.Args["owner"].(string), opt) if err != nil { log.Println(err) return nil @@ -50,7 +50,7 @@ func (g *MembersGenerator) InitResources() error { for _, member := range members { resource := terraformutils.NewSimpleResource( - g.Args["organization"].(string)+":"+member.GetLogin(), + g.Args["owner"].(string)+":"+member.GetLogin(), member.GetLogin(), "github_membership", "github", diff --git a/providers/github/organizationWebhooks.go b/providers/github/organizationWebhooks.go index c0e708bf7f..c873471402 100644 --- a/providers/github/organizationWebhooks.go +++ b/providers/github/organizationWebhooks.go @@ -40,7 +40,7 @@ func (g *OrganizationWebhooksGenerator) InitResources() error { // List all organization hooks for the authenticated user for { - hooks, resp, err := client.Organizations.ListHooks(ctx, g.Args["organization"].(string), opt) + hooks, resp, err := client.Organizations.ListHooks(ctx, g.Args["owner"].(string), opt) if err != nil { log.Println(err) return nil diff --git a/providers/github/organization_block.go b/providers/github/organization_block.go index 53e715ed95..2f3aa3699c 100644 --- a/providers/github/organization_block.go +++ b/providers/github/organization_block.go @@ -39,7 +39,7 @@ func (g *OrganizationBlockGenerator) InitResources() error { // List all organization blocks for the authenticated user for { - blocks, resp, err := client.Organizations.ListBlockedUsers(ctx, g.Args["organization"].(string), opt) + blocks, resp, err := client.Organizations.ListBlockedUsers(ctx, g.Args["owner"].(string), opt) if err != nil { log.Println(err) return nil diff --git a/providers/github/organization_project.go b/providers/github/organization_project.go index dfc6f77582..771cc968e4 100644 --- a/providers/github/organization_project.go +++ b/providers/github/organization_project.go @@ -42,7 +42,7 @@ func (g *OrganizationProjectGenerator) InitResources() error { // List all organization projects for the authenticated user for { - projects, resp, err := client.Organizations.ListProjects(ctx, g.Args["organization"].(string), opt) + projects, resp, err := client.Organizations.ListProjects(ctx, g.Args["owner"].(string), opt) if err != nil { log.Println(err) return nil diff --git a/providers/github/repositories.go b/providers/github/repositories.go index 7f915ba456..f4a19f7001 100644 --- a/providers/github/repositories.go +++ b/providers/github/repositories.go @@ -40,7 +40,7 @@ func (g *RepositoriesGenerator) InitResources() error { } // list all repositories for the authenticated user for { - repos, resp, err := client.Repositories.ListByOrg(ctx, g.GetArgs()["organization"].(string), opt) + repos, resp, err := client.Repositories.ListByOrg(ctx, g.GetArgs()["owner"].(string), opt) if err != nil { log.Println(err) return nil @@ -72,7 +72,7 @@ func (g *RepositoriesGenerator) InitResources() error { func (g *RepositoriesGenerator) createRepositoryWebhookResources(ctx context.Context, client *githubAPI.Client, repo *githubAPI.Repository) []terraformutils.Resource { resources := []terraformutils.Resource{} - hooks, _, err := client.Repositories.ListHooks(ctx, g.GetArgs()["organization"].(string), repo.GetName(), nil) + hooks, _, err := client.Repositories.ListHooks(ctx, g.GetArgs()["owner"].(string), repo.GetName(), nil) if err != nil { log.Println(err) } @@ -94,7 +94,7 @@ func (g *RepositoriesGenerator) createRepositoryWebhookResources(ctx context.Con func (g *RepositoriesGenerator) createRepositoryBranchProtectionResources(ctx context.Context, client *githubAPI.Client, repo *githubAPI.Repository) []terraformutils.Resource { resources := []terraformutils.Resource{} - branches, _, err := client.Repositories.ListBranches(ctx, g.GetArgs()["organization"].(string), repo.GetName(), nil) + branches, _, err := client.Repositories.ListBranches(ctx, g.GetArgs()["owner"].(string), repo.GetName(), nil) if err != nil { log.Println(err) } @@ -114,7 +114,7 @@ func (g *RepositoriesGenerator) createRepositoryBranchProtectionResources(ctx co func (g *RepositoriesGenerator) createRepositoryCollaboratorResources(ctx context.Context, client *githubAPI.Client, repo *githubAPI.Repository) []terraformutils.Resource { resources := []terraformutils.Resource{} - collaborators, _, err := client.Repositories.ListCollaborators(ctx, g.GetArgs()["organization"].(string), repo.GetName(), nil) + collaborators, _, err := client.Repositories.ListCollaborators(ctx, g.GetArgs()["owner"].(string), repo.GetName(), nil) if err != nil { log.Println(err) } @@ -132,7 +132,7 @@ func (g *RepositoriesGenerator) createRepositoryCollaboratorResources(ctx contex func (g *RepositoriesGenerator) createRepositoryDeployKeyResources(ctx context.Context, client *githubAPI.Client, repo *githubAPI.Repository) []terraformutils.Resource { resources := []terraformutils.Resource{} - deployKeys, _, err := client.Repositories.ListKeys(ctx, g.GetArgs()["organization"].(string), repo.GetName(), nil) + deployKeys, _, err := client.Repositories.ListKeys(ctx, g.GetArgs()["owner"].(string), repo.GetName(), nil) if err != nil { log.Println(err) } diff --git a/providers/github/teams.go b/providers/github/teams.go index 03ae11efff..4936ebf049 100644 --- a/providers/github/teams.go +++ b/providers/github/teams.go @@ -93,7 +93,7 @@ func (g *TeamsGenerator) InitResources() error { opt := &githubAPI.ListOptions{PerPage: 1} for { - teams, resp, err := client.Teams.ListTeams(ctx, g.Args["organization"].(string), opt) + teams, resp, err := client.Teams.ListTeams(ctx, g.Args["owner"].(string), opt) if err != nil { log.Println(err) return nil From 2d77de6476ffcfa3bc6b93ff28d043ecb45d528a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Apr 2021 18:15:02 +0300 Subject: [PATCH 174/276] Bump github.com/gophercloud/gophercloud from 0.13.0 to 0.17.0 (#896) Bumps [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) from 0.13.0 to 0.17.0. - [Release notes](https://github.com/gophercloud/gophercloud/releases) - [Changelog](https://github.com/gophercloud/gophercloud/blob/master/CHANGELOG.md) - [Commits](https://github.com/gophercloud/gophercloud/compare/v0.13.0...v0.17.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index b4e41dd7b7..fd0d97ce9a 100644 --- a/go.mod +++ b/go.mod @@ -102,7 +102,7 @@ require ( github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/fastly/go-fastly v1.18.0 github.com/google/go-github/v25 v25.1.3 - github.com/gophercloud/gophercloud v0.13.0 + github.com/gophercloud/gophercloud v0.17.0 github.com/grafana/grafana-api-golang-client v0.0.0-20210218192924-9ccd2365d2a6 github.com/hashicorp/go-azure-helpers v0.10.0 github.com/hashicorp/go-cleanhttp v0.5.1 diff --git a/go.sum b/go.sum index 2108156f34..f445dd3ca1 100644 --- a/go.sum +++ b/go.sum @@ -589,8 +589,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gophercloud/gophercloud v0.13.0 h1:1XkslZZRm6Ks0bLup+hBNth+KQf+0JA1UeoB7YKw9E8= -github.com/gophercloud/gophercloud v0.13.0/go.mod h1:VX0Ibx85B60B5XOrZr6kaNwrmPUzcmMpwxvQ1WQIIWM= +github.com/gophercloud/gophercloud v0.17.0 h1:BgVw0saxyeHWH5us/SQe1ltp0GRnytjmOLXDA8pO77E= +github.com/gophercloud/gophercloud v0.17.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -746,9 +746,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -757,8 +756,6 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d h1:wI9Pc33M4Weg78J/fDFsKWTiEsAvriH6x4EHbcR3zus= -github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d/go.mod h1:uOXGd793oxD6CZiPp30hzs4L511bcYSF0yPu17LBqAo= github.com/labd/commercetools-go-sdk v0.3.1 h1:Fk8/VKKDSNHhyVhDywJdmzUt3JSpNoFZbHJndwjVBls= github.com/labd/commercetools-go-sdk v0.3.1/go.mod h1:I+KKNALlg6PcSertsVA7E442koO99GT7gldWqwZlUGo= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= @@ -1063,13 +1060,13 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1214,8 +1211,8 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1244,6 +1241,8 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From e31a0f68a8fc8be9385d0c615d924bd95bd50b2d Mon Sep 17 00:00:00 2001 From: David Jenniex Date: Tue, 27 Apr 2021 09:32:32 -0600 Subject: [PATCH 175/276] Add PagerDuty Provider (#899) * Add PagerDuty Provider * Add PagerDuty Provider Co-authored-by: David Jenniex --- README.md | 6 +- cmd/provider_cmd_pagerduty.go | 47 +++++++++ cmd/root.go | 2 + docs/pagerduty.md | 28 ++++++ go.mod | 1 + go.sum | 2 + providers/pagerduty/business_service.go | 63 ++++++++++++ providers/pagerduty/escalation_policy.go | 73 ++++++++++++++ providers/pagerduty/pagerduty_provider.go | 89 +++++++++++++++++ providers/pagerduty/pagerduty_service.go | 32 ++++++ providers/pagerduty/ruleset.go | 89 +++++++++++++++++ providers/pagerduty/schedule.go | 75 ++++++++++++++ providers/pagerduty/service.go | 104 +++++++++++++++++++ providers/pagerduty/team.go | 116 ++++++++++++++++++++++ providers/pagerduty/user.go | 76 ++++++++++++++ 15 files changed, 801 insertions(+), 2 deletions(-) create mode 100644 cmd/provider_cmd_pagerduty.go create mode 100644 docs/pagerduty.md create mode 100644 providers/pagerduty/business_service.go create mode 100644 providers/pagerduty/escalation_policy.go create mode 100644 providers/pagerduty/pagerduty_provider.go create mode 100644 providers/pagerduty/pagerduty_service.go create mode 100644 providers/pagerduty/ruleset.go create mode 100644 providers/pagerduty/schedule.go create mode 100644 providers/pagerduty/service.go create mode 100644 providers/pagerduty/team.go create mode 100644 providers/pagerduty/user.go diff --git a/README.md b/README.md index bc2b914eb0..754c1576ae 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * Monitoring & System Management * [Datadog](/docs/datadog.md) * [New Relic](/docs/relic.md) + * [PagerDuty](/docs/pagerduty.md) * Community * [Keycloak](/docs/keycloak.md) * [Logz.io](/docs/logz.md) @@ -118,9 +119,9 @@ To import resources from all services, use `--resources="*"` . If you want to ex Filters are a way to choose which resources `terraformer` imports. It's possible to filter resources by its identifiers or attributes. Multiple filtering values are separated by `:`. If an identifier contains this symbol, value should be wrapped in `'` e.g. `--filter=resource=id1:'project:dataset_id'`. Identifier based filters will be executed before Terraformer will try to refresh remote state. -Use `Type` when you need to filter only one of several types of resources. Multiple filters can be combined when importing different resource types. An example would be importing all AWS security groups from a specific AWS VPC: +Use `Type` when you need to filter only one of several types of resources. Multiple filters can be combined when importing different resource types. An example would be importing all AWS security groups from a specific AWS VPC: ``` -terraformer import aws -r sg,vpc --filter Type=sg;Name=vpc_id;Value=VPC_ID --filter Type=vpc;Name=id;Value=VPC_ID +terraformer import aws -r sg,vpc --filter Type=sg;Name=vpc_id;Value=VPC_ID --filter Type=vpc;Name=id;Value=VPC_ID ``` Notice how the `Name` is different for `sg` than it is for `vpc`. @@ -266,6 +267,7 @@ Links to download Terraform Providers: * Monitoring & System Management * Datadog provider >2.1.0 - [here](https://releases.hashicorp.com/terraform-provider-datadog/) * New Relic provider >2.0.0 - [here](https://releases.hashicorp.com/terraform-provider-newrelic/) + * Pagerduty >=1.9 - [here](https://releases.hashicorp.com/terraform-provider-pagerduty/) * Community * Keycloak provider >=1.19.0 - [here](https://github.com/mrparkers/terraform-provider-keycloak/) * Logz.io provider >=1.1.1 - [here](https://github.com/jonboydell/logzio_terraform_provider/) diff --git a/cmd/provider_cmd_pagerduty.go b/cmd/provider_cmd_pagerduty.go new file mode 100644 index 0000000000..7e3ebdd0d4 --- /dev/null +++ b/cmd/provider_cmd_pagerduty.go @@ -0,0 +1,47 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + pagerduty_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/pagerduty" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdPagerDutyImporter(options ImportOptions) *cobra.Command { + token := "" + cmd := &cobra.Command{ + Use: "pagerduty", + Short: "Import current state to Terraform configuration from PagerDuty", + Long: "Import current state to Terraform configuration from PagerDuty", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newPagerDutyProvider() + err := Import(provider, options, []string{token}) + if err != nil { + return err + } + return nil + }, + } + + cmd.AddCommand(listCmd(newPagerDutyProvider())) + cmd.PersistentFlags().StringVarP(&token, "token", "t", "", "env param PAGERDUTY_TOKEN") + baseProviderFlags(cmd.PersistentFlags(), &options, "user", "user=id1:id2:id4") + return cmd +} + +func newPagerDutyProvider() terraformutils.ProviderGenerator { + return &pagerduty_terraforming.PagerDutyProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index 605e361534..2663e2bb27 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -67,6 +67,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdDatadogImporter, newCmdNewRelicImporter, newCmdGrafanaImporter, + newCmdPagerDutyImporter, // Community newCmdKeycloakImporter, newCmdLogzioImporter, @@ -107,6 +108,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { // Monitoring & System Management newDataDogProvider, newNewRelicProvider, + newPagerDutyProvider, // Community newKeycloakProvider, newLogzioProvider, diff --git a/docs/pagerduty.md b/docs/pagerduty.md new file mode 100644 index 0000000000..44edee82c7 --- /dev/null +++ b/docs/pagerduty.md @@ -0,0 +1,28 @@ +### Use with PagerDuty + +Example: + +``` +./terraformer import pagerduty -r team,schedule,user -t YOUR_PAGERDUTY_TOKEN // or PAGERDUTY_TOKEN in env +``` +Instructions to obtain a Auth Token: https://developer.pagerduty.com/docs/rest-api-v2/authentication/ + +List of supported PagerDuty resources: + +* `business_service` + * `pagerduty_business_service` +* `escalation_policy` + * `pagerduty_escalation_policy` +* `ruleset` + * `pagerduty_ruleset` + * `pagerduty_ruleset_rule` +* `schedule` + * `pagerduty_schedule` +* `service` + * `pagerduty_service` + * `pagerduty_service_event_rule` +* `team` + * `pagerduty_team` + * `pagerduty_team_membership` +* `user` + * `pagerduty_user` diff --git a/go.mod b/go.mod index fd0d97ce9a..0f38418f6a 100644 --- a/go.mod +++ b/go.mod @@ -110,6 +110,7 @@ require ( github.com/hashicorp/go-plugin v1.4.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.29 + github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 github.com/heroku/heroku-go/v5 v5.1.0 github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 diff --git a/go.sum b/go.sum index f445dd3ca1..ac66d5beeb 100644 --- a/go.sum +++ b/go.sum @@ -689,6 +689,8 @@ github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bA github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 h1:uyHgKwTluKHt2ctmyZfdVxECwSqYflYDo+RwyZZEdR0= +github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY= github.com/heroku/heroku-go/v5 v5.1.0 h1:3Qx1MxjzczSakhAZN4yRsvCI7kP0ldijK1XvfoYa4DE= github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZOdlm26Sr73U= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= diff --git a/providers/pagerduty/business_service.go b/providers/pagerduty/business_service.go new file mode 100644 index 0000000000..69be65ddd2 --- /dev/null +++ b/providers/pagerduty/business_service.go @@ -0,0 +1,63 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type BusinessServiceGenerator struct { + PagerDutyService +} + +func (g *BusinessServiceGenerator) createBusinessServiceResources(client *pagerduty.Client) error { + resp, _, err := client.BusinessServices.List() + if err != nil { + return err + } + + for _, service := range resp.BusinessServices { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + service.ID, + service.Name, + "pagerduty_business_service", + g.ProviderName, + []string{}, + )) + } + + return nil +} + +func (g *BusinessServiceGenerator) InitResources() error { + client, err := g.Client() + if err != nil { + return err + } + + funcs := []func(*pagerduty.Client) error{ + g.createBusinessServiceResources, + } + + for _, f := range funcs { + err := f(client) + if err != nil { + return err + } + } + + return nil +} diff --git a/providers/pagerduty/escalation_policy.go b/providers/pagerduty/escalation_policy.go new file mode 100644 index 0000000000..c5d7732ca9 --- /dev/null +++ b/providers/pagerduty/escalation_policy.go @@ -0,0 +1,73 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type EscalationPolicyGenerator struct { + PagerDutyService +} + +func (g *EscalationPolicyGenerator) createEscalationPolicyResources(client *pagerduty.Client) error { + var offset = 0 + options := pagerduty.ListEscalationPoliciesOptions{} + for { + options.Offset = offset + resp, _, err := client.EscalationPolicies.List(&options) + if err != nil { + return err + } + + for _, policy := range resp.EscalationPolicies { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + policy.ID, + policy.Name, + "pagerduty_escalation_policy", + g.ProviderName, + []string{}, + )) + } + + if resp.More != true { + break + } + + offset += resp.Limit + } + return nil +} + +func (g *EscalationPolicyGenerator) InitResources() error { + client, err := g.Client() + if err != nil { + return err + } + + funcs := []func(*pagerduty.Client) error{ + g.createEscalationPolicyResources, + } + + for _, f := range funcs { + err := f(client) + if err != nil { + return err + } + } + + return nil +} diff --git a/providers/pagerduty/pagerduty_provider.go b/providers/pagerduty/pagerduty_provider.go new file mode 100644 index 0000000000..96599ec1c1 --- /dev/null +++ b/providers/pagerduty/pagerduty_provider.go @@ -0,0 +1,89 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "errors" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/zclconf/go-cty/cty" +) + +type PagerDutyProvider struct { //nolint + terraformutils.Provider + token string +} + +func (p *PagerDutyProvider) Init(args []string) error { + if token := os.Getenv("PAGERDUTY_TOKEN"); token != "" { + p.token = os.Getenv("PAGERDUTY_TOKEN") + } + if len(args) > 0 { + p.token = args[0] + } + return nil +} + +func (p *PagerDutyProvider) GetName() string { + return "pagerduty" +} + +func (p *PagerDutyProvider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "token": cty.StringVal(p.token), + }) +} + +func (p *PagerDutyProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{ + "provider": map[string]interface{}{ + "pagerduty": map[string]interface{}{ + "token": p.token, + }, + }, + } +} + +func (PagerDutyProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} + +func (p *PagerDutyProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "business_service": &BusinessServiceGenerator{}, + "escalation_policy": &EscalationPolicyGenerator{}, + "ruleset": &RulesetGenerator{}, + "schedule": &ScheduleGenerator{}, + "service": &ServiceGenerator{}, + "team": &TeamGenerator{}, + "user": &UserGenerator{}, + } +} + +func (p *PagerDutyProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New(p.GetName() + ": " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "token": p.token, + }) + return nil +} diff --git a/providers/pagerduty/pagerduty_service.go b/providers/pagerduty/pagerduty_service.go new file mode 100644 index 0000000000..31bff9d192 --- /dev/null +++ b/providers/pagerduty/pagerduty_service.go @@ -0,0 +1,32 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type PagerDutyService struct { //nolint + terraformutils.Service +} + +func (s *PagerDutyService) Client() (*pagerduty.Client, error) { + client, err := pagerduty.NewClient(&pagerduty.Config{Token: s.GetArgs()["token"].(string)}) + if err != nil { + return nil, err + } + return client, nil +} diff --git a/providers/pagerduty/ruleset.go b/providers/pagerduty/ruleset.go new file mode 100644 index 0000000000..4976dc91ec --- /dev/null +++ b/providers/pagerduty/ruleset.go @@ -0,0 +1,89 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type RulesetGenerator struct { + PagerDutyService +} + +func (g *RulesetGenerator) createRulesetResources(client *pagerduty.Client) error { + resp, _, err := client.Rulesets.List() + if err != nil { + return err + } + + for _, ruleset := range resp.Rulesets { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + ruleset.ID, + ruleset.Name, + "pagerduty_ruleset", + g.ProviderName, + []string{}, + )) + } + + return nil +} + +func (g *RulesetGenerator) createRulesetRuleResources(client *pagerduty.Client) error { + resp, _, err := client.Rulesets.List() + if err != nil { + return err + } + + for _, ruleset := range resp.Rulesets { + rules, _, err := client.Rulesets.ListRules(ruleset.ID) + if err != nil { + return err + } + + for _, rule := range rules.Rules { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + rule.ID, + rule.ID, + "pagerduty_ruleset_rule", + g.ProviderName, + []string{}, + )) + } + } + + return nil +} + +func (g *RulesetGenerator) InitResources() error { + client, err := g.Client() + if err != nil { + return err + } + + funcs := []func(*pagerduty.Client) error{ + g.createRulesetResources, + } + + for _, f := range funcs { + err := f(client) + if err != nil { + return err + } + } + + return nil +} diff --git a/providers/pagerduty/schedule.go b/providers/pagerduty/schedule.go new file mode 100644 index 0000000000..7f9683cb8a --- /dev/null +++ b/providers/pagerduty/schedule.go @@ -0,0 +1,75 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type ScheduleGenerator struct { + PagerDutyService +} + +func (g *ScheduleGenerator) createScheduleResources(client *pagerduty.Client) error { + var offset = 0 + options := pagerduty.ListSchedulesOptions{} + for { + options.Offset = offset + resp, _, err := client.Schedules.List(&options) + if err != nil { + return err + } + + for _, schedule := range resp.Schedules { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + schedule.ID, + fmt.Sprintf("schedule_%s", schedule.Name), + "pagerduty_schedule", + g.ProviderName, + []string{}, + )) + } + if resp.More != true { + break + } + + offset += resp.Limit + } + + return nil +} + +func (g *ScheduleGenerator) InitResources() error { + client, err := g.Client() + if err != nil { + return err + } + + funcs := []func(*pagerduty.Client) error{ + g.createScheduleResources, + } + + for _, f := range funcs { + err := f(client) + if err != nil { + return err + } + } + + return nil +} diff --git a/providers/pagerduty/service.go b/providers/pagerduty/service.go new file mode 100644 index 0000000000..0ff95cae0e --- /dev/null +++ b/providers/pagerduty/service.go @@ -0,0 +1,104 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type ServiceGenerator struct { + PagerDutyService +} + +func (g *ServiceGenerator) createServiceResources(client *pagerduty.Client) error { + var offset = 0 + options := pagerduty.ListServicesOptions{} + for { + options.Offset = offset + resp, _, err := client.Services.List(&pagerduty.ListServicesOptions{}) + if err != nil { + return err + } + + for _, service := range resp.Services { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + service.ID, + fmt.Sprintf("service_%s", service.Name), + "pagerduty_service", + g.ProviderName, + []string{}, + )) + } + + if resp.More != true { + break + } + + offset += resp.Limit + } + + return nil +} + +func (g *ServiceGenerator) createServiceEventRuleResources(client *pagerduty.Client) error { + resp, _, err := client.Services.List(&pagerduty.ListServicesOptions{}) + if err != nil { + return err + } + + for _, service := range resp.Services { + rules, _, err := client.Services.ListEventRules(service.ID, &pagerduty.ListServiceEventRuleOptions{}) + + if err != nil { + return err + } + + for _, rule := range rules.EventRules { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + fmt.Sprintf("%s.%s", service.ID, rule.ID), + fmt.Sprintf("%s_%s", service.Name, rule.ID), + "pagerduty_service_event_rule", + g.ProviderName, + []string{}, + )) + } + } + + return nil +} + +func (g *ServiceGenerator) InitResources() error { + client, err := g.Client() + if err != nil { + return err + } + + funcs := []func(*pagerduty.Client) error{ + g.createServiceResources, + g.createServiceEventRuleResources, + } + + for _, f := range funcs { + err := f(client) + if err != nil { + return err + } + } + + return nil +} diff --git a/providers/pagerduty/team.go b/providers/pagerduty/team.go new file mode 100644 index 0000000000..a4c3786540 --- /dev/null +++ b/providers/pagerduty/team.go @@ -0,0 +1,116 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type TeamGenerator struct { + PagerDutyService +} + +func (g *TeamGenerator) createTeamResources(client *pagerduty.Client) error { + var offset = 0 + options := pagerduty.ListTeamsOptions{} + for { + options.Offset = offset + resp, _, err := client.Teams.List(&options) + if err != nil { + return err + } + + for _, team := range resp.Teams { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + team.ID, + fmt.Sprintf("Team_%s", team.Name), + "pagerduty_team", + g.ProviderName, + []string{}, + )) + } + if resp.More != true { + break + } + + offset += resp.Limit + } + + return nil +} + +func (g *TeamGenerator) createTeamMembershipResources(client *pagerduty.Client) error { + var teamOffset = 0 + teamOptions := pagerduty.ListTeamsOptions{} + + for { + teamOptions.Offset = teamOffset + resp, _, err := client.Teams.List(&teamOptions) + if err != nil { + return err + } + + memberOptions := pagerduty.GetMembersOptions{} + for _, team := range resp.Teams { + members, _, err := client.Teams.GetMembers(team.ID, &memberOptions) + + if err != nil { + return err + } + + for _, member := range members.Members { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + fmt.Sprintf("%s:%s", member.User.ID, team.ID), + fmt.Sprintf("%s_%s", member.User.ID, team.Name), + "pagerduty_team_membership", + g.ProviderName, + []string{}, + )) + } + } + + if resp.More != true { + break + } + + teamOffset += resp.Limit + } + + return nil +} + +func (g *TeamGenerator) InitResources() error { + client, err := g.Client() + if err != nil { + return err + } + + funcs := []func(*pagerduty.Client) error{ + g.createTeamResources, + g.createTeamMembershipResources, + } + + for _, f := range funcs { + err := f(client) + if err != nil { + return err + } + } + + return nil +} diff --git a/providers/pagerduty/user.go b/providers/pagerduty/user.go new file mode 100644 index 0000000000..b9b3c65669 --- /dev/null +++ b/providers/pagerduty/user.go @@ -0,0 +1,76 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pagerduty + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + pagerduty "github.com/heimweh/go-pagerduty/pagerduty" +) + +type UserGenerator struct { + PagerDutyService +} + +func (g *UserGenerator) createUserResources(client *pagerduty.Client) error { + var offset = 0 + options := pagerduty.ListUsersOptions{} + for { + options.Offset = offset + resp, _, err := client.Users.List(&options) + if err != nil { + return err + } + + for _, user := range resp.Users { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + user.ID, + fmt.Sprintf("user_%s", user.ID), + "pagerduty_user", + g.ProviderName, + []string{}, + )) + } + + if resp.More != true { + break + } + + offset += resp.Limit + } + + return nil +} + +func (g *UserGenerator) InitResources() error { + client, err := g.Client() + if err != nil { + return err + } + + funcs := []func(*pagerduty.Client) error{ + g.createUserResources, + } + + for _, f := range funcs { + err := f(client) + if err != nil { + return err + } + } + + return nil +} From c55e0149b1c318aaa9ba781e0c54c6636ab78e4c Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Tue, 4 May 2021 11:48:19 -0400 Subject: [PATCH 176/276] Fix JSON output variable and provider file (#910) * fix json output format * lint --- cmd/import.go | 4 ++-- terraformutils/hcl.go | 12 +++++++----- terraformutils/terraformoutput/hcl.go | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cmd/import.go b/cmd/import.go index c8a09bc1c8..27f0509781 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -304,9 +304,9 @@ func printService(provider terraformutils.ProviderGenerator, serviceName string, } variables["data"]["terraform_remote_state"][k] = map[string]interface{}{ "backend": "local", - "config": [1]interface{}{map[string]interface{}{ + "config": map[string]interface{}{ "path": strings.Repeat("../", strings.Count(path, "/")) + strings.ReplaceAll(path, serviceName, k) + "terraform.tfstate", - }}, + }, } } } diff --git a/terraformutils/hcl.go b/terraformutils/hcl.go index 1c5128afba..c525d30aa9 100644 --- a/terraformutils/hcl.go +++ b/terraformutils/hcl.go @@ -207,16 +207,18 @@ func terraform12Adjustments(formatted []byte, mapsObjects map[string]struct{}) [ func terraform13Adjustments(formatted []byte) []byte { s := string(formatted) + requiredProvidersRe := regexp.MustCompile("required_providers \".*\" {") oldRequiredProviders := "\"required_providers\"" newRequiredProviders := "required_providers" lines := strings.Split(s, "\n") - providerRequirementDefinition := false for i, line := range lines { - if providerRequirementDefinition { - line = strings.ReplaceAll(line, " {", " = {") + if requiredProvidersRe.MatchString(line) { + parts := strings.Split(strings.TrimSpace(line), " ") + provider := strings.ReplaceAll(parts[1], "\"", "") + lines[i] = "\t" + newRequiredProviders + " {" + lines[i+1] = "\t\t" + provider + " = {\n\t" + lines[i+1] + "\n\t\t}" } - providerRequirementDefinition = strings.Contains(line, newRequiredProviders) - lines[i] = strings.Replace(line, oldRequiredProviders, newRequiredProviders, 1) + lines[i] = strings.Replace(lines[i], oldRequiredProviders, newRequiredProviders, 1) } s = strings.Join(lines, "\n") return []byte(s) diff --git a/terraformutils/terraformoutput/hcl.go b/terraformutils/terraformoutput/hcl.go index abdd3578a2..cef39dcf32 100644 --- a/terraformutils/terraformoutput/hcl.go +++ b/terraformutils/terraformoutput/hcl.go @@ -33,9 +33,9 @@ func OutputHclFiles(resources []terraformutils.Resource, provider terraformutils providerData := provider.GetProviderData() providerData["terraform"] = map[string]interface{}{ "required_providers": []map[string]interface{}{{ - provider.GetName(): []map[string]interface{}{{ + provider.GetName(): map[string]interface{}{ "version": providerwrapper.GetProviderVersion(provider.GetName()), - }}, + }, }}, } From c00dbc7226d0a57cc5acf8095d4fa3622a2c891a Mon Sep 17 00:00:00 2001 From: Takuya Iwakami Date: Thu, 6 May 2021 03:02:44 +0900 Subject: [PATCH 177/276] Support awg_glue_job, aws_glue_trigger (#905) --- docs/aws.md | 2 ++ providers/aws/glue.go | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/docs/aws.md b/docs/aws.md index 768a7b1608..2bffdc9e88 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -146,6 +146,8 @@ In that case terraformer will not know with which region resources are associate * `glue_crawler` * `aws_glue_catalog_database` * `aws_glue_catalog_table` + * `aws_glue_job` + * `aws_glue_trigger` * `iam` * `aws_iam_group` * `aws_iam_group_policy` diff --git a/providers/aws/glue.go b/providers/aws/glue.go index fef714f179..2c8bad8dbc 100644 --- a/providers/aws/glue.go +++ b/providers/aws/glue.go @@ -92,6 +92,44 @@ func (g *GlueGenerator) loadGlueCatalogTable(svc *glue.Client, account *string, return nil } +func (g *GlueGenerator) loadGlueJobs(svc *glue.Client) error { + var GlueJobAllowEmptyValues = []string{"tags."} + p := glue.NewGetJobsPaginator(svc, &glue.GetJobsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, job := range page.Jobs { + resource := terraformutils.NewSimpleResource(*job.Name, *job.Name, + "aws_glue_job", + "aws", + GlueJobAllowEmptyValues) + g.Resources = append(g.Resources, resource) + } + } + return nil +} + +func (g *GlueGenerator) loadGlueTriggers(svc *glue.Client) error { + var GlueTriggerAllowEmptyValues = []string{"tags."} + p := glue.NewGetTriggersPaginator(svc, &glue.GetTriggersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, trigger := range page.Triggers { + resource := terraformutils.NewSimpleResource(*trigger.Name, *trigger.Name, + "aws_glue_trigger", + "aws", + GlueTriggerAllowEmptyValues) + g.Resources = append(g.Resources, resource) + } + } + return nil +} + // Generate TerraformResources from AWS API, // from each database create 1 TerraformResource. // Need only database name as ID for terraform resource @@ -121,5 +159,13 @@ func (g *GlueGenerator) InitResources() error { } } + if err := g.loadGlueJobs(svc); err != nil { + return err + } + + if err := g.loadGlueTriggers(svc); err != nil { + return err + } + return nil } From 38d096b3ffbb004f588106e9a9ba687b9896e132 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 May 2021 21:02:52 +0300 Subject: [PATCH 178/276] Bump github.com/aws/aws-sdk-go-v2/service/swf from 1.2.1 to 1.2.2 (#908) Bumps [github.com/aws/aws-sdk-go-v2/service/swf](https://github.com/aws/aws-sdk-go-v2) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.2.1...service/pi/v1.2.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0f38418f6a..31f27df1f0 100644 --- a/go.mod +++ b/go.mod @@ -86,7 +86,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sqs v1.3.0 github.com/aws/aws-sdk-go-v2/service/ssm v1.3.0 github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 - github.com/aws/aws-sdk-go-v2/service/swf v1.2.1 + github.com/aws/aws-sdk-go-v2/service/swf v1.2.2 github.com/aws/aws-sdk-go-v2/service/waf v1.1.4 github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1 github.com/aws/aws-sdk-go-v2/service/workspaces v1.2.1 diff --git a/go.sum b/go.sum index ac66d5beeb..23417feae8 100644 --- a/go.sum +++ b/go.sum @@ -312,8 +312,8 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 h1:Tr/SsFDXWN8rntdzTNrDs/MvuBXRC github.com/aws/aws-sdk-go-v2/service/sso v1.1.4/go.mod h1:yQayEbOWH75NaKFylsFocBc3yanYEGndlOaH4i/Lvno= github.com/aws/aws-sdk-go-v2/service/sts v1.2.1 h1:1koRvKlZMN+FhTGV5f4q6vRHXNJzeZlPKzbs1/Y32Kg= github.com/aws/aws-sdk-go-v2/service/sts v1.2.1/go.mod h1:L1LH5nHMXxdkKj057ZUx7Wi50CCrkZ+9jkTnBnY2j/w= -github.com/aws/aws-sdk-go-v2/service/swf v1.2.1 h1:oRzuG8uLuYbUysx6lSJ/h1yHItT7CCq8wNjKt2SO5Yo= -github.com/aws/aws-sdk-go-v2/service/swf v1.2.1/go.mod h1:8oZdl0gL0mdCdkAqDvr2f2DFNCWgFmiUnRSJv/4qQ8c= +github.com/aws/aws-sdk-go-v2/service/swf v1.2.2 h1:DPm8xVttctfEAALcJArYJxmI4SObDIftsipl4ykhF0E= +github.com/aws/aws-sdk-go-v2/service/swf v1.2.2/go.mod h1:JiYj3t717Tna1ylyqV8KZZq3yPdvt0693LvytZ8OKeI= github.com/aws/aws-sdk-go-v2/service/waf v1.1.4 h1:Wh0YMwF394A9eBC8Pv8Uxk6CBx9KTWmoqyflQIBx6DU= github.com/aws/aws-sdk-go-v2/service/waf v1.1.4/go.mod h1:Ujifac0yyu5RLw3cPCGua50uHnsjiJo9LAhXEJZ+tVk= github.com/aws/aws-sdk-go-v2/service/wafregional v1.2.1 h1:Re8Uwffnndo9t8V46kT3aruMvVXHXUmuYKhIF1U9CBc= From 0b4bf69b5e9167ed2b387934ed2ae10516e37666 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 May 2021 21:02:59 +0300 Subject: [PATCH 179/276] Bump k8s.io/client-go from 0.20.2 to 0.21.0 (#895) Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.20.2 to 0.21.0. - [Release notes](https://github.com/kubernetes/client-go/releases) - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.20.2...v0.21.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 49 +++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 31f27df1f0..6c71477ac9 100644 --- a/go.mod +++ b/go.mod @@ -139,8 +139,8 @@ require ( google.golang.org/api v0.40.0 google.golang.org/genproto v0.0.0-20210226172003-ab064af71705 gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect - k8s.io/apimachinery v0.20.2 - k8s.io/client-go v0.20.2 + k8s.io/apimachinery v0.21.0 + k8s.io/client-go v0.21.0 ) replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5 diff --git a/go.sum b/go.sum index 23417feae8..0e00ef9c43 100644 --- a/go.sum +++ b/go.sum @@ -54,13 +54,11 @@ github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.12 h1:gI8ytXbxMfI+IVbI9mP2JGCTXIuhHLgRlvQ9X4PsnHE= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/azure/cli v0.2.0 h1:pSwNMF0qotgehbQNllUWwJ4V3vnrLKOzHrwDLEZK904= @@ -72,7 +70,6 @@ github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSY github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= @@ -397,7 +394,6 @@ github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQ github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 h1:Od9CDqwkw5F3vjN8Lp8CQhkMOEjC70eTW+AJlTepE6g= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884/go.mod h1:SB2lZXXkyipTEoPLxR3A5YglkZ7QwoXSsyI9h6yUeFc= @@ -423,7 +419,6 @@ github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= @@ -436,8 +431,8 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= +github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= @@ -501,8 +496,9 @@ github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -742,6 +738,7 @@ github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0Lh github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -833,6 +830,7 @@ github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1 github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1067,8 +1065,9 @@ golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1153,12 +1152,12 @@ golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1234,7 +1233,6 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1244,8 +1242,9 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1309,6 +1308,7 @@ golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200624163319-25775e59acb7/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1321,6 +1321,7 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= @@ -1486,25 +1487,25 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= -k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= -k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= -k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/client-go v0.20.2 h1:uuf+iIAbfnCSw8IGAv/Rg0giM+2bOzHLOsbbrwrdhNQ= -k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= +k8s.io/api v0.21.0 h1:gu5iGF4V6tfVCQ/R+8Hc0h7H1JuEhzyEi9S4R5LM8+Y= +k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= +k8s.io/apimachinery v0.21.0 h1:3Fx+41if+IRavNcKOz09FwEXDBG6ORh6iMsTSelhkMA= +k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= +k8s.io/client-go v0.21.0 h1:n0zzzJsAQmJngpC0IhgFcApZyoGXPrDIAD601HD09ag= +k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= +k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/structured-merge-diff/v4 v4.1.0 h1:C4r9BgJ98vrKnnVCjwCSXcWjWe0NKcUQkmzDXZXGwH8= +sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From ddf071d7fcfc8d15d491ee5806522e544d61f89a Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Wed, 5 May 2021 22:53:24 +0300 Subject: [PATCH 180/276] fix github provider (#912) --- go.mod | 2 +- go.sum | 4 ++-- providers/github/github_provider.go | 2 ++ providers/github/github_service.go | 10 ++++++---- providers/github/members.go | 2 +- providers/github/organizationWebhooks.go | 2 +- providers/github/organization_block.go | 2 +- providers/github/organization_project.go | 2 +- providers/github/repositories.go | 2 +- providers/github/teams.go | 6 +++--- providers/github/user_ssh_keys.go | 2 +- terraformutils/providerwrapper/provider.go | 1 + 12 files changed, 21 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 6c71477ac9..b1afc89dd4 100644 --- a/go.mod +++ b/go.mod @@ -101,7 +101,7 @@ require ( github.com/digitalocean/godo v1.57.0 github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/fastly/go-fastly v1.18.0 - github.com/google/go-github/v25 v25.1.3 + github.com/google/go-github/v35 v35.1.0 github.com/gophercloud/gophercloud v0.17.0 github.com/grafana/grafana-api-golang-client v0.0.0-20210218192924-9ccd2365d2a6 github.com/hashicorp/go-azure-helpers v0.10.0 diff --git a/go.sum b/go.sum index 0e00ef9c43..e8720ac153 100644 --- a/go.sum +++ b/go.sum @@ -546,8 +546,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v25 v25.1.3 h1:Ht4YIQgUh4l4lc80fvGnw60khXysXvlgPxPP8uJG3EA= -github.com/google/go-github/v25 v25.1.3/go.mod h1:6z5pC69qHtrPJ0sXPsj4BLnd82b+r6sLB7qcBoRZqpw= +github.com/google/go-github/v35 v35.1.0 h1:KkwZnKWQ/0YryvXjZlCN/3EGRJNp6VCZPKo+RG9mG28= +github.com/google/go-github/v35 v35.1.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= diff --git a/providers/github/github_provider.go b/providers/github/github_provider.go index c974a3dec2..b1fbd3a07a 100644 --- a/providers/github/github_provider.go +++ b/providers/github/github_provider.go @@ -65,6 +65,8 @@ func (p *GithubProvider) Init(args []string) error { if len(args) > 2 { if args[2] != "" { p.baseURL = args[2] + } else { + p.baseURL = githubDefaultURL } } return nil diff --git a/providers/github/github_service.go b/providers/github/github_service.go index 88a32d77a0..6bd5bd3332 100644 --- a/providers/github/github_service.go +++ b/providers/github/github_service.go @@ -18,17 +18,19 @@ import ( "context" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/google/go-github/v25/github" - githubAPI "github.com/google/go-github/v25/github" + "github.com/google/go-github/v35/github" + githubAPI "github.com/google/go-github/v35/github" "golang.org/x/oauth2" ) +const githubDefaultURL = "https://api.github.com/" + type GithubService struct { //nolint terraformutils.Service } func (g *GithubService) createClient() (*github.Client, error) { - if g.GetArgs()["base_url"].(string) == "" { + if g.GetArgs()["base_url"].(string) == githubDefaultURL { return g.createRegularClient(), nil } return g.createEnterpriseClient() @@ -49,6 +51,6 @@ func (g *GithubService) createEnterpriseClient() (*github.Client, error) { &oauth2.Token{AccessToken: g.Args["token"].(string)}, ) tc := oauth2.NewClient(ctx, ts) - baseURL := g.GetArgs()["base_url"].(string) + "/api/v3/" + baseURL := g.GetArgs()["base_url"].(string) return githubAPI.NewEnterpriseClient(baseURL, baseURL, tc) } diff --git a/providers/github/members.go b/providers/github/members.go index 8c9ae8586f..22e8052e6a 100644 --- a/providers/github/members.go +++ b/providers/github/members.go @@ -20,7 +20,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - githubAPI "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v35/github" ) // MembersGenerator holds GithubService struct of Terraform service information diff --git a/providers/github/organizationWebhooks.go b/providers/github/organizationWebhooks.go index c873471402..2aa3f00a90 100644 --- a/providers/github/organizationWebhooks.go +++ b/providers/github/organizationWebhooks.go @@ -21,7 +21,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - githubAPI "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v35/github" ) type OrganizationWebhooksGenerator struct { diff --git a/providers/github/organization_block.go b/providers/github/organization_block.go index 2f3aa3699c..6d82c910cc 100644 --- a/providers/github/organization_block.go +++ b/providers/github/organization_block.go @@ -20,7 +20,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - githubAPI "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v35/github" ) type OrganizationBlockGenerator struct { diff --git a/providers/github/organization_project.go b/providers/github/organization_project.go index 771cc968e4..207400c6a8 100644 --- a/providers/github/organization_project.go +++ b/providers/github/organization_project.go @@ -21,7 +21,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - githubAPI "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v35/github" ) type OrganizationProjectGenerator struct { diff --git a/providers/github/repositories.go b/providers/github/repositories.go index f4a19f7001..447a36ee6d 100644 --- a/providers/github/repositories.go +++ b/providers/github/repositories.go @@ -20,7 +20,7 @@ import ( "strconv" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - githubAPI "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v35/github" ) type RepositoriesGenerator struct { diff --git a/providers/github/teams.go b/providers/github/teams.go index 4936ebf049..1290c27c23 100644 --- a/providers/github/teams.go +++ b/providers/github/teams.go @@ -21,7 +21,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - githubAPI "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v35/github" ) type TeamsGenerator struct { @@ -48,7 +48,7 @@ func (g *TeamsGenerator) createTeamsResources(ctx context.Context, teams []*gith func (g *TeamsGenerator) createTeamMembersResources(ctx context.Context, team *githubAPI.Team, client *githubAPI.Client) []terraformutils.Resource { resources := []terraformutils.Resource{} - members, _, err := client.Teams.ListTeamMembers(ctx, team.GetID(), nil) + members, _, err := client.Teams.ListTeamMembersBySlug(ctx, g.Args["owner"].(string), team.GetSlug(), nil) if err != nil { log.Println(err) } @@ -66,7 +66,7 @@ func (g *TeamsGenerator) createTeamMembersResources(ctx context.Context, team *g func (g *TeamsGenerator) createTeamRepositoriesResources(ctx context.Context, team *githubAPI.Team, client *githubAPI.Client) []terraformutils.Resource { resources := []terraformutils.Resource{} - repos, _, err := client.Teams.ListTeamRepos(ctx, team.GetID(), nil) + repos, _, err := client.Teams.ListTeamReposBySlug(ctx, g.Args["owner"].(string), team.GetSlug(), nil) if err != nil { log.Println(err) } diff --git a/providers/github/user_ssh_keys.go b/providers/github/user_ssh_keys.go index f37baafa38..441df005df 100644 --- a/providers/github/user_ssh_keys.go +++ b/providers/github/user_ssh_keys.go @@ -21,7 +21,7 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - githubAPI "github.com/google/go-github/v25/github" + githubAPI "github.com/google/go-github/v35/github" ) type UserSSHKeyGenerator struct { diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index 8c3412621a..7729f7266a 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -174,6 +174,7 @@ func (p *ProviderWrapper) Refresh(info *terraform.InstanceInfo, state *terraform Private: []byte{}, }) if resp.Diagnostics.HasErrors() { + log.Println(resp.Diagnostics.Err()) log.Printf("WARN: Fail read resource from provider, wait %dms before retry\n", p.retrySleepMs) time.Sleep(time.Duration(p.retrySleepMs) * time.Millisecond) continue From e00592e28377f32c38b5816dcb13487548ede24a Mon Sep 17 00:00:00 2001 From: Ethan Pransky Date: Thu, 6 May 2021 07:49:03 +0300 Subject: [PATCH 181/276] Issue #911. Add a --validate arg for the datadog provider to comply with the corresponding schema arg. this is passed as a string and parsed to a bool. it complies with the existing convention of giving priority to the arg before the env var DATADOG_VALIDATE. this defaults to true to comply with the provider schema behavior (#914) --- cmd/provider_cmd_datadog.go | 5 +++-- docs/datadog.md | 4 ++-- providers/datadog/datadog_provider.go | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/cmd/provider_cmd_datadog.go b/cmd/provider_cmd_datadog.go index 8fed391b53..3ca1199354 100644 --- a/cmd/provider_cmd_datadog.go +++ b/cmd/provider_cmd_datadog.go @@ -20,14 +20,14 @@ import ( ) func newCmdDatadogImporter(options ImportOptions) *cobra.Command { - var apiKey, appKey, apiURL string + var apiKey, appKey, apiURL, validate string cmd := &cobra.Command{ Use: "datadog", Short: "Import current state to Terraform configuration from Datadog", Long: "Import current state to Terraform configuration from Datadog", RunE: func(cmd *cobra.Command, args []string) error { provider := newDataDogProvider() - err := Import(provider, options, []string{apiKey, appKey, apiURL}) + err := Import(provider, options, []string{apiKey, appKey, apiURL, validate}) if err != nil { return err } @@ -39,6 +39,7 @@ func newCmdDatadogImporter(options ImportOptions) *cobra.Command { cmd.PersistentFlags().StringVarP(&apiKey, "api-key", "", "", "YOUR_DATADOG_API_KEY or env param DATADOG_API_KEY") cmd.PersistentFlags().StringVarP(&appKey, "app-key", "", "", "YOUR_DATADOG_APP_KEY or env param DATADOG_APP_KEY") cmd.PersistentFlags().StringVarP(&apiURL, "api-url", "", "", "YOUR_DATADOG_API_URL or env param DATADOG_HOST") + cmd.PersistentFlags().StringVar(&validate, "validate", "", "bool-parsable values only or env param DATADOG_VALIDATE. Enables validation of the provided API and APP keys during provider initialization. Default is true. When false, api_key and app_key won't be checked") return cmd } diff --git a/docs/datadog.md b/docs/datadog.md index 80065b5278..1e420ea199 100644 --- a/docs/datadog.md +++ b/docs/datadog.md @@ -3,8 +3,8 @@ Example: ``` - ./terraformer import datadog --resources=monitor --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env --api-url=DATADOG_API_URL // or DATADOG_HOST in env - ./terraformer import datadog --resources=monitor --filter=monitor=id1:id2:id4 --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env + ./terraformer import datadog --resources=monitor --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env --api-url=DATADOG_API_URL // or DATADOG_HOST in env --validate=VALIDATE_BOOL // or DATADOG_VALIDATE in env + ./terraformer import datadog --resources=monitor --filter=monitor=id1:id2:id4 --api-key=YOUR_DATADOG_API_KEY // or DATADOG_API_KEY in env --app-key=YOUR_DATADOG_APP_KEY // or DATADOG_APP_KEY in env --validate=VALIDATE_BOOL // or DATADOG_VALIDATE in env ``` List of supported Datadog services: diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 266464228e..a7110def0c 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -20,6 +20,7 @@ import ( "fmt" "net/url" "os" + "strconv" datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" @@ -32,6 +33,7 @@ type DatadogProvider struct { //nolint apiKey string appKey string apiURL string + validate bool authV1 context.Context authV2 context.Context datadogClientV1 *datadogV1.APIClient @@ -66,6 +68,22 @@ func (p *DatadogProvider) Init(args []string) error { p.apiURL = v } + if args[3] != "" { + validate, validateErr := strconv.ParseBool(args[3]) + if validateErr != nil { + return fmt.Errorf(`invalid validate arg : %v`, validateErr) + } + p.validate = validate + } else if os.Getenv("DATADOG_VALIDATE") != "" { + validate, validateErr := strconv.ParseBool(os.Getenv("DATADOG_VALIDATE")) + if validateErr != nil { + return fmt.Errorf(`invalid DATADOG_VALIDATE env var : %v`, validateErr) + } + p.validate = validate + } else { + p.validate = true + } + // Initialize the Datadog V1 API client authV1 := context.WithValue( context.Background(), @@ -147,6 +165,7 @@ func (p *DatadogProvider) GetConfig() cty.Value { "api_key": cty.StringVal(p.apiKey), "app_key": cty.StringVal(p.appKey), "api_url": cty.StringVal(p.apiURL), + "validate": cty.BoolVal(p.validate), }) } @@ -164,6 +183,7 @@ func (p *DatadogProvider) InitService(serviceName string, verbose bool) error { "api-key": p.apiKey, "app-key": p.appKey, "api-url": p.apiURL, + "validate": p.validate, "authV1": p.authV1, "authV2": p.authV2, "datadogClientV1": p.datadogClientV1, From 7d41c2ead9a19cd5f5ea65941f70d066e574cb06 Mon Sep 17 00:00:00 2001 From: Ethan Pransky Date: Thu, 6 May 2021 08:33:42 +0300 Subject: [PATCH 182/276] Issue #911. Prevent throwing error for datadog api key or app key if validate=false, which is consistent with the provider behavior (#915) --- providers/datadog/datadog_provider.go | 37 ++++++++++++++------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index a7110def0c..ced9a55a23 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -42,12 +42,29 @@ type DatadogProvider struct { //nolint // Init check env params and initialize API Client func (p *DatadogProvider) Init(args []string) error { + + if args[3] != "" { + validate, validateErr := strconv.ParseBool(args[3]) + if validateErr != nil { + return fmt.Errorf(`invalid validate arg : %v`, validateErr) + } + p.validate = validate + } else if os.Getenv("DATADOG_VALIDATE") != "" { + validate, validateErr := strconv.ParseBool(os.Getenv("DATADOG_VALIDATE")) + if validateErr != nil { + return fmt.Errorf(`invalid DATADOG_VALIDATE env var : %v`, validateErr) + } + p.validate = validate + } else { + p.validate = true + } + if args[0] != "" { p.apiKey = args[0] } else { if apiKey := os.Getenv("DATADOG_API_KEY"); apiKey != "" { p.apiKey = apiKey - } else { + } else if p.validate { return errors.New("api-key requirement") } } @@ -57,7 +74,7 @@ func (p *DatadogProvider) Init(args []string) error { } else { if appKey := os.Getenv("DATADOG_APP_KEY"); appKey != "" { p.appKey = appKey - } else { + } else if p.validate { return errors.New("app-key requirement") } } @@ -68,22 +85,6 @@ func (p *DatadogProvider) Init(args []string) error { p.apiURL = v } - if args[3] != "" { - validate, validateErr := strconv.ParseBool(args[3]) - if validateErr != nil { - return fmt.Errorf(`invalid validate arg : %v`, validateErr) - } - p.validate = validate - } else if os.Getenv("DATADOG_VALIDATE") != "" { - validate, validateErr := strconv.ParseBool(os.Getenv("DATADOG_VALIDATE")) - if validateErr != nil { - return fmt.Errorf(`invalid DATADOG_VALIDATE env var : %v`, validateErr) - } - p.validate = validate - } else { - p.validate = true - } - // Initialize the Datadog V1 API client authV1 := context.WithValue( context.Background(), From 302337cecca93507a928fb98b18982bb2cd5088f Mon Sep 17 00:00:00 2001 From: rui Date: Fri, 14 May 2021 00:55:00 -0400 Subject: [PATCH 183/276] doc: move fastly and ns1 into networking sector (#931) Signed-off-by: Rui Chen --- README.md | 4 ++-- cmd/root.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 754c1576ae..50d1fbeb0a 100644 --- a/README.md +++ b/README.md @@ -249,10 +249,8 @@ Links to download Terraform Providers: * Alicloud provider >1.57.1 - [here](https://releases.hashicorp.com/terraform-provider-alicloud/) * Cloud * DigitalOcean provider >1.9.1 - [here](https://releases.hashicorp.com/terraform-provider-digitalocean/) - * Fastly provider >0.16.1 - [here](https://releases.hashicorp.com/terraform-provider-fastly/) * Heroku provider >2.2.1 - [here](https://releases.hashicorp.com/terraform-provider-heroku/) * Linode provider >1.8.0 - [here](https://releases.hashicorp.com/terraform-provider-linode/) - * NS1 provider >1.8.3 - [here](https://releases.hashicorp.com/terraform-provider-ns1/) * OpenStack provider >1.21.1 - [here](https://releases.hashicorp.com/terraform-provider-openstack/) * TencentCloud provider >1.50.0 - [here](https://releases.hashicorp.com/terraform-provider-tencentcloud/) * Vultr provider >1.0.5 - [here](https://releases.hashicorp.com/terraform-provider-vultr/) @@ -262,6 +260,8 @@ Links to download Terraform Providers: * RabbitMQ provider >=1.1.0 - [here](https://releases.hashicorp.com/terraform-provider-rabbitmq/) * Network * Cloudflare provider >1.16 - [here](https://releases.hashicorp.com/terraform-provider-cloudflare/) + * Fastly provider >0.16.1 - [here](https://releases.hashicorp.com/terraform-provider-fastly/) + * NS1 provider >1.8.3 - [here](https://releases.hashicorp.com/terraform-provider-ns1/) * VCS * GitHub provider >=2.2.1 - [here](https://releases.hashicorp.com/terraform-provider-github/) * Monitoring & System Management diff --git a/cmd/root.go b/cmd/root.go index 2663e2bb27..8eabd3b01d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -47,10 +47,8 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command // Cloud newCmdDigitalOceanImporter, newCmdEquinixMetalImporter, - newCmdFastlyImporter, newCmdHerokuImporter, newCmdLinodeImporter, - newCmdNs1Importer, newCmdOpenStackImporter, newCmdTencentCloudImporter, newCmdVultrImporter, @@ -61,6 +59,8 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdRabbitMQImporter, // Network newCmdCloudflareImporter, + newCmdFastlyImporter, + newCmdNs1Importer, // VCS newCmdGithubImporter, // Monitoring & System Management From d84c17f5f2bf01467b87c6460b33ce97bbb1e759 Mon Sep 17 00:00:00 2001 From: rui Date: Fri, 14 May 2021 00:55:52 -0400 Subject: [PATCH 184/276] fastly: update to use fastly v3 api (#930) * deps: update to use fastly v3 api * gofmt providers/fastly/service_v1.go Signed-off-by: Rui Chen --- go.mod | 2 +- go.sum | 8 ++++---- providers/fastly/service_v1.go | 20 ++++++++++---------- providers/fastly/user.go | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index b1afc89dd4..05a9039efe 100644 --- a/go.mod +++ b/go.mod @@ -100,7 +100,7 @@ require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.57.0 github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 - github.com/fastly/go-fastly v1.18.0 + github.com/fastly/go-fastly/v3 v3.6.0 github.com/google/go-github/v35 v35.1.0 github.com/gophercloud/gophercloud v0.17.0 github.com/grafana/grafana-api-golang-client v0.0.0-20210218192924-9ccd2365d2a6 diff --git a/go.sum b/go.sum index e8720ac153..f0d08f0889 100644 --- a/go.sum +++ b/go.sum @@ -408,8 +408,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y 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/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fastly/go-fastly v1.18.0 h1:fyVq/142VTFz5ZkNE5d57K+NkTmtwxt2K2Mh5sV5scg= -github.com/fastly/go-fastly v1.18.0/go.mod h1:fwYSSnZ6zEClwRS65T0f57Yh83Tc4gL12GgttQwJZfA= +github.com/fastly/go-fastly/v3 v3.6.0 h1:sRnI+MhyMkgZbQWaUnhr70gHk39kfpG9JpMUlSoIsCg= +github.com/fastly/go-fastly/v3 v3.6.0/go.mod h1:KOaCWsmkIKSASPzADl8PT/bTQIghOw/eEaxlHOu3jMA= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -554,8 +554,8 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/jsonapi v0.0.0-20170708005851-46d3ced04344 h1:G5TmuUtIYeR0scfa8ZQ06cfHeAAfVeFlIG8TVOCfuAA= -github.com/google/jsonapi v0.0.0-20170708005851-46d3ced04344/go.mod h1:XSx4m2SziAqk9DXY9nz659easTq4q6TyrpYd9tHSm0g= +github.com/google/jsonapi v0.0.0-20201022225600-f822737867f6 h1:nVbdADVJLcaOp/CAR9xhaMCZrYn07HFFhUtM+dHsAIc= +github.com/google/jsonapi v0.0.0-20201022225600-f822737867f6/go.mod h1:XSx4m2SziAqk9DXY9nz659easTq4q6TyrpYd9tHSm0g= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= diff --git a/providers/fastly/service_v1.go b/providers/fastly/service_v1.go index ace04cbf14..25906bd9ac 100644 --- a/providers/fastly/service_v1.go +++ b/providers/fastly/service_v1.go @@ -16,7 +16,7 @@ package fastly import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/fastly/go-fastly/fastly" + "github.com/fastly/go-fastly/v3/fastly" ) type ServiceV1Generator struct { @@ -41,14 +41,14 @@ func (g *ServiceV1Generator) loadServices(client *fastly.Client) ([]*fastly.Serv func (g *ServiceV1Generator) loadDictionaryItems(client *fastly.Client, serviceID string) error { latest, err := client.LatestVersion(&fastly.LatestVersionInput{ - Service: serviceID, + ServiceID: serviceID, }) if err != nil { return err } dictionaries, err := client.ListDictionaries(&fastly.ListDictionariesInput{ - Service: serviceID, - Version: latest.Number, + ServiceID: serviceID, + ServiceVersion: latest.Number, }) if err != nil { return err @@ -71,14 +71,14 @@ func (g *ServiceV1Generator) loadDictionaryItems(client *fastly.Client, serviceI func (g *ServiceV1Generator) loadACLEntries(client *fastly.Client, serviceID string) error { latest, err := client.LatestVersion(&fastly.LatestVersionInput{ - Service: serviceID, + ServiceID: serviceID, }) if err != nil { return err } acls, err := client.ListACLs(&fastly.ListACLsInput{ - Service: serviceID, - Version: latest.Number, + ServiceID: serviceID, + ServiceVersion: latest.Number, }) if err != nil { return err @@ -101,14 +101,14 @@ func (g *ServiceV1Generator) loadACLEntries(client *fastly.Client, serviceID str func (g *ServiceV1Generator) loadDynamicSnippetContent(client *fastly.Client, serviceID string) error { latest, err := client.LatestVersion(&fastly.LatestVersionInput{ - Service: serviceID, + ServiceID: serviceID, }) if err != nil { return err } snippets, err := client.ListSnippets(&fastly.ListSnippetsInput{ - Service: serviceID, - Version: latest.Number, + ServiceID: serviceID, + ServiceVersion: latest.Number, }) if err != nil { return err diff --git a/providers/fastly/user.go b/providers/fastly/user.go index a055461f9b..3fc225c7fa 100644 --- a/providers/fastly/user.go +++ b/providers/fastly/user.go @@ -16,7 +16,7 @@ package fastly import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/fastly/go-fastly/fastly" + "github.com/fastly/go-fastly/v3/fastly" ) type UserGenerator struct { From 8c5e706d68fc50fead2c7224b6dc59059a1126d5 Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Fri, 14 May 2021 00:57:23 -0400 Subject: [PATCH 185/276] Update Datadog api client and various fixes (#927) * update datadog-api-go client and add user status filter * remove status filtering for users reosource * add dashboard_json resource and rename synthetics -> synthetics_test * allow empty message for monitors and add filter for users resource * lint and format --- docs/datadog.md | 4 +- go.mod | 2 +- go.sum | 5 ++ providers/datadog/dashboard.go | 4 +- providers/datadog/dashboard_json.go | 88 +++++++++++++++++++ providers/datadog/dashboard_list.go | 2 +- providers/datadog/datadog_provider.go | 7 +- providers/datadog/downtime.go | 4 +- providers/datadog/integration_aws.go | 2 +- .../datadog/integration_aws_lambda_arn.go | 2 +- .../datadog/integration_aws_log_collection.go | 2 +- providers/datadog/integration_azure.go | 2 +- providers/datadog/integration_gcp.go | 2 +- .../datadog/integration_slack_channel.go | 2 +- providers/datadog/logs_archive.go | 4 +- providers/datadog/logs_custom_pipeline.go | 4 +- providers/datadog/logs_index.go | 4 +- .../datadog/logs_integration_pipeline.go | 2 +- providers/datadog/monitor.go | 12 +-- providers/datadog/role.go | 4 +- .../security_monitoring_default_rule.go | 5 +- providers/datadog/security_monitoring_rule.go | 5 +- providers/datadog/service_level_objective.go | 2 +- .../datadog/synthetics_global_variable.go | 2 +- .../datadog/synthetics_private_location.go | 2 +- .../{synthetics.go => synthetics_test_.go} | 16 ++-- providers/datadog/user.go | 14 ++- 27 files changed, 160 insertions(+), 44 deletions(-) create mode 100644 providers/datadog/dashboard_json.go rename providers/datadog/{synthetics.go => synthetics_test_.go} (84%) diff --git a/docs/datadog.md b/docs/datadog.md index 1e420ea199..f34eadbec3 100644 --- a/docs/datadog.md +++ b/docs/datadog.md @@ -11,6 +11,8 @@ List of supported Datadog services: * `dashboard` * `datadog_dashboard` +* `dashboard_json` + * `datadog_dashboard_json` * `dashboard_list` * `datadog_dashboard_list` * `downtime` @@ -63,7 +65,7 @@ List of supported Datadog services: * `datadog_security_monitoring_rule` * `service_level_objective` * `datadog_service_level_objective` -* `synthetics` +* `synthetics_test` * `datadog_synthetics_test` * `synthetics_global_variables` * `datadog_synthetics_global_variables` diff --git a/go.mod b/go.mod index 05a9039efe..27ddec6c32 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/Azure/azure-sdk-for-go v42.3.0+incompatible github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-autorest/autorest v0.11.12 - github.com/DataDog/datadog-api-client-go v1.0.0-beta.18 + github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 diff --git a/go.sum b/go.sum index f0d08f0889..90abaf7c8d 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,11 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-api-client-go v1.0.0-beta.18 h1:4i51yRTWm8SEuc9iRxxFicm59jQcAo70v+3ddZhEq8Q= github.com/DataDog/datadog-api-client-go v1.0.0-beta.18/go.mod h1:Gn0fZwIOBbSidO0OaPEh9nO5EmIPsxJrHfHvfVXEaoU= +github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 h1:VwdZv6Mm4d7Jx9qawTNM6FlShdlE1d/J+64X3Izd574= +github.com/DataDog/datadog-api-client-go v1.0.0-beta.20/go.mod h1:T4YUFSUXoBbhxY5qq5V/1llk5U1o6vTjYFS3dk3uH74= github.com/DataDog/datadog-go v4.4.0+incompatible h1:R7WqXWP4fIOAqWJtUKmSfuc7eDsBT58k9AY5WSHVosk= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 h1:sUpBb2/GC8L6UOKDnbEZLRTxQB2RQgMv1mxbnOHOQW4= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= @@ -424,6 +427,7 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786 h1:upeQpV8AFGWxWvlu2LpJojgvWOU2SyiG+XvYerMGaCw= github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= +github.com/go-bdd/gobdd v1.1.3/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -1441,6 +1445,7 @@ google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484 h1:gv8e5qO2QJPaYAcGrgu4jex1zo4IlxKxzmUSQ++sufQ= gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484/go.mod h1:H9vSLD4Qlnl3rH2fUT6jyP9qwq1lDo0ikaDqSJo8t/U= +gopkg.in/DataDog/dd-trace-go.v1 v1.30.0-rc.1.0.20210420124628-f63633f38e8f/go.mod h1:I3nUNop4UZaHSj2C2OBCHezmsQIHczbUps8nHgw/HXs= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/providers/datadog/dashboard.go b/providers/datadog/dashboard.go index 810b6e2143..5bfb74d567 100644 --- a/providers/datadog/dashboard.go +++ b/providers/datadog/dashboard.go @@ -64,7 +64,7 @@ func (g *DashboardGenerator) InitResources() error { for _, filter := range g.Filter { if filter.FieldPath == "id" && filter.IsApplicable("dashboard") { for _, value := range filter.AcceptableValues { - dashboard, _, err := datadogClientV1.DashboardsApi.GetDashboard(authV1, value).Execute() + dashboard, _, err := datadogClientV1.DashboardsApi.GetDashboard(authV1, value) if err != nil { return err } @@ -79,7 +79,7 @@ func (g *DashboardGenerator) InitResources() error { return nil } - summary, _, err := datadogClientV1.DashboardsApi.ListDashboards(authV1).Execute() + summary, _, err := datadogClientV1.DashboardsApi.ListDashboards(authV1) if err != nil { return err } diff --git a/providers/datadog/dashboard_json.go b/providers/datadog/dashboard_json.go new file mode 100644 index 0000000000..e90fd51fbf --- /dev/null +++ b/providers/datadog/dashboard_json.go @@ -0,0 +1,88 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package datadog + +import ( + "context" + "fmt" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +var ( + // DashboardJSONAllowEmptyValues ... + DashboardJSONAllowEmptyValues = []string{"tags."} +) + +// DashboardJSONGenerator ... +type DashboardJSONGenerator struct { + DatadogService +} + +func (g *DashboardJSONGenerator) createResources(dashboards []datadogV1.DashboardSummaryDefinition) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, dashboard := range dashboards { + resourceName := dashboard.GetId() + resources = append(resources, g.createResource(resourceName)) + } + + return resources +} + +func (g *DashboardJSONGenerator) createResource(dashboardID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + dashboardID, + fmt.Sprintf("dashboard_json_%s", dashboardID), + "datadog_dashboard_json", + "datadog", + DashboardJSONAllowEmptyValues, + ) +} + +// InitResources Generate TerraformResources from Datadog API, +// from each dashboard_json create 1 TerraformResource. +// Need Dashboard ID as ID for terraform resource +func (g *DashboardJSONGenerator) InitResources() error { + datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) + authV1 := g.Args["authV1"].(context.Context) + + resources := []terraformutils.Resource{} + for _, filter := range g.Filter { + if filter.FieldPath == "id" && filter.IsApplicable("dashboard_json") { + for _, value := range filter.AcceptableValues { + dashboard, _, err := datadogClientV1.DashboardsApi.GetDashboard(authV1, value) + if err != nil { + return err + } + + resources = append(resources, g.createResource(dashboard.GetId())) + } + } + } + + if len(resources) > 0 { + g.Resources = resources + return nil + } + + summary, _, err := datadogClientV1.DashboardsApi.ListDashboards(authV1) + if err != nil { + return err + } + g.Resources = g.createResources(summary.GetDashboards()) + return nil +} diff --git a/providers/datadog/dashboard_list.go b/providers/datadog/dashboard_list.go index fc98015ac5..1cf06f03c1 100644 --- a/providers/datadog/dashboard_list.go +++ b/providers/datadog/dashboard_list.go @@ -61,7 +61,7 @@ func (g *DashboardListGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - dlResponse, _, err := datadogClientV1.DashboardListsApi.ListDashboardLists(authV1).Execute() + dlResponse, _, err := datadogClientV1.DashboardListsApi.ListDashboardLists(authV1) if err != nil { return err } diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index ced9a55a23..0301fc62c4 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -198,6 +198,7 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic return map[string]terraformutils.ServiceGenerator{ "dashboard_list": &DashboardListGenerator{}, "dashboard": &DashboardGenerator{}, + "dashboard_json": &DashboardJSONGenerator{}, "downtime": &DowntimeGenerator{}, "logs_archive": &LogsArchiveGenerator{}, "logs_archive_order": &LogsArchiveOrderGenerator{}, @@ -220,7 +221,7 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "security_monitoring_default_rule": &SecurityMonitoringDefaultRuleGenerator{}, "security_monitoring_rule": &SecurityMonitoringRuleGenerator{}, "service_level_objective": &ServiceLevelObjectiveGenerator{}, - "synthetics": &SyntheticsGenerator{}, + "synthetics_test": &SyntheticsTestGenerator{}, "synthetics_global_variable": &SyntheticsGlobalVariableGenerator{}, "synthetics_private_location": &SyntheticsPrivateLocationGenerator{}, "timeboard": &TimeboardGenerator{}, @@ -312,13 +313,13 @@ func (p DatadogProvider) GetResourceConnections() map[string]map[string][]string "monitor_ids", "id", }, }, - "synthetics": { + "synthetics_test": { "synthetics_private_location": { "locations", "id", }, }, "synthetics_global_variable": { - "synthetics": { + "synthetics_test": { "parse_test_id", "id", }, }, diff --git a/providers/datadog/downtime.go b/providers/datadog/downtime.go index 8e201c951b..492194a5c4 100644 --- a/providers/datadog/downtime.go +++ b/providers/datadog/downtime.go @@ -70,7 +70,7 @@ func (g *DowntimeGenerator) InitResources() error { return err } - monitor, _, err := datadogClientV1.DowntimesApi.GetDowntime(authV1, i).Execute() + monitor, _, err := datadogClientV1.DowntimesApi.GetDowntime(authV1, i) if err != nil { return err } @@ -85,7 +85,7 @@ func (g *DowntimeGenerator) InitResources() error { return nil } - downtimes, _, err := datadogClientV1.DowntimesApi.ListDowntimes(authV1).Execute() + downtimes, _, err := datadogClientV1.DowntimesApi.ListDowntimes(authV1) if err != nil { return err } diff --git a/providers/datadog/integration_aws.go b/providers/datadog/integration_aws.go index 3d5a5bc047..ae4473fbaf 100644 --- a/providers/datadog/integration_aws.go +++ b/providers/datadog/integration_aws.go @@ -60,7 +60,7 @@ func (g *IntegrationAWSGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - integrations, _, err := datadogClientV1.AWSIntegrationApi.ListAWSAccounts(authV1).Execute() + integrations, _, err := datadogClientV1.AWSIntegrationApi.ListAWSAccounts(authV1) if err != nil { return err } diff --git a/providers/datadog/integration_aws_lambda_arn.go b/providers/datadog/integration_aws_lambda_arn.go index 5acbf6f42e..a61163e65a 100644 --- a/providers/datadog/integration_aws_lambda_arn.go +++ b/providers/datadog/integration_aws_lambda_arn.go @@ -64,7 +64,7 @@ func (g *IntegrationAWSLambdaARNGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - logCollections, _, err := datadogClientV1.AWSLogsIntegrationApi.ListAWSLogsIntegrations(authV1).Execute() + logCollections, _, err := datadogClientV1.AWSLogsIntegrationApi.ListAWSLogsIntegrations(authV1) if err != nil { return err } diff --git a/providers/datadog/integration_aws_log_collection.go b/providers/datadog/integration_aws_log_collection.go index 00f416b066..83db0ef0ce 100644 --- a/providers/datadog/integration_aws_log_collection.go +++ b/providers/datadog/integration_aws_log_collection.go @@ -59,7 +59,7 @@ func (g *IntegrationAWSLogCollectionGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - logCollections, _, err := datadogClientV1.AWSLogsIntegrationApi.ListAWSLogsIntegrations(authV1).Execute() + logCollections, _, err := datadogClientV1.AWSLogsIntegrationApi.ListAWSLogsIntegrations(authV1) if err != nil { return err } diff --git a/providers/datadog/integration_azure.go b/providers/datadog/integration_azure.go index cf618709ae..e4c576381f 100644 --- a/providers/datadog/integration_azure.go +++ b/providers/datadog/integration_azure.go @@ -60,7 +60,7 @@ func (g *IntegrationAzureGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - integrations, _, err := datadogClientV1.AzureIntegrationApi.ListAzureIntegration(authV1).Execute() + integrations, _, err := datadogClientV1.AzureIntegrationApi.ListAzureIntegration(authV1) if err != nil { return err } diff --git a/providers/datadog/integration_gcp.go b/providers/datadog/integration_gcp.go index 0697f8d6c3..412fdd5ea8 100644 --- a/providers/datadog/integration_gcp.go +++ b/providers/datadog/integration_gcp.go @@ -60,7 +60,7 @@ func (g *IntegrationGCPGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - integrations, _, err := datadogClientV1.GCPIntegrationApi.ListGCPIntegration(authV1).Execute() + integrations, _, err := datadogClientV1.GCPIntegrationApi.ListGCPIntegration(authV1) if err != nil { return err } diff --git a/providers/datadog/integration_slack_channel.go b/providers/datadog/integration_slack_channel.go index 7f8d6b44d6..e122ef8293 100644 --- a/providers/datadog/integration_slack_channel.go +++ b/providers/datadog/integration_slack_channel.go @@ -64,7 +64,7 @@ func (g *IntegrationSlackChannelGenerator) InitResources() error { for _, filter := range g.Filter { if filter.FieldPath == "account_name" && filter.IsApplicable("integration_slack_channel") { for _, value := range filter.AcceptableValues { - slackChannels, _, err := datadogClientV1.SlackIntegrationApi.GetSlackIntegrationChannels(authV1, value).Execute() + slackChannels, _, err := datadogClientV1.SlackIntegrationApi.GetSlackIntegrationChannels(authV1, value) if err != nil { return err } diff --git a/providers/datadog/logs_archive.go b/providers/datadog/logs_archive.go index 94365f1ac0..05a48e08a4 100644 --- a/providers/datadog/logs_archive.go +++ b/providers/datadog/logs_archive.go @@ -64,7 +64,7 @@ func (g *LogsArchiveGenerator) InitResources() error { for _, filter := range g.Filter { if filter.FieldPath == "id" && filter.IsApplicable("logs_archive") { for _, value := range filter.AcceptableValues { - resp, _, err := datadogClientV2.LogsArchivesApi.GetLogsArchive(authV2, value).Execute() + resp, _, err := datadogClientV2.LogsArchivesApi.GetLogsArchive(authV2, value) if err != nil { return err } @@ -79,7 +79,7 @@ func (g *LogsArchiveGenerator) InitResources() error { return nil } - logsArchiveListResp, _, err := datadogClientV2.LogsArchivesApi.ListLogsArchives(authV2).Execute() + logsArchiveListResp, _, err := datadogClientV2.LogsArchivesApi.ListLogsArchives(authV2) logsArchiveList := logsArchiveListResp.GetData() if err != nil { return err diff --git a/providers/datadog/logs_custom_pipeline.go b/providers/datadog/logs_custom_pipeline.go index 81c30ac216..1ba0aa9615 100644 --- a/providers/datadog/logs_custom_pipeline.go +++ b/providers/datadog/logs_custom_pipeline.go @@ -69,7 +69,7 @@ func (g *LogsCustomPipelineGenerator) InitResources() error { for _, filter := range g.Filter { if filter.FieldPath == "id" && filter.IsApplicable("logs_custom_pipeline") { for _, value := range filter.AcceptableValues { - logsCustomPipeline, _, err := datadogClientV1.LogsPipelinesApi.GetLogsPipeline(authV1, value).Execute() + logsCustomPipeline, _, err := datadogClientV1.LogsPipelinesApi.GetLogsPipeline(authV1, value) if err != nil { return err } @@ -84,7 +84,7 @@ func (g *LogsCustomPipelineGenerator) InitResources() error { return nil } - logsCustomPipelines, _, err := datadogClientV1.LogsPipelinesApi.ListLogsPipelines(authV1).Execute() + logsCustomPipelines, _, err := datadogClientV1.LogsPipelinesApi.ListLogsPipelines(authV1) if err != nil { return err } diff --git a/providers/datadog/logs_index.go b/providers/datadog/logs_index.go index 348ccec156..73adeeb381 100644 --- a/providers/datadog/logs_index.go +++ b/providers/datadog/logs_index.go @@ -64,7 +64,7 @@ func (g *LogsIndexGenerator) InitResources() error { for _, filter := range g.Filter { if filter.FieldPath == "id" && filter.IsApplicable("logs_index") { for _, value := range filter.AcceptableValues { - logsIndex, _, err := datadogClientV1.LogsIndexesApi.GetLogsIndex(authV1, value).Execute() + logsIndex, _, err := datadogClientV1.LogsIndexesApi.GetLogsIndex(authV1, value) if err != nil { return err } @@ -79,7 +79,7 @@ func (g *LogsIndexGenerator) InitResources() error { return nil } - logsIndexList, _, err := datadogClientV1.LogsIndexesApi.ListLogIndexes(authV1).Execute() + logsIndexList, _, err := datadogClientV1.LogsIndexesApi.ListLogIndexes(authV1) logsIndex := logsIndexList.GetIndexes() if err != nil { return err diff --git a/providers/datadog/logs_integration_pipeline.go b/providers/datadog/logs_integration_pipeline.go index 93244ad0a0..6e8d57acb2 100644 --- a/providers/datadog/logs_integration_pipeline.go +++ b/providers/datadog/logs_integration_pipeline.go @@ -62,7 +62,7 @@ func (g *LogsIntegrationPipelineGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - logsIntegrationPipelines, _, err := datadogClientV1.LogsPipelinesApi.ListLogsPipelines(authV1).Execute() + logsIntegrationPipelines, _, err := datadogClientV1.LogsPipelinesApi.ListLogsPipelines(authV1) if err != nil { return err } diff --git a/providers/datadog/monitor.go b/providers/datadog/monitor.go index 57141f9de2..2e9ccd1cad 100644 --- a/providers/datadog/monitor.go +++ b/providers/datadog/monitor.go @@ -27,7 +27,7 @@ import ( var ( // MonitorAllowEmptyValues ... - MonitorAllowEmptyValues = []string{"tags."} + MonitorAllowEmptyValues = []string{"tags.", "message"} ) // MonitorGenerator ... @@ -64,8 +64,8 @@ func (g *MonitorGenerator) createResource(monitorID string) terraformutils.Resou func (g *MonitorGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - dclient := datadogClientV1.MonitorsApi.ListMonitors(authV1) + optionalParams := datadogV1.NewListMonitorsOptionalParameters() resources := []terraformutils.Resource{} for _, filter := range g.Filter { if filter.FieldPath == "id" && filter.IsApplicable("monitor") { @@ -75,7 +75,7 @@ func (g *MonitorGenerator) InitResources() error { return err } - monitor, _, err := datadogClientV1.MonitorsApi.GetMonitor(authV1, i).Execute() + monitor, _, err := datadogClientV1.MonitorsApi.GetMonitor(authV1, i) if err != nil { return err } @@ -84,7 +84,7 @@ func (g *MonitorGenerator) InitResources() error { } } if filter.FieldPath == "tags" && filter.IsApplicable("monitor") { - dclient = dclient.MonitorTags(strings.Join(filter.AcceptableValues, ",")) + optionalParams.WithMonitorTags(strings.Join(filter.AcceptableValues, ",")) } } @@ -97,7 +97,9 @@ func (g *MonitorGenerator) InitResources() error { pageSize := int32(1000) pageNumber := int64(0) for { - resp, _, err := dclient.PageSize(pageSize).Page(pageNumber).Execute() + resp, _, err := datadogClientV1.MonitorsApi.ListMonitors(authV1, *optionalParams. + WithPageSize(pageSize). + WithPage(pageNumber)) if err != nil { return err } diff --git a/providers/datadog/role.go b/providers/datadog/role.go index 9019cf4f1e..2008b6fffc 100644 --- a/providers/datadog/role.go +++ b/providers/datadog/role.go @@ -68,7 +68,9 @@ func (g *RoleGenerator) InitResources() error { var roles []datadogV2.Role for remaining > int64(0) { - resp, _, err := datadogClientV2.RolesApi.ListRoles(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + resp, _, err := datadogClientV2.RolesApi.ListRoles(authV2, *datadogV2.NewListRolesOptionalParameters(). + WithPageSize(pageSize). + WithPageNumber(pageNumber)) if err != nil { return err } diff --git a/providers/datadog/security_monitoring_default_rule.go b/providers/datadog/security_monitoring_default_rule.go index 0ddea3bc1e..67a30a93a9 100644 --- a/providers/datadog/security_monitoring_default_rule.go +++ b/providers/datadog/security_monitoring_default_rule.go @@ -69,7 +69,10 @@ func (g *SecurityMonitoringDefaultRuleGenerator) InitResources() error { remaining := int64(1) for remaining > int64(0) { - resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2, + *datadogV2.NewListSecurityMonitoringRulesOptionalParameters(). + WithPageSize(pageSize). + WithPageNumber(pageNumber)) if err != nil { return err } diff --git a/providers/datadog/security_monitoring_rule.go b/providers/datadog/security_monitoring_rule.go index b6322b6809..fe0e6744b8 100644 --- a/providers/datadog/security_monitoring_rule.go +++ b/providers/datadog/security_monitoring_rule.go @@ -74,7 +74,10 @@ func (g *SecurityMonitoringRuleGenerator) InitResources() error { remaining := int64(1) for remaining > int64(0) { - resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + resp, _, err := datadogClientV2.SecurityMonitoringApi.ListSecurityMonitoringRules(authV2, + *datadogV2.NewListSecurityMonitoringRulesOptionalParameters(). + WithPageNumber(pageNumber). + WithPageSize(pageSize)) if err != nil { return err } diff --git a/providers/datadog/service_level_objective.go b/providers/datadog/service_level_objective.go index 45a93a1aae..7ed4c503cd 100644 --- a/providers/datadog/service_level_objective.go +++ b/providers/datadog/service_level_objective.go @@ -61,7 +61,7 @@ func (g *ServiceLevelObjectiveGenerator) InitResources() error { authV1 := g.Args["authV1"].(context.Context) var slos []datadogV1.ServiceLevelObjective - resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.ListSLOs(authV1).Execute() + resp, _, err := datadogClientV1.ServiceLevelObjectivesApi.ListSLOs(authV1) if err != nil { return err } diff --git a/providers/datadog/synthetics_global_variable.go b/providers/datadog/synthetics_global_variable.go index 469e14f54b..4fcccb4ad4 100644 --- a/providers/datadog/synthetics_global_variable.go +++ b/providers/datadog/synthetics_global_variable.go @@ -65,7 +65,7 @@ func (g *SyntheticsGlobalVariableGenerator) InitResources() error { for _, filter := range g.Filter { if filter.FieldPath == "id" && filter.IsApplicable("synthetics_global_variable") { for _, v := range filter.AcceptableValues { - resp, _, err := datadogClientV1.SyntheticsApi.GetGlobalVariable(authV1, v).Execute() + resp, _, err := datadogClientV1.SyntheticsApi.GetGlobalVariable(authV1, v) if err != nil { log.Printf("error retrieving synthetics gloval variable with id:%s - %s", v, err) continue diff --git a/providers/datadog/synthetics_private_location.go b/providers/datadog/synthetics_private_location.go index 693885b485..a46b4eebdf 100644 --- a/providers/datadog/synthetics_private_location.go +++ b/providers/datadog/synthetics_private_location.go @@ -63,7 +63,7 @@ func (g *SyntheticsPrivateLocationGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) - data, _, err := datadogClientV1.SyntheticsApi.ListLocations(authV1).Execute() + data, _, err := datadogClientV1.SyntheticsApi.ListLocations(authV1) if err != nil { return err } diff --git a/providers/datadog/synthetics.go b/providers/datadog/synthetics_test_.go similarity index 84% rename from providers/datadog/synthetics.go rename to providers/datadog/synthetics_test_.go index 427aec9f76..a8659006cf 100644 --- a/providers/datadog/synthetics.go +++ b/providers/datadog/synthetics_test_.go @@ -28,12 +28,12 @@ var ( SyntheticsAllowEmptyValues = []string{"tags."} ) -// SyntheticsGenerator ... -type SyntheticsGenerator struct { +// SyntheticsTestGenerator ... +type SyntheticsTestGenerator struct { DatadogService } -func (g *SyntheticsGenerator) createResources(syntheticsList []datadogV1.SyntheticsTestDetails) []terraformutils.Resource { +func (g *SyntheticsTestGenerator) createResources(syntheticsList []datadogV1.SyntheticsTestDetails) []terraformutils.Resource { resources := []terraformutils.Resource{} for _, synthetics := range syntheticsList { resourceName := synthetics.GetPublicId() @@ -43,7 +43,7 @@ func (g *SyntheticsGenerator) createResources(syntheticsList []datadogV1.Synthet return resources } -func (g *SyntheticsGenerator) createResource(syntheticsID string) terraformutils.Resource { +func (g *SyntheticsTestGenerator) createResource(syntheticsID string) terraformutils.Resource { return terraformutils.NewSimpleResource( syntheticsID, fmt.Sprintf("synthetics_%s", syntheticsID), @@ -56,15 +56,15 @@ func (g *SyntheticsGenerator) createResource(syntheticsID string) terraformutils // InitResources Generate TerraformResources from Datadog API, // from each synthetics create 1 TerraformResource. // Need Synthetics ID as ID for terraform resource -func (g *SyntheticsGenerator) InitResources() error { +func (g *SyntheticsTestGenerator) InitResources() error { datadogClientV1 := g.Args["datadogClientV1"].(*datadogV1.APIClient) authV1 := g.Args["authV1"].(context.Context) resources := []terraformutils.Resource{} for _, filter := range g.Filter { - if filter.FieldPath == "id" && filter.IsApplicable("synthetics") { + if filter.FieldPath == "id" && filter.IsApplicable("synthetics_test") { for _, value := range filter.AcceptableValues { - syntheticsTest, _, err := datadogClientV1.SyntheticsApi.GetTest(authV1, value).Execute() + syntheticsTest, _, err := datadogClientV1.SyntheticsApi.GetTest(authV1, value) if err != nil { return err } @@ -79,7 +79,7 @@ func (g *SyntheticsGenerator) InitResources() error { return nil } - syntheticsTests, _, err := datadogClientV1.SyntheticsApi.ListTests(authV1).Execute() + syntheticsTests, _, err := datadogClientV1.SyntheticsApi.ListTests(authV1) if err != nil { return err } diff --git a/providers/datadog/user.go b/providers/datadog/user.go index 6e0af1a49d..5aaebaba92 100644 --- a/providers/datadog/user.go +++ b/providers/datadog/user.go @@ -17,6 +17,7 @@ package datadog import ( "context" "fmt" + "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -66,16 +67,25 @@ func (g *UserGenerator) createResource(userID string) terraformutils.Resource { // Need User ID as ID for terraform resource func (g *UserGenerator) InitResources() error { var users []datadogV2.User - datadogClientV2 := g.Args["datadogClientV2"].(*datadogV2.APIClient) authV2 := g.Args["authV2"].(context.Context) pageSize := int64(1000) pageNumber := int64(0) remaining := int64(1) + optionalParams := datadogV2.NewListUsersOptionalParameters() + for _, filter := range g.Filter { + if filter.IsApplicable("user") && filter.FieldPath == "disabled" { + if len(filter.AcceptableValues) == 1 && strings.ToLower(filter.AcceptableValues[0]) == "false" { + optionalParams = optionalParams.WithFilterStatus("Active,Pending") + } + } + } for remaining > int64(0) { - resp, _, err := datadogClientV2.UsersApi.ListUsers(authV2).PageSize(pageSize).PageNumber(pageNumber).Execute() + resp, _, err := datadogClientV2.UsersApi.ListUsers(authV2, *optionalParams. + WithPageSize(pageSize). + WithPageNumber(pageNumber)) if err != nil { return err } From 5b559ecc5495fff7b53a2775d1a491efe4121885 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 07:57:35 +0300 Subject: [PATCH 186/276] Bump github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs (#923) Bumps [github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs](https://github.com/aws/aws-sdk-go-v2) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/pi/v1.2.2...service/pi/v1.2.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 27ddec6c32..df63bb92ac 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go-v2 v1.3.2 + github.com/aws/aws-sdk-go-v2 v1.4.0 github.com/aws/aws-sdk-go-v2/config v1.1.4 github.com/aws/aws-sdk-go-v2/credentials v1.1.4 github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 @@ -37,7 +37,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.2.1 github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0 github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0 - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.2 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.3 github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1 github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.3 github.com/aws/aws-sdk-go-v2/service/codedeploy v1.2.1 diff --git a/go.sum b/go.sum index 90abaf7c8d..2716a16bb2 100644 --- a/go.sum +++ b/go.sum @@ -172,8 +172,9 @@ github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPI github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go-v2 v1.3.0/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+testmuQeRY= github.com/aws/aws-sdk-go-v2 v1.3.1/go.mod h1:5SmWRTjN6uTRFNCc7rR69xHsdcUJnthmaRHGDsYhpTE= -github.com/aws/aws-sdk-go-v2 v1.3.2 h1:RQj8l98yKUm0UV2Wd3w/Ms+TXV9Rs1E6Kr5tRRMfyU4= github.com/aws/aws-sdk-go-v2 v1.3.2/go.mod h1:7OaACgj2SX3XGWnrIjGlJM22h6yD6MEWKvm7levnnM8= +github.com/aws/aws-sdk-go-v2 v1.4.0 h1:Ryh4fNebT9SwLyCKPSk83dyEZj+KB6KzDyb1gXii7EI= +github.com/aws/aws-sdk-go-v2 v1.4.0/go.mod h1:tI4KhsR5VkzlUa2DZAdwx7wCAYGwkZZ1H31PYrBFx1w= github.com/aws/aws-sdk-go-v2/config v1.1.4 h1:2hjdDldmJJjb+rFieQySfOFt4WwxKZJVTEB6RBI74T4= github.com/aws/aws-sdk-go-v2/config v1.1.4/go.mod h1:op05ummoVoAqctpA80jVt/+hvEtLfuKmDyx0bIuvfbE= github.com/aws/aws-sdk-go-v2/credentials v1.1.4 h1:whYYw2srG+zUQzUw4LhML83f+xd22Vm7gv0I7aJglc8= @@ -206,8 +207,8 @@ github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0 h1:fyDRD5nYw4WlTQpX7p5Mjt github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.3.0/go.mod h1:2qNhOhvtzQHNKkwipEb/n95O4pAfJy4ObXv0n+Ldkn8= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0 h1:gXHyajuXD6lC4iaznrJcFzxOyg0E7f94MpRKmJ4hwvU= github.com/aws/aws-sdk-go-v2/service/cloudwatchevents v1.2.0/go.mod h1:oqhgyu/GPZZpma8mHoiUhqSwx2gSlxjccE9Lny3RR2g= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.2 h1:n0upYlo6IRQI7WwoThLTDziit6r4zo2oWNB8AY28rdE= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.2/go.mod h1:d7EGzmjLiXW+mk2OnkanXsrGQ6PuPRwouhxLjjRbO30= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.3 h1:Nndr+JIWrHV7VZOYPvRfI0teEDxRXQuZ/IsPalo8Zg0= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.2.3/go.mod h1:SMDBeigW7S6RmOMSAwbukEb5JM5WHwUOvNOzZXDXRR4= github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1 h1:Kn8KgAStqC7/FMP927qsWUUQJH9gw/ubKTuMqyKUpds= github.com/aws/aws-sdk-go-v2/service/codebuild v1.2.1/go.mod h1:n5wJZmnZAZxSQDf7CnNpyTCOP9cjTGsmH1xkCs8Giy4= github.com/aws/aws-sdk-go-v2/service/codecommit v1.1.3 h1:Fw5BXP0L4PNdneYOv0B2znzErlgj70QNEc7HIjwJrUs= @@ -324,8 +325,9 @@ github.com/aws/aws-sdk-go-v2/service/xray v1.2.1 h1:RiTWbH90tIuJNnZZys9HeqBfpT3o github.com/aws/aws-sdk-go-v2/service/xray v1.2.1/go.mod h1:MZS769M8/1Xm4XYQydDJbvugo7dG8fXzsVU3J84QXzY= github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.3.1 h1:xJFO4pK0y9J8fCl34uGsSJX5KNnGbdARDlA5BPhXnwE= github.com/aws/smithy-go v1.3.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.4.0 h1:3rsQpgRe+OoQgJhEwGNpIkosl0fJLdmQqF4gSFRjg+4= +github.com/aws/smithy-go v1.4.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= From fe17310bbb934d01c2b8378707884184e5d48336 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 07:57:48 +0300 Subject: [PATCH 187/276] Bump github.com/aws/aws-sdk-go-v2/service/autoscaling (#922) Bumps [github.com/aws/aws-sdk-go-v2/service/autoscaling](https://github.com/aws/aws-sdk-go-v2) from 1.2.1 to 1.3.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.2.1...v1.3.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index df63bb92ac..6356208dc1 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/acm v1.2.1 github.com/aws/aws-sdk-go-v2/service/apigateway v1.2.1 github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1 - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.2.1 + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.3.1 github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3 github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0 diff --git a/go.sum b/go.sum index 2716a16bb2..6fb72e3e05 100644 --- a/go.sum +++ b/go.sum @@ -189,8 +189,8 @@ github.com/aws/aws-sdk-go-v2/service/apigateway v1.2.1 h1:2kxNxcT9QVSckqagWevdNO github.com/aws/aws-sdk-go-v2/service/apigateway v1.2.1/go.mod h1:4fO3jaFTaz/8ygZBVNSk4NSdAwcc/NZ++HUrG9kpJ0I= github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1 h1:qHxx2jl6nI6Sn5fuXtBQVWbhaG+fErDAB47BHm+Kw1A= github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1/go.mod h1:JkdNL71yKS0qmF+dFJJzxf1WJZWFGIhTepXHaxtKipE= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.2.1 h1:imL02JGNApN3z+9u/meTDeZF37QfpqRmrDnGghGNFvY= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.2.1/go.mod h1:bOqVTdQoE8zqisF2vwsiZxZLxLDCOjOvfFohzXsJ/vE= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.3.1 h1:fQkypDE1Ll/W61tm8GoswgLjWfO8y1f50yXw5lA4uFo= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.3.1/go.mod h1:DVmOqpa3F7vhAuGfs2zse1f3N3mX64hCimRNSYiqnKE= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3 h1:P2IXGUpF2t6gwy3QTPB82/wFarHkX6WVsHWs7nfaVWY= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3/go.mod h1:1NXNu5eiAZbLx6bK0Ir2X4MBXBO6JSMaPN3mdRaYZqo= github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 h1:I2V5IX5pwXq/+TL5QeDcoq4MIcFgzQ/yxbf5KTEqm4Q= From 9070a0b889caee93d47dff0da78beaafb3cbcea6 Mon Sep 17 00:00:00 2001 From: Pierre Erraud Date: Thu, 27 May 2021 17:45:58 +0200 Subject: [PATCH 188/276] Add panos provider (#939) * feat: add panos provider * feat: debug Terraform Panos Provider import problems... --- README.md | 2 + cmd/provider_cmd_panos.go | 91 +++ cmd/root.go | 1 + docs/panos.md | 80 +++ go.mod | 1 + go.sum | 10 +- providers/panos/device_config.go | 101 ++++ providers/panos/firewall_networking.go | 750 +++++++++++++++++++++++++ providers/panos/firewall_objects.go | 312 ++++++++++ providers/panos/firewall_policy.go | 111 ++++ providers/panos/helpers.go | 129 +++++ providers/panos/panos_provider.go | 94 ++++ providers/panos/panos_service.go | 39 ++ 13 files changed, 1715 insertions(+), 6 deletions(-) create mode 100644 cmd/provider_cmd_panos.go create mode 100644 docs/panos.md create mode 100644 providers/panos/device_config.go create mode 100644 providers/panos/firewall_networking.go create mode 100644 providers/panos/firewall_objects.go create mode 100644 providers/panos/firewall_policy.go create mode 100644 providers/panos/helpers.go create mode 100644 providers/panos/panos_provider.go create mode 100644 providers/panos/panos_service.go diff --git a/README.md b/README.md index 50d1fbeb0a..0fa004c7a2 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [RabbitMQ](/docs/rabbitmq.md) * Network * [Cloudflare](/docs/cloudflare.md) + * [PAN-OS](/docs/panos.md) * VCS * [GitHub](/docs/github.md) * Monitoring & System Management @@ -262,6 +263,7 @@ Links to download Terraform Providers: * Cloudflare provider >1.16 - [here](https://releases.hashicorp.com/terraform-provider-cloudflare/) * Fastly provider >0.16.1 - [here](https://releases.hashicorp.com/terraform-provider-fastly/) * NS1 provider >1.8.3 - [here](https://releases.hashicorp.com/terraform-provider-ns1/) + * PAN-OS provider >= 1.8.3 - [here](https://github.com/PaloAltoNetworks/terraform-provider-panos) * VCS * GitHub provider >=2.2.1 - [here](https://releases.hashicorp.com/terraform-provider-github/) * Monitoring & System Management diff --git a/cmd/provider_cmd_panos.go b/cmd/provider_cmd_panos.go new file mode 100644 index 0000000000..db3b8c11d7 --- /dev/null +++ b/cmd/provider_cmd_panos.go @@ -0,0 +1,91 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "log" + "os" + "strings" + + panos_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/panos" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +const ( + defaultPanosHostname = "192.168.1.1" + defaultPanosUsername = "admin" + defaultPanosPassword = "admin" +) + +func newCmdPanosImporter(options ImportOptions) *cobra.Command { + vsys := []string{} + cmd := &cobra.Command{ + Use: "panos", + Short: "Import current state to Terraform configuration from a PAN-OS", + Long: "Import current state to Terraform configuration from a PAN-OS", + RunE: func(cmd *cobra.Command, args []string) error { + hostname := os.Getenv("PANOS_HOSTNAME") + if len(hostname) == 0 { + hostname = defaultPanosHostname + } + + username := os.Getenv("PANOS_USERNAME") + if len(username) == 0 { + username = defaultPanosUsername + } + + password := os.Getenv("PANOS_PASSWORD") + if len(password) == 0 { + password = defaultPanosPassword + } + + if len(vsys) == 0 { + var err error + + vsys, err = panos_terraforming.GetVsysList(hostname, username, password) + if err != nil { + return err + } + } + + originalPathPattern := options.PathPattern + for _, v := range vsys { + provider := newPanosProvider() + log.Println(provider.GetName() + " importing VSYS " + v) + options.PathPattern = originalPathPattern + options.PathPattern = strings.ReplaceAll(options.PathPattern, "{provider}", "{provider}/"+v) + + err := Import(provider, options, []string{hostname, username, password, v}) + if err != nil { + return err + } + } + + return nil + }, + } + + cmd.AddCommand(listCmd(newPanosProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "device_config,firewall_networking,firewall_objects", "") + cmd.PersistentFlags().StringSliceVarP(&vsys, "vsys", "", []string{}, "") + + return cmd +} + +func newPanosProvider() terraformutils.ProviderGenerator { + + return &panos_terraforming.PanosProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index 8eabd3b01d..1ecb0eab2d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -61,6 +61,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdCloudflareImporter, newCmdFastlyImporter, newCmdNs1Importer, + newCmdPanosImporter, // VCS newCmdGithubImporter, // Monitoring & System Management diff --git a/docs/panos.md b/docs/panos.md new file mode 100644 index 0000000000..47094d4bfd --- /dev/null +++ b/docs/panos.md @@ -0,0 +1,80 @@ +### Use with PAN-OS + +Example: + +``` + export PANOS_HOSTNAME=192.168.1.1 + export PANOS_USERNAME=[PANOS_USERNAME] + export PANOS_PASSWORD=[PANOS_PASSWORD] + + terraformer import panos --resources=device_config,firewall_networking,firewall_objects,firewall_policy +``` +Here is the list of resources which are currently supported: + +* `device_config` + * `panos_general_settings` + * `panos_telemetry` + * `panos_email_server_profile` + * `panos_http_server_profile` + * `panos_snmptrap_server_profile` + * `panos_syslog_server_profile` +* `firewall_networking` + * `panos_aggregate_interface` + * `panos_bfd_profile` + * `panos_bgp` + * `panos_bgp_aggregate` + * `panos_bgp_aggregate_advertise_filter` + * `panos_bgp_aggregate_suppress_filter` + * `panos_bgp_auth_profile` # The secret argument will contain "(incorrect)" + * `panos_bgp_conditional_adv` + * `panos_bgp_conditional_adv_advertise_filter` + * `panos_bgp_conditional_adv_non_exist_filter` + * `panos_bgp_dampening_profile` + * `panos_bgp_export_rule_group` + * `panos_bgp_import_rule_group` + * `panos_bgp_peer` + * `panos_bgp_peer_group` + * `panos_bgp_redist_rule` + * `panos_ethernet_interface` + * `panos_gre_tunnel` + * `panos_ike_crypto_profile` + * `panos_ike_gateway` + * `panos_ipsec_crypto_profile` + * `panos_ipsec_tunnel` + * `panos_ipsec_tunnel_proxy_id_ipv4` + * `panos_layer2_subinterface` + * `panos_layer3_subinterface` + * `panos_loopback_interface` + * `panos_management_profile` + * `panos_monitor_profile` + * `panos_redistribution_profile` + * `panos_static_route_ipv4` + * `panos_tunnel_interface` + * `panos_virtual_router` + * `panos_vlan` + * `panos_vlan_interface` + * `panos_zone` +* `firewall_objects` + * `panos_address_group` + * `panos_administrative_tag` + * `panos_application_group` + * `panos_application_object` + * `panos_edl` + * `panos_log_forwarding_profile` + * `panos_service_group` + * `panos_service_object` + * `panos_address_object` + * `panos_anti_spyware_security_profile` + * `panos_antivirus_security_profile` + * `panos_custom_data_pattern_object` + * `panos_data_filtering_security_profile` + * `panos_dos_protection_profile` + * `panos_dynamic_user_group` + * `panos_file_blocking_security_profile` + * `panos_url_filtering_security_profile` + * `panos_vulnerability_security_profile` + * `panos_wildfire_analysis_security_profile` +* `firewall_policy` + * `panos_nat_rule_group` + * `panos_pbf_rule_group` + * `panos_security_rule_group` diff --git a/go.mod b/go.mod index 6356208dc1..df38b772af 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/IBM/networking-go-sdk v0.13.0 github.com/IBM/vpc-go-sdk v0.4.1 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 + github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 diff --git a/go.sum b/go.sum index 6fb72e3e05..08539b5129 100644 --- a/go.sum +++ b/go.sum @@ -87,8 +87,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.18 h1:4i51yRTWm8SEuc9iRxxFicm59jQcAo70v+3ddZhEq8Q= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.18/go.mod h1:Gn0fZwIOBbSidO0OaPEh9nO5EmIPsxJrHfHvfVXEaoU= github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 h1:VwdZv6Mm4d7Jx9qawTNM6FlShdlE1d/J+64X3Izd574= github.com/DataDog/datadog-api-client-go v1.0.0-beta.20/go.mod h1:T4YUFSUXoBbhxY5qq5V/1llk5U1o6vTjYFS3dk3uH74= github.com/DataDog/datadog-go v4.4.0+incompatible h1:R7WqXWP4fIOAqWJtUKmSfuc7eDsBT58k9AY5WSHVosk= @@ -117,6 +115,8 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c h1:4uQRvqtOkn0n4zb9BbYHhXzAmWDd25T6TfnE5I5gpFg= +github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c/go.mod h1:xpwEKL6CHhniRcqKYTjIiGBzPd3QIyto3sz2ynsP1qg= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= @@ -427,8 +427,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= -github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786 h1:upeQpV8AFGWxWvlu2LpJojgvWOU2SyiG+XvYerMGaCw= -github.com/go-bdd/gobdd v1.1.3-0.20210205100305-4910f932a786/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= +github.com/go-bdd/gobdd v1.1.3 h1:eirGvZ9gMz6clOo2k6O7+Ys3iHAaFZoRQXVwV76B3JI= github.com/go-bdd/gobdd v1.1.3/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -1445,8 +1444,7 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484 h1:gv8e5qO2QJPaYAcGrgu4jex1zo4IlxKxzmUSQ++sufQ= -gopkg.in/DataDog/dd-trace-go.v1 v1.29.0-rc.1.0.20210226170446-a8dc39ec3484/go.mod h1:H9vSLD4Qlnl3rH2fUT6jyP9qwq1lDo0ikaDqSJo8t/U= +gopkg.in/DataDog/dd-trace-go.v1 v1.30.0-rc.1.0.20210420124628-f63633f38e8f h1:LmMng8lsMr7BkXin76L6+LsUFr1GSnmySvO5LaR6rhc= gopkg.in/DataDog/dd-trace-go.v1 v1.30.0-rc.1.0.20210420124628-f63633f38e8f/go.mod h1:I3nUNop4UZaHSj2C2OBCHezmsQIHczbUps8nHgw/HXs= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/providers/panos/device_config.go b/providers/panos/device_config.go new file mode 100644 index 0000000000..ea81d970a0 --- /dev/null +++ b/providers/panos/device_config.go @@ -0,0 +1,101 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type DeviceConfigGenerator struct { + PanosService +} + +func (g *DeviceConfigGenerator) createSimpleResource(hostname, terraformResourceName string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + hostname, + normalizeResourceName(hostname), + terraformResourceName, + "panos", + []string{}, + ) +} + +func (g *DeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix, terraformResourceName string) (resources []terraformutils.Resource) { + l, err := o.i.(getListWithOneArg).GetList(o.params[0]) + if err != nil { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := idPrefix + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(r), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + +func (g *DeviceConfigGenerator) createEmailServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.Device.EmailServerProfile, []string{g.vsys}}, + g.vsys+":", "panos_email_server_profile", + ) +} + +func (g *DeviceConfigGenerator) createHTTPServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.Device.HttpServerProfile, []string{g.vsys}}, + g.vsys+":", "panos_http_server_profile", + ) +} + +func (g *DeviceConfigGenerator) createSNMPTrapServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.Device.SnmpServerProfile, []string{g.vsys}}, + g.vsys+":", "panos_snmptrap_server_profile", + ) +} + +func (g *DeviceConfigGenerator) createSyslogServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.Device.SyslogServerProfile, []string{g.vsys}}, + g.vsys+":", "panos_syslog_server_profile", + ) +} + +func (g *DeviceConfigGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + if g.vsys == "vsys1" { + g.vsys = "shared" + } + + generalConfig, err := g.client.Device.GeneralSettings.Get() + if err != nil { + return err + } + + g.Resources = append(g.Resources, g.createSimpleResource(generalConfig.Hostname, "panos_general_settings")) + g.Resources = append(g.Resources, g.createSimpleResource(generalConfig.Hostname, "panos_telemetry")) + g.Resources = append(g.Resources, g.createEmailServerProfileResources()...) + g.Resources = append(g.Resources, g.createHTTPServerProfileResources()...) + g.Resources = append(g.Resources, g.createSNMPTrapServerProfileResources()...) + g.Resources = append(g.Resources, g.createSyslogServerProfileResources()...) + + return nil +} diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go new file mode 100644 index 0000000000..fcbe15365c --- /dev/null +++ b/providers/panos/firewall_networking.go @@ -0,0 +1,750 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango/netw/interface/eth" + "github.com/PaloAltoNetworks/pango/netw/interface/subinterface/layer2" + "github.com/PaloAltoNetworks/pango/netw/interface/subinterface/layer3" + "github.com/PaloAltoNetworks/pango/util" +) + +type FirewallNetworkingGenerator struct { + PanosService +} + +func (g *FirewallNetworkingGenerator) createResourcesFromList(o getGeneric, idPrefix string, useIDForResourceName bool, terraformResourceName string, checkIfIsVsys bool, checkType string) (resources []terraformutils.Resource) { + var l []string + var err error + + switch f := o.i.(type) { + case getListWithoutArg: + l, err = f.GetList() + case getListWithOneArg: + l, err = f.GetList(o.params[0]) + case getListWithTwoArgs: + l, err = f.GetList(o.params[0], o.params[1]) + case getListWithThreeArgs: + l, err = f.GetList(o.params[0], o.params[1], o.params[2]) + default: + err = fmt.Errorf("not supported") + } + if err != nil { + return []terraformutils.Resource{} + } + + for _, r := range l { + if checkIfIsVsys { + rv, err := g.client.IsImported(checkType, "", "", g.vsys, r) + if err != nil || !rv { + continue + } + } + + id := idPrefix + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(func() string { + if useIDForResourceName { + return id + } + + return r + }()), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createAggregateInterfaceResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.AggregateInterface.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, aggregateInterface := range l { + rv, err := g.client.IsImported(util.InterfaceImport, "", "", g.vsys, aggregateInterface) + if err != nil || !rv { + continue + } + + id := g.vsys + ":" + aggregateInterface + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(aggregateInterface), + "panos_aggregate_interface_", + "panos", + []string{}, + )) + + e, err := g.client.Network.AggregateInterface.Get(aggregateInterface) + if err != nil { + continue + } + + if e.Mode == eth.ModeLayer2 || e.Mode == eth.ModeVirtualWire { + g.Resources = append(g.Resources, g.createLayer2SubInterfaceResources(layer2.AggregateInterface, aggregateInterface, e.Mode)...) + } + + if e.Mode == eth.ModeLayer3 { + g.Resources = append(g.Resources, g.createLayer3SubInterfaceResources(layer3.AggregateInterface, aggregateInterface)...) + } + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createBFDProfileResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BfdProfile, []string{}}, + "", false, "panos_bfd_profile", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPResource(virtualRouter string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + virtualRouter, + normalizeResourceName(virtualRouter), + "panos_bgp", + "panos", + []string{}, + ) +} + +func (g *FirewallNetworkingGenerator) createBGPAggregateResources(virtualRouter string) (resources []terraformutils.Resource) { + l, err := g.client.Network.BgpAggregate.GetList(virtualRouter) + if err != nil { + return []terraformutils.Resource{} + } + + for _, bgpAggregate := range l { + id := virtualRouter + ":" + bgpAggregate + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_bgp_aggregate", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPAggregateAdvertiseFilterResources(virtualRouter, bgpAggregate)...) + resources = append(resources, g.createBGPAggregateSuppressFilterResources(virtualRouter, bgpAggregate)...) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createBGPAggregateAdvertiseFilterResources(virtualRouter, bgpAggregate string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpAggAdvertiseFilter, []string{virtualRouter, bgpAggregate}}, + virtualRouter+":"+bgpAggregate+":", true, "panos_bgp_aggregate_advertise_filter", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPAggregateSuppressFilterResources(virtualRouter, bgpAggregate string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpAggSuppressFilter, []string{virtualRouter, bgpAggregate}}, + virtualRouter+":"+bgpAggregate+":", true, "panos_bgp_aggregate_suppress_filter", false, "", + ) +} + +// The secret argument will contain "(incorrect)", not the real value +func (g *FirewallNetworkingGenerator) createBGPAuthProfileResources(virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpAuthProfile, []string{virtualRouter}}, + virtualRouter+":", true, "panos_bgp_auth_profile", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPConditionalAdvertisementResources(virtualRouter string) (resources []terraformutils.Resource) { + l, err := g.client.Network.BgpConditionalAdv.GetList(virtualRouter) + if err != nil { + return []terraformutils.Resource{} + } + + for _, bgpConditionalAdv := range l { + id := virtualRouter + ":" + bgpConditionalAdv + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_bgp_conditional_adv", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPConditionalAdvertisementAdvertiseFilterResources(virtualRouter, bgpConditionalAdv)...) + resources = append(resources, g.createBGPConditionalAdvertisementNonExistFilterResources(virtualRouter, bgpConditionalAdv)...) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createBGPConditionalAdvertisementAdvertiseFilterResources(virtualRouter, bgpConditionalAdv string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpConAdvAdvertiseFilter, []string{virtualRouter, bgpConditionalAdv}}, + virtualRouter+":"+bgpConditionalAdv+":", true, "panos_bgp_conditional_adv_advertise_filter", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPConditionalAdvertisementNonExistFilterResources(virtualRouter, bgpConditionalAdv string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpConAdvNonExistFilter, []string{virtualRouter, bgpConditionalAdv}}, + virtualRouter+":"+bgpConditionalAdv+":", true, "panos_bgp_conditional_adv_non_exist_filter", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPDampeningProfileResources(virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpDampeningProfile, []string{virtualRouter}}, + virtualRouter+":", true, "panos_bgp_dampening_profile", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPExportRuleGroupResources(virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpExport, []string{virtualRouter}}, + virtualRouter+":", true, "panos_bgp_export_rule_group", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPImportRuleGroupResources(virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpImport, []string{virtualRouter}}, + virtualRouter+":", true, "panos_bgp_import_rule_group", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPPeerGroupResources(virtualRouter string) (resources []terraformutils.Resource) { + l, err := g.client.Network.BgpPeerGroup.GetList(virtualRouter) + if err != nil { + return []terraformutils.Resource{} + } + + for _, bgpPeerGroup := range l { + id := virtualRouter + ":" + bgpPeerGroup + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_bgp_peer_group", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPPeerResources(virtualRouter, bgpPeerGroup)...) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createBGPPeerResources(virtualRouter, bgpPeerGroup string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpPeer, []string{virtualRouter, bgpPeerGroup}}, + virtualRouter+":"+bgpPeerGroup+":", true, "panos_bgp_peer", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createBGPRedistResources(virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.BgpRedistRule, []string{virtualRouter}}, + virtualRouter+":", true, "panos_bgp_redist_rule", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createEthernetInterfaceResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.EthernetInterface.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, ethernetInterface := range l { + rv, err := g.client.IsImported(util.InterfaceImport, "", "", g.vsys, ethernetInterface) + if err != nil || !rv { + continue + } + + id := g.vsys + ":" + ethernetInterface + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(ethernetInterface), + "panos_ethernet_interface", + "panos", + []string{}, + )) + + e, err := g.client.Network.EthernetInterface.Get(ethernetInterface) + if err != nil { + continue + } + + if e.Mode == eth.ModeLayer2 || e.Mode == eth.ModeVirtualWire { + g.Resources = append(g.Resources, g.createLayer2SubInterfaceResources(layer2.EthernetInterface, ethernetInterface, e.Mode)...) + } + + if e.Mode == eth.ModeLayer3 { + g.Resources = append(g.Resources, g.createLayer3SubInterfaceResources(layer3.EthernetInterface, ethernetInterface)...) + } + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createGRETunnelResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.GreTunnel, []string{}}, + "", false, "panos_gre_tunnel", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createIKECryptoProfileResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.IkeCryptoProfile.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, ikeCryptoProfile := range l { + resources = append(resources, terraformutils.NewResource( + ikeCryptoProfile, + normalizeResourceName(ikeCryptoProfile), + "panos_ike_crypto_profile", + "panos", + map[string]string{ + "name": ikeCryptoProfile, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createIKEGatewayResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.IkeGateway.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, ikeGateway := range l { + resources = append(resources, terraformutils.NewResource( + ikeGateway, + normalizeResourceName(ikeGateway), + "panos_ike_gateway", + "panos", + map[string]string{ + "name": ikeGateway, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createIPSECCryptoProfileResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.IpsecCryptoProfile.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, ipsecCryptoProfile := range l { + resources = append(resources, terraformutils.NewResource( + ipsecCryptoProfile, + normalizeResourceName(ipsecCryptoProfile), + "panos_ipsec_crypto_profile", + "panos", + map[string]string{ + "name": ipsecCryptoProfile, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createIPSECTunnelProxyIDIPv4Resources(ipsecTunnel string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.IpsecTunnelProxyId, []string{ipsecTunnel}}, + ipsecTunnel+":", false, "panos_ipsec_tunnel_proxy_id_ipv4", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createIPSECTunnelResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.IpsecTunnel.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, ipsecTunnel := range l { + resources = append(resources, terraformutils.NewSimpleResource( + ipsecTunnel, + normalizeResourceName(ipsecTunnel), + "panos_ipsec_tunnel", + "panos", + []string{}, + )) + + resources = append(resources, g.createIPSECTunnelProxyIDIPv4Resources(ipsecTunnel)...) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createLayer2SubInterfaceResources(interfaceType, parentInterface, parentMode string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.Layer2Subinterface, []string{interfaceType, parentInterface, parentMode}}, + interfaceType+":"+parentInterface+":"+parentMode+":"+g.vsys+":", false, "panos_layer2_subinterface", true, util.InterfaceImport, + ) +} + +func (g *FirewallNetworkingGenerator) createLayer3SubInterfaceResources(interfaceType, parentInterface string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.Layer3Subinterface, []string{interfaceType, parentInterface}}, + interfaceType+":"+parentInterface+":"+g.vsys+":", false, "panos_layer3_subinterface", true, util.InterfaceImport, + ) +} + +func (g *FirewallNetworkingGenerator) createLoopbackInterfaceResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.LoopbackInterface, []string{}}, + g.vsys+":", false, "panos_loopback_interface", true, util.InterfaceImport, + ) +} + +func (g *FirewallNetworkingGenerator) createManagementProfileResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.ManagementProfile.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, managementProfile := range l { + resources = append(resources, terraformutils.NewResource( + managementProfile, + normalizeResourceName(managementProfile), + "panos_management_profile", + "panos", + map[string]string{ + "name": managementProfile, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createMonitorProfileResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.MonitorProfile, []string{}}, + "", false, "panos_monitor_profile", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createRedistributionProfileResources(virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.RedistributionProfile, []string{virtualRouter}}, + virtualRouter+":", true, "panos_redistribution_profile_ipv4", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createStaticRouteIpv4Resources(virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.StaticRoute, []string{virtualRouter}}, + virtualRouter+":", true, "panos_static_route_ipv4", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createTunnelInterfaceResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.TunnelInterface, []string{}}, + g.vsys+":", false, "panos_tunnel_interface", true, util.InterfaceImport, + ) +} + +func (g *FirewallNetworkingGenerator) createVirtualRouterResources() (resources []terraformutils.Resource) { + l, err := g.client.Network.VirtualRouter.GetList() + if err != nil { + return []terraformutils.Resource{} + } + + for _, virtualRouter := range l { + // TODO: doesn't work!!? + // rv, err := g.client.IsImported(util.VirtualRouterImport, "", "", g.vsys, virtualRouter) + // if err != nil || !rv { + // continue + // } + + id := g.vsys + ":" + virtualRouter + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(virtualRouter), + "panos_virtual_router", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPResource(virtualRouter)) + resources = append(resources, g.createBGPAggregateResources(virtualRouter)...) + resources = append(resources, g.createBGPAuthProfileResources(virtualRouter)...) + resources = append(resources, g.createBGPConditionalAdvertisementResources(virtualRouter)...) + resources = append(resources, g.createBGPDampeningProfileResources(virtualRouter)...) + resources = append(resources, g.createBGPExportRuleGroupResources(virtualRouter)...) + resources = append(resources, g.createBGPImportRuleGroupResources(virtualRouter)...) + resources = append(resources, g.createBGPPeerGroupResources(virtualRouter)...) + resources = append(resources, g.createBGPRedistResources(virtualRouter)...) + resources = append(resources, g.createRedistributionProfileResources(virtualRouter)...) + resources = append(resources, g.createStaticRouteIpv4Resources(virtualRouter)...) + } + + return resources +} + +func (g *FirewallNetworkingGenerator) createVlanResources() []terraformutils.Resource { + // TODO: should activate check with util.VlanImport, but doesn't work? + return g.createResourcesFromList( + getGeneric{g.client.Network.Vlan, []string{}}, + g.vsys+":", false, "panos_vlan", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) createVlanInterfaceResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.VlanInterface, []string{}}, + g.vsys+":", false, "panos_vlan_interface", true, util.InterfaceImport, + ) +} + +func (g *FirewallNetworkingGenerator) createZoneResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Network.Zone, []string{g.vsys}}, + g.vsys+":", false, "panos_zone", false, "", + ) +} + +func (g *FirewallNetworkingGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + g.Resources = append(g.Resources, g.createAggregateInterfaceResources()...) + g.Resources = append(g.Resources, g.createBFDProfileResources()...) + g.Resources = append(g.Resources, g.createEthernetInterfaceResources()...) + g.Resources = append(g.Resources, g.createGRETunnelResources()...) + g.Resources = append(g.Resources, g.createIKECryptoProfileResources()...) + g.Resources = append(g.Resources, g.createIKEGatewayResources()...) + g.Resources = append(g.Resources, g.createIPSECCryptoProfileResources()...) + g.Resources = append(g.Resources, g.createIPSECTunnelResources()...) + g.Resources = append(g.Resources, g.createLoopbackInterfaceResources()...) + g.Resources = append(g.Resources, g.createManagementProfileResources()...) + g.Resources = append(g.Resources, g.createMonitorProfileResources()...) + g.Resources = append(g.Resources, g.createTunnelInterfaceResources()...) + g.Resources = append(g.Resources, g.createVirtualRouterResources()...) + g.Resources = append(g.Resources, g.createVlanResources()...) + g.Resources = append(g.Resources, g.createVlanInterfaceResources()...) + g.Resources = append(g.Resources, g.createZoneResources()...) + + return nil +} + +func (g *FirewallNetworkingGenerator) PostConvertHook() error { + mapInterfaceNames := map[string]string{} + mapInterfaceModes := map[string]string{} + mapIKECryptoProfileNames := map[string]string{} + mapIKEGatewayNames := map[string]string{} + mapIPSECCryptoProfileNames := map[string]string{} + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_aggregate_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } + + if r.InstanceInfo.Type == "panos_ethernet_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } + + if r.InstanceInfo.Type == "panos_layer2_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_layer3_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_loopback_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_tunnel_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_vlan_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_ike_crypto_profile" { + mapIKECryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_ike_gateway" { + mapIKEGatewayNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_ipsec_crypto_profile" { + mapIPSECCryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + } + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_bgp" || + r.InstanceInfo.Type == "panos_redistribution_profile_ipv4" || + r.InstanceInfo.Type == "panos_static_route_ipv4" { + r.Item["virtual_router"] = "${panos_virtual_router." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".name}" + } + + if r.InstanceInfo.Type == "panos_bgp_aggregate" || + r.InstanceInfo.Type == "panos_bgp_auth_profile" || + r.InstanceInfo.Type == "panos_bgp_conditional_adv" || + r.InstanceInfo.Type == "panos_bgp_dampening_profile" || + r.InstanceInfo.Type == "panos_bgp_export_rule_group" || + r.InstanceInfo.Type == "panos_bgp_import_rule_group" || + r.InstanceInfo.Type == "panos_bgp_peer_group" || + r.InstanceInfo.Type == "panos_bgp_redist_rule" { + r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + + if r.InstanceInfo.Type == "panos_bgp_aggregate_advertise_filter" || + r.InstanceInfo.Type == "panos_bgp_aggregate_suppress_filter" { + r.Item["virtual_router"] = "${panos_bgp_aggregate." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + r.Item["bgp_aggregate"] = "${panos_bgp_aggregate." + normalizeResourceName(r.Item["bgp_aggregate"].(string)) + ".name}" + } + + if r.InstanceInfo.Type == "panos_bgp_peer" { + r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + r.Item["bgp_peer_group"] = "${panos_bgp_peer_group." + normalizeResourceName(r.Item["panos_bgp_peer_group"].(string)) + ".name}" + r.Item["peer_as"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".as_number}" + } + + if r.InstanceInfo.Type == "panos_bgp_conditional_adv_advertise_filter" || + r.InstanceInfo.Type == "panos_bgp_conditional_adv_non_exist_filter" { + r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + r.Item["bgp_conditional_adv"] = "${panos_bgp_conditional_adv." + normalizeResourceName(r.Item["panos_bgp_conditional_adv"].(string)) + ".name}" + } + + if r.InstanceInfo.Type == "panos_gre_tunnel" { + r.Item["interface"] = mapInterfaceNames[r.Item["interface"].(string)] + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } + + if r.InstanceInfo.Type == "panos_ike_gateway" { + if _, ok := r.Item["ikev1_crypto_profile"]; ok { + r.Item["ikev1_crypto_profile"] = mapIKECryptoProfileNames[r.Item["ikev1_crypto_profile"].(string)] + } + } + + if r.InstanceInfo.Type == "panos_ipsec_tunnel" { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + r.Item["ak_ike_gateway"] = mapIKEGatewayNames[r.Item["ak_ike_gateway"].(string)] + r.Item["ak_ipsec_crypto_profile"] = mapIPSECCryptoProfileNames[r.Item["ak_ipsec_crypto_profile"].(string)] + } + + if r.InstanceInfo.Type == "panos_ipsec_tunnel_proxy_id_ipv4" { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } + + if r.InstanceInfo.Type == "panos_layer2_subinterface" { + if _, ok := mapInterfaceModes[r.Item["parent_interface"].(string)]; ok { + r.Item["parent_mode"] = mapInterfaceModes[r.Item["parent_interface"].(string)] + } + } + + if r.InstanceInfo.Type == "panos_layer2_subinterface" || + r.InstanceInfo.Type == "panos_layer3_subinterface" { + if _, ok := mapInterfaceNames[r.Item["parent_interface"].(string)]; ok { + r.Item["parent_interface"] = mapInterfaceNames[r.Item["parent_interface"].(string)] + } + } + + if r.InstanceInfo.Type == "panos_virtual_router" { + if r.Item["ospfv3_ext_dist"].(string) == "0" { + r.Item["ospfv3_ext_dist"] = "10" + } + + if r.Item["ebgp_dist"].(string) == "0" { + r.Item["ebgp_dist"] = "10" + } + + if r.Item["rip_dist"].(string) == "0" { + r.Item["rip_dist"] = "10" + } + + if r.Item["ibgp_dist"].(string) == "0" { + r.Item["ibgp_dist"] = "10" + } + + if r.Item["static_dist"].(string) == "0" { + r.Item["static_dist"] = "10" + } + + if r.Item["ospf_int_dist"].(string) == "0" { + r.Item["ospf_int_dist"] = "10" + } + + if r.Item["static_ipv6_dist"].(string) == "0" { + r.Item["static_ipv6_dist"] = "10" + } + + if r.Item["ospf_ext_dist"].(string) == "0" { + r.Item["ospf_ext_dist"] = "10" + } + + if r.Item["ospfv3_int_dist"].(string) == "0" { + r.Item["ospfv3_int_dist"] = "10" + } + } + + if r.InstanceInfo.Type == "panos_virtual_router" || + r.InstanceInfo.Type == "panos_zone" { + if _, ok := r.Item["interfaces"]; ok { + interfaces := make([]string, len(r.Item["interfaces"].([]interface{}))) + for k, eth := range r.Item["interfaces"].([]interface{}) { + if name, ok := mapInterfaceNames[eth.(string)]; ok { + interfaces[k] = name + } + } + + r.Item["interfaces"] = interfaces + } + } + + if r.InstanceInfo.Type == "panos_vlan" { + r.Item["vlan_interface"] = mapInterfaceNames[r.Item["vlan_interface"].(string)] + } + } + + return nil +} diff --git a/providers/panos/firewall_objects.go b/providers/panos/firewall_objects.go new file mode 100644 index 0000000000..b2f3b942ff --- /dev/null +++ b/providers/panos/firewall_objects.go @@ -0,0 +1,312 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type FirewallObjectsGenerator struct { + PanosService +} + +func (g *FirewallObjectsGenerator) createResourcesFromList(o getGeneric, idPrefix string, terraformResourceName string) (resources []terraformutils.Resource) { + l, err := o.i.(getListWithOneArg).GetList(o.params[0]) + if err != nil { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := idPrefix + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(r), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + +func (g *FirewallObjectsGenerator) createResourcesFromListWithVsys(o getGeneric, idPrefix string, terraformResourceName string) (resources []terraformutils.Resource) { + l, err := o.i.(getListWithOneArg).GetList(o.params[0]) + if err != nil { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := idPrefix + r + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(r), + terraformResourceName, + "panos", + map[string]string{ + "vsys": g.vsys, + "device_group": "shared", + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *FirewallObjectsGenerator) createAddressGroupResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.AddressGroup, []string{g.vsys}}, + g.vsys+":", "panos_address_group", + ) +} + +func (g *FirewallObjectsGenerator) createAdministrativeTagResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.Tags, []string{g.vsys}}, + g.vsys+":", "panos_administrative_tag", + ) +} + +func (g *FirewallObjectsGenerator) createApplicationGroupResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.AppGroup, []string{g.vsys}}, + g.vsys+":", "panos_application_group", + ) +} + +func (g *FirewallObjectsGenerator) createApplicationObjectResources() (resources []terraformutils.Resource) { + l, err := g.client.Objects.Application.GetList(g.vsys) + if err != nil { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := g.vsys + ":" + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(r), + "panos_application_object", + "panos", + []string{}, + )) + + // TODO: fix + // resources = append(resources, g.createApplicationSignatureResources(r)...) + } + + return resources +} + +// func (g *FirewallObjectsGenerator) createApplicationSignatureResources(applicationObject string) []terraformutils.Resource { +// return g.createResourcesFromList( +// getGeneric{g.client.Objects.AppSignature, []string{g.vsys, applicationObject}}, +// g.vsys+":"+applicationObject+":", "panos_application_signature", +// ) +// } + +func (g *FirewallObjectsGenerator) createEDLResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.Edl, []string{g.vsys}}, + g.vsys+":", "panos_edl", + ) +} + +func (g *FirewallObjectsGenerator) createLogForwardingResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.LogForwardingProfile, []string{g.vsys}}, + g.vsys+":", "panos_log_forwarding_profile", + ) +} + +func (g *FirewallObjectsGenerator) createServiceGroupResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.ServiceGroup, []string{g.vsys}}, + g.vsys+":", "panos_service_group", + ) +} + +func (g *FirewallObjectsGenerator) createServiceObjectResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.Services, []string{g.vsys}}, + g.vsys+":", "panos_service_object", + ) +} + +func (g *FirewallObjectsGenerator) createAddressObjectResources() []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.Objects.Address, []string{g.vsys}}, + g.vsys+":", "panos_address_object", + ) +} + +func (g *FirewallObjectsGenerator) createAntiSpywareSecurityProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.AntiSpywareProfile, []string{g.vsys}}, + g.vsys+":", "panos_anti_spyware_security_profile", + ) +} + +func (g *FirewallObjectsGenerator) createAntivirusSecurityProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.AntivirusProfile, []string{g.vsys}}, + g.vsys+":", "panos_antivirus_security_profile", + ) +} + +func (g *FirewallObjectsGenerator) createCustomDataPatternObjectResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.DataPattern, []string{g.vsys}}, + g.vsys+":", "panos_custom_data_pattern_object", + ) +} + +func (g *FirewallObjectsGenerator) createDataFilteringSecurityProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.DataFilteringProfile, []string{g.vsys}}, + g.vsys+":", "panos_data_filtering_security_profile", + ) +} + +func (g *FirewallObjectsGenerator) createDOSProtectionProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.DosProtectionProfile, []string{g.vsys}}, + g.vsys+":", "panos_dos_protection_profile", + ) +} + +func (g *FirewallObjectsGenerator) createDynamicUserGroupResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.DynamicUserGroup, []string{g.vsys}}, + g.vsys+":", "panos_dynamic_user_group", + ) +} + +func (g *FirewallObjectsGenerator) createFileBlockingSecurityProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.FileBlockingProfile, []string{g.vsys}}, + g.vsys+":", "panos_file_blocking_security_profile", + ) +} + +func (g *FirewallObjectsGenerator) createURLFilteringSecurityProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.UrlFilteringProfile, []string{g.vsys}}, + g.vsys+":", "panos_url_filtering_security_profile", + ) +} + +func (g *FirewallObjectsGenerator) createVulnerabilitySecurityProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.VulnerabilityProfile, []string{g.vsys}}, + g.vsys+":", "panos_vulnerability_security_profile", + ) +} + +func (g *FirewallObjectsGenerator) createWildfireAnalysisSecurityProfileResources() []terraformutils.Resource { + return g.createResourcesFromListWithVsys( + getGeneric{g.client.Objects.WildfireAnalysisProfile, []string{g.vsys}}, + g.vsys+":", "panos_wildfire_analysis_security_profile", + ) +} + +func (g *FirewallObjectsGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + g.Resources = append(g.Resources, g.createAddressGroupResources()...) + g.Resources = append(g.Resources, g.createAdministrativeTagResources()...) + g.Resources = append(g.Resources, g.createApplicationGroupResources()...) + g.Resources = append(g.Resources, g.createApplicationObjectResources()...) + g.Resources = append(g.Resources, g.createEDLResources()...) + g.Resources = append(g.Resources, g.createLogForwardingResources()...) + g.Resources = append(g.Resources, g.createServiceGroupResources()...) + g.Resources = append(g.Resources, g.createServiceObjectResources()...) + + g.Resources = append(g.Resources, g.createAddressObjectResources()...) + g.Resources = append(g.Resources, g.createAntiSpywareSecurityProfileResources()...) + g.Resources = append(g.Resources, g.createAntivirusSecurityProfileResources()...) + g.Resources = append(g.Resources, g.createCustomDataPatternObjectResources()...) + g.Resources = append(g.Resources, g.createDataFilteringSecurityProfileResources()...) + g.Resources = append(g.Resources, g.createDOSProtectionProfileResources()...) + g.Resources = append(g.Resources, g.createDynamicUserGroupResources()...) + g.Resources = append(g.Resources, g.createFileBlockingSecurityProfileResources()...) + g.Resources = append(g.Resources, g.createURLFilteringSecurityProfileResources()...) + g.Resources = append(g.Resources, g.createVulnerabilitySecurityProfileResources()...) + g.Resources = append(g.Resources, g.createWildfireAnalysisSecurityProfileResources()...) + + return nil +} + +func (g *FirewallObjectsGenerator) PostConvertHook() error { + mapAddressObjectIDs := map[string]string{} + mapApplicationObjectIDs := map[string]string{} + mapServiceObjectIDs := map[string]string{} + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_address_object" { + mapAddressObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_application_object" { + mapApplicationObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_service_object" { + mapServiceObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + } + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_address_group" { + if _, ok := r.Item["static_addresses"]; ok { + staticAddresses := make([]string, len(r.Item["static_addresses"].([]interface{}))) + for k, staticAddress := range r.Item["static_addresses"].([]interface{}) { + staticAddresses[k] = mapAddressObjectIDs[staticAddress.(string)] + } + + r.Item["static_addresses"] = staticAddresses + } + } + + if r.InstanceInfo.Type == "panos_application_group" { + if _, ok := r.Item["applications"]; ok { + applications := make([]string, len(r.Item["applications"].([]interface{}))) + for k, application := range r.Item["applications"].([]interface{}) { + if _, ok := mapApplicationObjectIDs[application.(string)]; ok { + applications[k] = mapApplicationObjectIDs[application.(string)] + continue + } + applications[k] = application.(string) + } + + r.Item["applications"] = applications + } + } + + if r.InstanceInfo.Type == "panos_service_group" { + services := make([]string, len(r.Item["services"].([]interface{}))) + for k, service := range r.Item["services"].([]interface{}) { + services[k] = mapServiceObjectIDs[service.(string)] + } + + r.Item["services"] = services + } + } + + return nil +} diff --git a/providers/panos/firewall_policy.go b/providers/panos/firewall_policy.go new file mode 100644 index 0000000000..0826b7c8ec --- /dev/null +++ b/providers/panos/firewall_policy.go @@ -0,0 +1,111 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "encoding/base64" + "strconv" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango/util" +) + +type FirewallPolicyGenerator struct { + PanosService +} + +func (g *FirewallPolicyGenerator) createResourcesFromList(o getGeneric, terraformResourceName string) (resources []terraformutils.Resource) { + l, err := o.i.(getListWithOneArg).GetList(o.params[0]) + if err != nil { + return []terraformutils.Resource{} + } + + var positionReference string + id := g.vsys + ":" + strconv.Itoa(util.MoveTop) + "::" + + for k, r := range l { + if k > 0 { + id = g.vsys + ":" + strconv.Itoa(util.MoveAfter) + ":" + positionReference + ":" + } + + id += base64.StdEncoding.EncodeToString([]byte(r)) + positionReference = r + + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(r), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + +func (g *FirewallPolicyGenerator) createNATRuleGroupResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.Policies.Nat, []string{g.vsys}}, "panos_nat_rule_group") +} + +func (g *FirewallPolicyGenerator) createPBFRuleGroupResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.Policies.PolicyBasedForwarding, []string{g.vsys}}, "panos_pbf_rule_group") +} + +func (g *FirewallPolicyGenerator) createSecurityRuleGroupResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.Policies.Security, []string{g.vsys}}, "panos_security_rule_group") +} + +func (g *FirewallPolicyGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + g.Resources = append(g.Resources, g.createNATRuleGroupResources()...) + g.Resources = append(g.Resources, g.createPBFRuleGroupResources()...) + g.Resources = append(g.Resources, g.createSecurityRuleGroupResources()...) + + return nil +} + +func (g *FirewallPolicyGenerator) PostConvertHook() error { + for _, res := range g.Resources { + if res.InstanceInfo.Type == "panos_nat_rule_group" { + for _, rule := range res.Item["rule"].([]interface{}) { + a := rule.(map[string]interface{})["translated_packet"].([]interface{}) + for _, b := range a { + if _, ok := b.(map[string]interface{})["source"]; !ok { + b.(map[string]interface{})["source"] = make(map[string]interface{}) + } + } + + for _, b := range a { + if _, ok := b.(map[string]interface{})["destination"]; !ok { + b.(map[string]interface{})["destination"] = make(map[string]interface{}) + } + } + } + } + + if res.InstanceInfo.Type == "panos_security_rule_group" { + for _, rule := range res.Item["rule"].([]interface{}) { + if _, ok := rule.(map[string]interface{})["hip_profiles"]; !ok { + rule.(map[string]interface{})["hip_profiles"] = []string{"any"} + } + } + } + } + + return nil +} diff --git a/providers/panos/helpers.go b/providers/panos/helpers.go new file mode 100644 index 0000000000..ef1b9645be --- /dev/null +++ b/providers/panos/helpers.go @@ -0,0 +1,129 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "strings" + "unicode" + + "github.com/PaloAltoNetworks/pango" + "github.com/PaloAltoNetworks/pango/util" + "golang.org/x/text/secure/precis" + "golang.org/x/text/transform" + "golang.org/x/text/unicode/norm" +) + +func Initialize(hostname, username, password string) (*pango.Firewall, error) { + client := &pango.Firewall{Client: pango.Client{ + Hostname: hostname, + Username: username, + Password: password, + Logging: pango.LogQuiet, + }} + + return client, client.Initialize() +} + +func GetVsysList(hostname, username, password string) ([]string, error) { + client, err := Initialize(hostname, username, password) + if err != nil { + return []string{}, err + } + + vsysList, err := client.EntryListUsing(client.Get, []string{ + "config", + "devices", + util.AsEntryXpath([]string{"localhost.localdomain"}), + "vsys", + }) + if err != nil { + return []string{}, err + } + + return vsysList, nil +} + +func normalizeResourceName(s string) string { + normalize := precis.NewIdentifier( + precis.AdditionalMapping(func() transform.Transformer { + return transform.Chain(norm.NFD, transform.RemoveFunc(func(r rune) bool { //nolint + return unicode.Is(unicode.Mn, r) + })) + }), + precis.Norm(norm.NFC), + ) + + r := strings.NewReplacer(" ", "_", + "!", "_", + "\"", "_", + "#", "_", + "%", "_", + "&", "_", + "'", "_", + "(", "_", + ")", "_", + "{", "_", + "}", "_", + "*", "_", + "+", "_", + ",", "_", + "-", "_", + ".", "_", + "/", "_", + "|", "_", + "\\", "_", + ":", "_", + ";", "_", + ">", "_", + "=", "_", + "<", "_", + "?", "_", + "[", "_", + "]", "_", + "^", "_", + "`", "_", + "~", "_", + "$", "_", + "@", "_at_") + replaced := r.Replace(strings.ToLower(s)) + + result, err := normalize.String(replaced) + if err != nil { + return replaced + } + + return result +} + +type getListWithoutArg interface { + GetList() ([]string, error) +} + +type getListWithOneArg interface { + GetList(string) ([]string, error) +} + +type getListWithTwoArgs interface { + GetList(string, string) ([]string, error) +} + +type getListWithThreeArgs interface { + GetList(string, string, string) ([]string, error) +} + +type getGeneric struct { + i interface{} + params []string +} diff --git a/providers/panos/panos_provider.go b/providers/panos/panos_provider.go new file mode 100644 index 0000000000..6c3ae1d37a --- /dev/null +++ b/providers/panos/panos_provider.go @@ -0,0 +1,94 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "errors" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/zclconf/go-cty/cty" +) + +type PanosProvider struct { //nolint + terraformutils.Provider + hostname string + username string + password string + vsys string +} + +func (p *PanosProvider) Init(args []string) error { + p.hostname = args[0] + p.username = args[1] + p.password = args[2] + p.vsys = args[3] + + return nil +} + +func (p *PanosProvider) GetName() string { + return "panos" +} + +func (p *PanosProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{} +} + +func (p *PanosProvider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "hostname": cty.StringVal(p.hostname), + "username": cty.StringVal(p.username), + "password": cty.StringVal(p.password), + }) +} + +func (p *PanosProvider) GetBasicConfig() cty.Value { + return p.GetConfig() +} + +func (p *PanosProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New(p.GetName() + ": " + serviceName + " not supported service") + } + + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "hostname": p.hostname, + "username": p.username, + "password": p.password, + "vsys": p.vsys, + }) + + return nil +} + +func (p *PanosProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + + return map[string]terraformutils.ServiceGenerator{ + "device_config": &DeviceConfigGenerator{}, + "firewall_networking": &FirewallNetworkingGenerator{}, + "firewall_objects": &FirewallObjectsGenerator{}, + "firewall_policy": &FirewallPolicyGenerator{}, + } +} + +func (PanosProvider) GetResourceConnections() map[string]map[string][]string { + + return map[string]map[string][]string{} +} diff --git a/providers/panos/panos_service.go b/providers/panos/panos_service.go new file mode 100644 index 0000000000..395a974e8c --- /dev/null +++ b/providers/panos/panos_service.go @@ -0,0 +1,39 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" +) + +type PanosService struct { //nolint + terraformutils.Service + client *pango.Firewall + vsys string +} + +func (p *PanosService) Initialize() error { + p.vsys = p.Args["vsys"].(string) + + c, err := Initialize(p.Args["hostname"].(string), p.Args["username"].(string), p.Args["password"].(string)) + if err != nil { + return err + } + + p.client = c + + return nil +} From 7cbe353619e7f8f47eda8eeb7a26deeb6cadf921 Mon Sep 17 00:00:00 2001 From: rui Date: Thu, 27 May 2021 11:58:51 -0400 Subject: [PATCH 189/276] deps: upgrade terraform to v0.12.31 (#936) Signed-off-by: Rui Chen --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index df38b772af..c2f01a1d85 100644 --- a/go.mod +++ b/go.mod @@ -110,7 +110,7 @@ require ( github.com/hashicorp/go-hclog v0.15.0 github.com/hashicorp/go-plugin v1.4.0 github.com/hashicorp/hcl v1.0.0 - github.com/hashicorp/terraform v0.12.29 + github.com/hashicorp/terraform v0.12.31 github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 github.com/heroku/heroku-go/v5 v5.1.0 github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect diff --git a/go.sum b/go.sum index 08539b5129..f90f95e97a 100644 --- a/go.sum +++ b/go.sum @@ -677,8 +677,8 @@ github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/terraform v0.12.29 h1:UkuApT6qh6KONIT1Jz7HoV8f4B+x71db3bmGcBzjBB0= -github.com/hashicorp/terraform v0.12.29/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhkKZNlHPcr4P55U= +github.com/hashicorp/terraform v0.12.31 h1:df2bOxAOaR2r8kDfkqNlNk4anH2DjkPwJ4K7mEwUd9M= +github.com/hashicorp/terraform v0.12.31/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhkKZNlHPcr4P55U= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= From bf64bcd54946f45f33b71985583061f3f262f0b2 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 27 May 2021 18:06:32 +0200 Subject: [PATCH 190/276] Add support for AWS Batch (#938) * Add support for AWS Batch * fix lint --- go.mod | 1 + go.sum | 2 + providers/aws/aws_provider.go | 1 + providers/aws/batch.go | 113 ++++++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 providers/aws/batch.go diff --git a/go.mod b/go.mod index c2f01a1d85..3796ef89b9 100644 --- a/go.mod +++ b/go.mod @@ -30,6 +30,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/apigateway v1.2.1 github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1 github.com/aws/aws-sdk-go-v2/service/autoscaling v1.3.1 + github.com/aws/aws-sdk-go-v2/service/batch v1.3.1 github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3 github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.0 diff --git a/go.sum b/go.sum index f90f95e97a..77c7e4b32e 100644 --- a/go.sum +++ b/go.sum @@ -191,6 +191,8 @@ github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1 h1:qHxx2jl6nI6Sn5fuXtBQVWbha github.com/aws/aws-sdk-go-v2/service/appsync v1.2.1/go.mod h1:JkdNL71yKS0qmF+dFJJzxf1WJZWFGIhTepXHaxtKipE= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.3.1 h1:fQkypDE1Ll/W61tm8GoswgLjWfO8y1f50yXw5lA4uFo= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.3.1/go.mod h1:DVmOqpa3F7vhAuGfs2zse1f3N3mX64hCimRNSYiqnKE= +github.com/aws/aws-sdk-go-v2/service/batch v1.3.1 h1:dZSRS8i4wL+lB87FCCHBynaD7BgrYyESuEzmx23/pOg= +github.com/aws/aws-sdk-go-v2/service/batch v1.3.1/go.mod h1:sx7fSwDOWJhJ9Z/+SCHfisxlIXmPXqovaksLqQy/+w0= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3 h1:P2IXGUpF2t6gwy3QTPB82/wFarHkX6WVsHWs7nfaVWY= github.com/aws/aws-sdk-go-v2/service/budgets v1.1.3/go.mod h1:1NXNu5eiAZbLx6bK0Ir2X4MBXBO6JSMaPN3mdRaYZqo= github.com/aws/aws-sdk-go-v2/service/cloud9 v1.1.3 h1:I2V5IX5pwXq/+TL5QeDcoq4MIcFgzQ/yxbf5KTEqm4Q= diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index 83a71ad6ec..a668d8f0bb 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -235,6 +235,7 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "api_gateway": &AwsFacade{service: &APIGatewayGenerator{}}, "appsync": &AwsFacade{service: &AppSyncGenerator{}}, "auto_scaling": &AwsFacade{service: &AutoScalingGenerator{}}, + "batch": &AwsFacade{service: &BatchGenerator{}}, "budgets": &AwsFacade{service: &BudgetsGenerator{}}, "cloud9": &AwsFacade{service: &Cloud9Generator{}}, "cloudformation": &AwsFacade{service: &CloudFormationGenerator{}}, diff --git a/providers/aws/batch.go b/providers/aws/batch.go new file mode 100644 index 0000000000..544b86cc1c --- /dev/null +++ b/providers/aws/batch.go @@ -0,0 +1,113 @@ +package aws + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/batch" +) + +var BatchAllowEmptyValues = []string{"tags."} + +var BatchAdditionalFields = map[string]interface{}{} + +type BatchGenerator struct { + AWSService +} + +func (g *BatchGenerator) InitResources() error { + config, e := g.generateConfig() + if e != nil { + return e + } + batchClient := batch.NewFromConfig(config) + + if err := g.loadComputeEnvironments(batchClient); err != nil { + return err + } + if err := g.loadJobDefinitions(batchClient); err != nil { + return err + } + if err := g.loadJobQueues(batchClient); err != nil { + return err + } + + return nil +} + +func (g *BatchGenerator) loadComputeEnvironments(batchClient *batch.Client) error { + p := batch.NewDescribeComputeEnvironmentsPaginator(batchClient, &batch.DescribeComputeEnvironmentsInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, computeEnvironment := range page.ComputeEnvironments { + computeEnvironmentName := StringValue(computeEnvironment.ComputeEnvironmentName) + g.Resources = append(g.Resources, terraformutils.NewResource( + computeEnvironmentName, + computeEnvironmentName, + "aws_batch_compute_environment", + "aws", + map[string]string{ + "compute_environment_name": computeEnvironmentName, + }, + BatchAllowEmptyValues, + BatchAdditionalFields, + )) + } + } + return nil +} + +func (g *BatchGenerator) loadJobDefinitions(batchClient *batch.Client) error { + p := batch.NewDescribeJobDefinitionsPaginator(batchClient, &batch.DescribeJobDefinitionsInput{ + Status: aws.String("ACTIVE"), + }) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, jobDefinition := range page.JobDefinitions { + jobDefinitionName := StringValue(jobDefinition.JobDefinitionName) + g.Resources = append(g.Resources, terraformutils.NewResource( + jobDefinitionName, + jobDefinitionName, + "aws_batch_job_definition", + "aws", + map[string]string{ + "arn": StringValue(jobDefinition.JobDefinitionArn), + }, + BatchAllowEmptyValues, + BatchAdditionalFields, + )) + } + } + return nil +} + +func (g *BatchGenerator) loadJobQueues(batchClient *batch.Client) error { + p := batch.NewDescribeJobQueuesPaginator(batchClient, &batch.DescribeJobQueuesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, jobQueue := range page.JobQueues { + jobQueueName := StringValue(jobQueue.JobQueueName) + g.Resources = append(g.Resources, terraformutils.NewResource( + jobQueueName, + jobQueueName, + "aws_batch_job_queue", + "aws", + map[string]string{}, + BatchAllowEmptyValues, + BatchAdditionalFields, + )) + } + } + return nil +} From b1d0e9cb015189aee38aa22bf759bd11dba7a9f7 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Thu, 27 May 2021 19:20:34 +0300 Subject: [PATCH 191/276] Update version (#945) --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index aff3f35b8e..1af2971839 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.13" +const version = "v0.8.14" var versionCmd = &cobra.Command{ Use: "version", From 7bb64592cee791f11a0d804e367b546224d57494 Mon Sep 17 00:00:00 2001 From: Pierre Erraud Date: Fri, 28 May 2021 13:06:28 +0200 Subject: [PATCH 192/276] fix: panos - default admin distances are not always 10 (#947) --- providers/panos/firewall_networking.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go index fcbe15365c..99b68f02bb 100644 --- a/providers/panos/firewall_networking.go +++ b/providers/panos/firewall_networking.go @@ -691,19 +691,19 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { if r.InstanceInfo.Type == "panos_virtual_router" { if r.Item["ospfv3_ext_dist"].(string) == "0" { - r.Item["ospfv3_ext_dist"] = "10" + r.Item["ospfv3_ext_dist"] = "110" } if r.Item["ebgp_dist"].(string) == "0" { - r.Item["ebgp_dist"] = "10" + r.Item["ebgp_dist"] = "20" } if r.Item["rip_dist"].(string) == "0" { - r.Item["rip_dist"] = "10" + r.Item["rip_dist"] = "120" } if r.Item["ibgp_dist"].(string) == "0" { - r.Item["ibgp_dist"] = "10" + r.Item["ibgp_dist"] = "200" } if r.Item["static_dist"].(string) == "0" { @@ -711,7 +711,7 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { } if r.Item["ospf_int_dist"].(string) == "0" { - r.Item["ospf_int_dist"] = "10" + r.Item["ospf_int_dist"] = "30" } if r.Item["static_ipv6_dist"].(string) == "0" { @@ -719,11 +719,11 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { } if r.Item["ospf_ext_dist"].(string) == "0" { - r.Item["ospf_ext_dist"] = "10" + r.Item["ospf_ext_dist"] = "110" } if r.Item["ospfv3_int_dist"].(string) == "0" { - r.Item["ospfv3_int_dist"] = "10" + r.Item["ospfv3_int_dist"] = "30" } } From 8d8f3e384f2053ee48d2578e8819be8cc7445266 Mon Sep 17 00:00:00 2001 From: Pierre Erraud Date: Wed, 9 Jun 2021 08:09:46 +0200 Subject: [PATCH 193/276] feat: improve authentication, fix panos_telemetry (#950) --- cmd/provider_cmd_panos.go | 26 ++------------------------ docs/panos.md | 13 +++++++++++++ providers/panos/device_config.go | 13 +++++++++++-- providers/panos/helpers.go | 24 ++++++++++++++---------- providers/panos/panos_provider.go | 21 ++++----------------- providers/panos/panos_service.go | 2 +- 6 files changed, 45 insertions(+), 54 deletions(-) diff --git a/cmd/provider_cmd_panos.go b/cmd/provider_cmd_panos.go index db3b8c11d7..aee4352898 100644 --- a/cmd/provider_cmd_panos.go +++ b/cmd/provider_cmd_panos.go @@ -16,7 +16,6 @@ package cmd import ( "log" - "os" "strings" panos_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/panos" @@ -24,12 +23,6 @@ import ( "github.com/spf13/cobra" ) -const ( - defaultPanosHostname = "192.168.1.1" - defaultPanosUsername = "admin" - defaultPanosPassword = "admin" -) - func newCmdPanosImporter(options ImportOptions) *cobra.Command { vsys := []string{} cmd := &cobra.Command{ @@ -37,25 +30,10 @@ func newCmdPanosImporter(options ImportOptions) *cobra.Command { Short: "Import current state to Terraform configuration from a PAN-OS", Long: "Import current state to Terraform configuration from a PAN-OS", RunE: func(cmd *cobra.Command, args []string) error { - hostname := os.Getenv("PANOS_HOSTNAME") - if len(hostname) == 0 { - hostname = defaultPanosHostname - } - - username := os.Getenv("PANOS_USERNAME") - if len(username) == 0 { - username = defaultPanosUsername - } - - password := os.Getenv("PANOS_PASSWORD") - if len(password) == 0 { - password = defaultPanosPassword - } - if len(vsys) == 0 { var err error - vsys, err = panos_terraforming.GetVsysList(hostname, username, password) + vsys, err = panos_terraforming.GetVsysList() if err != nil { return err } @@ -68,7 +46,7 @@ func newCmdPanosImporter(options ImportOptions) *cobra.Command { options.PathPattern = originalPathPattern options.PathPattern = strings.ReplaceAll(options.PathPattern, "{provider}", "{provider}/"+v) - err := Import(provider, options, []string{hostname, username, password, v}) + err := Import(provider, options, []string{v}) if err != nil { return err } diff --git a/docs/panos.md b/docs/panos.md index 47094d4bfd..7a0e01b42c 100644 --- a/docs/panos.md +++ b/docs/panos.md @@ -9,6 +9,19 @@ Example: terraformer import panos --resources=device_config,firewall_networking,firewall_objects,firewall_policy ``` +The list of usable environment variables is the same as the [pango go-client](https://github.com/PaloAltoNetworks/pango): +* `PANOS_HOSTNAME` +* `PANOS_USERNAME` +* `PANOS_PASSWORD` +* `PANOS_API_KEY` +* `PANOS_PROTOCOL` +* `PANOS_PORT` +* `PANOS_TIMEOUT` +* `PANOS_TARGET` +* `PANOS_HEADERS` +* `PANOS_VERIFY_CERTIFICATE` +* `PANOS_LOGGING` + Here is the list of resources which are currently supported: * `device_config` diff --git a/providers/panos/device_config.go b/providers/panos/device_config.go index ea81d970a0..0e671ab8a6 100644 --- a/providers/panos/device_config.go +++ b/providers/panos/device_config.go @@ -16,6 +16,7 @@ package panos import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango/dev/general" ) type DeviceConfigGenerator struct { @@ -52,6 +53,14 @@ func (g *DeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix, return resources } +func (g *DeviceConfigGenerator) createGeneralSettingsResource(generalConfig general.Config) terraformutils.Resource { + return g.createSimpleResource(generalConfig.Hostname, "panos_general_settings") +} + +func (g *DeviceConfigGenerator) createTelemetryResource(generalConfig general.Config) terraformutils.Resource { + return g.createSimpleResource(generalConfig.IpAddress, "panos_telemetry") +} + func (g *DeviceConfigGenerator) createEmailServerProfileResources() []terraformutils.Resource { return g.createResourcesFromList(getGeneric{g.client.Device.EmailServerProfile, []string{g.vsys}}, g.vsys+":", "panos_email_server_profile", @@ -90,8 +99,8 @@ func (g *DeviceConfigGenerator) InitResources() error { return err } - g.Resources = append(g.Resources, g.createSimpleResource(generalConfig.Hostname, "panos_general_settings")) - g.Resources = append(g.Resources, g.createSimpleResource(generalConfig.Hostname, "panos_telemetry")) + g.Resources = append(g.Resources, g.createGeneralSettingsResource(generalConfig)) + g.Resources = append(g.Resources, g.createTelemetryResource(generalConfig)) g.Resources = append(g.Resources, g.createEmailServerProfileResources()...) g.Resources = append(g.Resources, g.createHTTPServerProfileResources()...) g.Resources = append(g.Resources, g.createSNMPTrapServerProfileResources()...) diff --git a/providers/panos/helpers.go b/providers/panos/helpers.go index ef1b9645be..d664c1db5b 100644 --- a/providers/panos/helpers.go +++ b/providers/panos/helpers.go @@ -15,6 +15,7 @@ package panos import ( + "os" "strings" "unicode" @@ -25,19 +26,22 @@ import ( "golang.org/x/text/unicode/norm" ) -func Initialize(hostname, username, password string) (*pango.Firewall, error) { - client := &pango.Firewall{Client: pango.Client{ - Hostname: hostname, - Username: username, - Password: password, - Logging: pango.LogQuiet, - }} +func Initialize() (*pango.Firewall, error) { + fw := &pango.Firewall{ + Client: pango.Client{ + CheckEnvironment: true, + }, + } + + if val := os.Getenv("PANOS_LOGGING"); val == "" { + fw.Client.Logging = pango.LogQuiet + } - return client, client.Initialize() + return fw, fw.Initialize() } -func GetVsysList(hostname, username, password string) ([]string, error) { - client, err := Initialize(hostname, username, password) +func GetVsysList() ([]string, error) { + client, err := Initialize() if err != nil { return []string{}, err } diff --git a/providers/panos/panos_provider.go b/providers/panos/panos_provider.go index 6c3ae1d37a..7d91de8f69 100644 --- a/providers/panos/panos_provider.go +++ b/providers/panos/panos_provider.go @@ -23,17 +23,11 @@ import ( type PanosProvider struct { //nolint terraformutils.Provider - hostname string - username string - password string - vsys string + vsys string } func (p *PanosProvider) Init(args []string) error { - p.hostname = args[0] - p.username = args[1] - p.password = args[2] - p.vsys = args[3] + p.vsys = args[0] return nil } @@ -47,11 +41,7 @@ func (p *PanosProvider) GetProviderData(arg ...string) map[string]interface{} { } func (p *PanosProvider) GetConfig() cty.Value { - return cty.ObjectVal(map[string]cty.Value{ - "hostname": cty.StringVal(p.hostname), - "username": cty.StringVal(p.username), - "password": cty.StringVal(p.password), - }) + return cty.ObjectVal(map[string]cty.Value{}) } func (p *PanosProvider) GetBasicConfig() cty.Value { @@ -69,10 +59,7 @@ func (p *PanosProvider) InitService(serviceName string, verbose bool) error { p.Service.SetVerbose(verbose) p.Service.SetProviderName(p.GetName()) p.Service.SetArgs(map[string]interface{}{ - "hostname": p.hostname, - "username": p.username, - "password": p.password, - "vsys": p.vsys, + "vsys": p.vsys, }) return nil diff --git a/providers/panos/panos_service.go b/providers/panos/panos_service.go index 395a974e8c..cef572f8df 100644 --- a/providers/panos/panos_service.go +++ b/providers/panos/panos_service.go @@ -28,7 +28,7 @@ type PanosService struct { //nolint func (p *PanosService) Initialize() error { p.vsys = p.Args["vsys"].(string) - c, err := Initialize(p.Args["hostname"].(string), p.Args["username"].(string), p.Args["password"].(string)) + c, err := Initialize() if err != nil { return err } From 4b73505a89ad231683d8f23a53104e1dc325e7ed Mon Sep 17 00:00:00 2001 From: Pierre Erraud Date: Thu, 10 Jun 2021 04:43:18 +0200 Subject: [PATCH 194/276] fix(panos): telemetry name (#951) --- providers/panos/device_config.go | 35 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/providers/panos/device_config.go b/providers/panos/device_config.go index 0e671ab8a6..aeed8237d4 100644 --- a/providers/panos/device_config.go +++ b/providers/panos/device_config.go @@ -16,23 +16,12 @@ package panos import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/PaloAltoNetworks/pango/dev/general" ) type DeviceConfigGenerator struct { PanosService } -func (g *DeviceConfigGenerator) createSimpleResource(hostname, terraformResourceName string) terraformutils.Resource { - return terraformutils.NewSimpleResource( - hostname, - normalizeResourceName(hostname), - terraformResourceName, - "panos", - []string{}, - ) -} - func (g *DeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix, terraformResourceName string) (resources []terraformutils.Resource) { l, err := o.i.(getListWithOneArg).GetList(o.params[0]) if err != nil { @@ -53,12 +42,24 @@ func (g *DeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix, return resources } -func (g *DeviceConfigGenerator) createGeneralSettingsResource(generalConfig general.Config) terraformutils.Resource { - return g.createSimpleResource(generalConfig.Hostname, "panos_general_settings") +func (g *DeviceConfigGenerator) createGeneralSettingsResource(hostname string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + hostname, + normalizeResourceName(hostname), + "panos_general_settings", + "panos", + []string{}, + ) } -func (g *DeviceConfigGenerator) createTelemetryResource(generalConfig general.Config) terraformutils.Resource { - return g.createSimpleResource(generalConfig.IpAddress, "panos_telemetry") +func (g *DeviceConfigGenerator) createTelemetryResource(ipAddress, hostname string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + ipAddress, + normalizeResourceName(hostname), + "panos_telemetry", + "panos", + []string{}, + ) } func (g *DeviceConfigGenerator) createEmailServerProfileResources() []terraformutils.Resource { @@ -99,8 +100,8 @@ func (g *DeviceConfigGenerator) InitResources() error { return err } - g.Resources = append(g.Resources, g.createGeneralSettingsResource(generalConfig)) - g.Resources = append(g.Resources, g.createTelemetryResource(generalConfig)) + g.Resources = append(g.Resources, g.createGeneralSettingsResource(generalConfig.Hostname)) + g.Resources = append(g.Resources, g.createTelemetryResource(generalConfig.IpAddress, generalConfig.Hostname)) g.Resources = append(g.Resources, g.createEmailServerProfileResources()...) g.Resources = append(g.Resources, g.createHTTPServerProfileResources()...) g.Resources = append(g.Resources, g.createSNMPTrapServerProfileResources()...) From c3a9e2316e67f8594814a9d9fcb5879b8d96993d Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Wed, 16 Jun 2021 20:48:52 +0200 Subject: [PATCH 195/276] Import aws_cognito_user_pool_client (#955) --- providers/aws/cognito.go | 49 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/providers/aws/cognito.go b/providers/aws/cognito.go index a05834b4a8..567aed2c5b 100644 --- a/providers/aws/cognito.go +++ b/providers/aws/cognito.go @@ -9,6 +9,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider" ) +var CognitoAllowEmptyValues = []string{"tags."} + +var CognitoAdditionalFields = map[string]interface{}{} + type CognitoGenerator struct { AWSService } @@ -39,15 +43,16 @@ func (g *CognitoGenerator) loadIdentityPools(svc *cognitoidentity.Client) error return nil } -func (g *CognitoGenerator) loadUserPools(svc *cognitoidentityprovider.Client) error { +func (g *CognitoGenerator) loadUserPools(svc *cognitoidentityprovider.Client) ([]string, error) { p := cognitoidentityprovider.NewListUserPoolsPaginator(svc, &cognitoidentityprovider.ListUserPoolsInput{ MaxResults: *aws.Int32(CognitoMaxResults), }) + var userPoolIds []string for p.HasMorePages() { page, err := p.NextPage(context.TODO()) if err != nil { - return err + return nil, err } for _, pool := range page.UserPools { id := *pool.Id @@ -58,6 +63,39 @@ func (g *CognitoGenerator) loadUserPools(svc *cognitoidentityprovider.Client) er "aws_cognito_user_pool", "aws", []string{})) + + userPoolIds = append(userPoolIds, *pool.Id) + } + } + return userPoolIds, nil +} + +func (g *CognitoGenerator) loadUserPoolClients(svc *cognitoidentityprovider.Client, userPoolIds []string) error { + for _, userPoolID := range userPoolIds { + p := cognitoidentityprovider.NewListUserPoolClientsPaginator(svc, &cognitoidentityprovider.ListUserPoolClientsInput{ + UserPoolId: aws.String(userPoolID), + MaxResults: *aws.Int32(CognitoMaxResults), + }) + + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, poolClient := range page.UserPoolClients { + id := *poolClient.ClientId + resourceName := *poolClient.ClientName + g.Resources = append(g.Resources, terraformutils.NewResource( + id, + resourceName, + "aws_cognito_user_pool_client", + "aws", + map[string]string{ + "user_pool_id": *poolClient.UserPoolId, + }, + CognitoAllowEmptyValues, + CognitoAdditionalFields)) + } } } return nil @@ -74,7 +112,12 @@ func (g *CognitoGenerator) InitResources() error { return err } svcCognitoIdentityProvider := cognitoidentityprovider.NewFromConfig(config) - if err := g.loadUserPools(svcCognitoIdentityProvider); err != nil { + + userPoolIds, err := g.loadUserPools(svcCognitoIdentityProvider) + if err != nil { + return err + } + if err = g.loadUserPoolClients(svcCognitoIdentityProvider, userPoolIds); err != nil { return err } From 50970d15643198dff4ad25d3c180094e8f7f4fe0 Mon Sep 17 00:00:00 2001 From: Ethan Pransky Date: Wed, 23 Jun 2021 23:04:20 +0300 Subject: [PATCH 196/276] Issue #962 add Hashicorp Vault provider partial support (#964) * Issue #962 add Hashicorp Vault provider partial support This commit includes the boilerplate for the Vault provider, as well as support for Secret Engine, Secret Engine Roles, Auth Backends, Auth Backend Roles, Auth Backend Users, Auth Backend Groups, and Policies. This is done by instantiating a common Vault client using its official Go client library and leveraging the naming convention of Vault tf resources to support most of the Secret/Auth options available in the provider itself. The provider configuration includes only the minimum required `address` and `token` fields. Filtering roles/users/groups by mount type is supported as well as basic filtering by resource ids. * Issue #962 linting fixes * Issue #962 add support for Vault generic secrets * Issue #962 fix filtering backends * Issue #962 post convert normalization of iam policies in vault aws secrets and fixing of policies without policy * Issue #962 linting fixes * Issue #962 add postconverthook for vault_ldap_auth_backend_group for deterministic order of policies --- README.md | 2 + cmd/provider_cmd_vault.go | 48 ++++ cmd/root.go | 2 + docs/vault.md | 87 +++++++ go.mod | 2 + go.sum | 6 + providers/vault/vault_provider.go | 100 +++++++ providers/vault/vault_service_generator.go | 290 +++++++++++++++++++++ 8 files changed, 537 insertions(+) create mode 100644 cmd/provider_cmd_vault.go create mode 100644 docs/vault.md create mode 100644 providers/vault/vault_provider.go create mode 100644 providers/vault/vault_service_generator.go diff --git a/README.md b/README.md index 0fa004c7a2..47d98c319e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [Xen Orchestra](/docs/xen.md) * [GmailFilter](/docs/gmailfilter.md) * [Grafana](/docs/grafana.md) + * [Vault](/docs/vault.md) - [Contributing](#contributing) - [Developing](#developing) - [Infrastructure](#infrastructure) @@ -277,6 +278,7 @@ Links to download Terraform Providers: * Mikrotik provider >= 0.2.2 - [here](https://github.com/ddelnano/terraform-provider-mikrotik) * Xen Orchestra provider >= 0.18.0 - [here](https://github.com/ddelnano/terraform-provider-xenorchestra) * GmailFilter provider >= 1.0.1 - [here](https://github.com/yamamoto-febc/terraform-provider-gmailfilter) + * Vault provider - [here](https://github.com/hashicorp/terraform-provider-vault) Information on provider plugins: https://www.terraform.io/docs/configuration/providers.html diff --git a/cmd/provider_cmd_vault.go b/cmd/provider_cmd_vault.go new file mode 100644 index 0000000000..9b323b1ef5 --- /dev/null +++ b/cmd/provider_cmd_vault.go @@ -0,0 +1,48 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + vault_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/vault" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdVaultImporter(options ImportOptions) *cobra.Command { + var token, address string + cmd := &cobra.Command{ + Use: "vault", + Short: "Import current state to Terraform configuration from Vault", + Long: "Import current state to Terraform configuration from Vault", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newVaultProvider() + err := Import(provider, options, []string{address, token}) + if err != nil { + return err + } + return nil + }, + } + + cmd.AddCommand(listCmd(newVaultProvider())) + cmd.PersistentFlags().StringVarP(&address, "address", "a", "", "env param VAULT_ADDR") + cmd.PersistentFlags().StringVarP(&token, "token", "t", "", "env param VAULT_TOKEN") + baseProviderFlags(cmd.PersistentFlags(), &options, "", "") + return cmd +} + +func newVaultProvider() terraformutils.ProviderGenerator { + return &vault_terraforming.Provider{} +} diff --git a/cmd/root.go b/cmd/root.go index 1ecb0eab2d..b5f154e8b9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -76,6 +76,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdMikrotikImporter, newCmdXenorchestraImporter, newCmdGmailfilterImporter, + newCmdVaultImporter, } } @@ -117,6 +118,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { newMikrotikProvider, newXenorchestraProvider, newGmailfilterProvider, + newVaultProvider, } { list[providerGen().GetName()] = providerGen } diff --git a/docs/vault.md b/docs/vault.md new file mode 100644 index 0000000000..6568849ace --- /dev/null +++ b/docs/vault.md @@ -0,0 +1,87 @@ +### Use with Vault + +Example: + +``` + ./terraformer import vault --resources=aws_secret_backend_role --token=YOUR_VAULT_TOKEN // or VAULT_TOKEN in env --address=YOUR_VAULT_ADDRESS // or VAULT_ADDR in env + ./terraformer import vault --resources=policy --filter=policy=id1:id2:id4 --token=YOUR_VAULT_TOKEN // or VAULT_TOKEN in env --address=YOUR_VAULT_ADDRESS // or VAULT_ADDR in env +``` + +List of supported Datadog services: + +* `ad_secret_backend` + * `ad_secret_backend` +* `ad_secret_backend_role` + * `ad_secret_backend_role` +* `alicloud_auth_backend_role` + * `alicloud_auth_backend_role` +* `approle_auth_backend_role` + * `approle_auth_backend_role` +* `aws_auth_backend_role` + * `aws_auth_backend_role` +* `aws_secret_backend` + * `aws_secret_backend` +* `aws_secret_backend_role` + * `aws_secret_backend_role` +* `azure_auth_backend_role` + * `azure_auth_backend_role` +* `azure_secret_backend` + * `azure_secret_backend` +* `azure_secret_backend_role` + * `azure_secret_backend_role` +* `cert_auth_backend_role` + * `cert_auth_backend_role` +* `consul_secret_backend` + * `consul_secret_backend` +* `consul_secret_backend_role` + * `consul_secret_backend_role` +* `database_secret_backend_role` + * `database_secret_backend_role` +* `gcp_auth_backend` + * `gcp_auth_backend` +* `gcp_auth_backend_role` + * `gcp_auth_backend_role` +* `gcp_secret_backend` + * `gcp_secret_backend` +* `generic_secret` + * `generic_secret` +* `github_auth_backend` + * `github_auth_backend` +* `jwt_auth_backend` + * `jwt_auth_backend` +* `jwt_auth_backend_role` + * `jwt_auth_backend_role` +* `kubernetes_auth_backend_role` + * `kubernetes_auth_backend_role` +* `ldap_auth_backend` + * `ldap_auth_backend` +* `ldap_auth_backend_group` + * `ldap_auth_backend_group` +* `ldap_auth_backend_user` + * `ldap_auth_backend_user` +* `nomad_secret_backend` + * `nomad_secret_backend` +* `okta_auth_backend` + * `okta_auth_backend` +* `okta_auth_backend_group` + * `okta_auth_backend_group` +* `okta_auth_backend_user` + * `okta_auth_backend_user` +* `pki_secret_backend` + * `pki_secret_backend` +* `pki_secret_backend_role` + * `pki_secret_backend_role` +* `policy` + * `policy` +* `rabbitmq_secret_backend` + * `rabbitmq_secret_backend` +* `rabbitmq_secret_backend_role` + * `rabbitmq_secret_backend_role` +* `ssh_secret_backend_role` + * `ssh_secret_backend_role` +* `terraform_cloud_secret_backend` + * `terraform_cloud_secret_backend` +* `token_auth_backend_role` + * `token_auth_backend_role` + +[1]: https://github.com/GoogleCloudPlatform/terraformer/blob/master/README.md#filtering \ No newline at end of file diff --git a/go.mod b/go.mod index 3796ef89b9..8b6accffaa 100644 --- a/go.mod +++ b/go.mod @@ -112,6 +112,7 @@ require ( github.com/hashicorp/go-plugin v1.4.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.31 + github.com/hashicorp/vault v0.10.4 github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 github.com/heroku/heroku-go/v5 v5.1.0 github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect @@ -126,6 +127,7 @@ require ( github.com/packethost/packngo v0.9.0 github.com/paultyng/go-newrelic/v4 v4.10.0 github.com/pkg/errors v0.9.1 + github.com/ryanuber/go-glob v1.0.0 // indirect github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible diff --git a/go.sum b/go.sum index 77c7e4b32e..55d0231e4e 100644 --- a/go.sum +++ b/go.sum @@ -540,6 +540,7 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -647,11 +648,13 @@ github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6 github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnOn8E8stHc= @@ -688,6 +691,7 @@ github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2 github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/vault v0.10.4 h1:4x0lHxui/ZRp/B3E0Auv1QNBJpzETqHR2kQD3mHSBJU= github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= @@ -929,6 +933,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= diff --git a/providers/vault/vault_provider.go b/providers/vault/vault_provider.go new file mode 100644 index 0000000000..bf075d1435 --- /dev/null +++ b/providers/vault/vault_provider.go @@ -0,0 +1,100 @@ +package vault + +import ( + "errors" + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/zclconf/go-cty/cty" +) + +type Provider struct { + terraformutils.Provider + token string + address string +} + +func (p *Provider) Init(args []string) error { + + if address := os.Getenv("VAULT_ADDR"); address != "" { + p.address = os.Getenv("VAULT_ADDR") + } + + if token := os.Getenv("VAULT_TOKEN"); token != "" { + p.token = os.Getenv("VAULT_TOKEN") + } + + if len(args) > 0 && args[0] != "" { + p.address = args[0] + } + + if len(args) > 1 && args[1] != "" { + p.token = args[1] + } + + return nil +} + +func (p *Provider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "token": cty.StringVal(p.token), + "address": cty.StringVal(p.address), + }) +} + +func (p *Provider) GetName() string { + return "vault" +} + +func (p *Provider) InitService(serviceName string, verbose bool) error { + if service, ok := p.GetSupportedService()[serviceName]; ok { + p.Service = service + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "token": p.token, + "address": p.address, + }) + if err := service.(*ServiceGenerator).setVaultClient(); err != nil { + return err + } + return nil + } + return errors.New(p.GetName() + ": " + serviceName + " not supported service") +} + +func getSupportedMountServices() map[string]terraformutils.ServiceGenerator { + services := make(map[string]terraformutils.ServiceGenerator) + mapping := map[string][]string{ + "secret_backend": {"ad", "aws", "azure", "consul", "gcp", "nomad", "pki", "rabbitmq", "terraform_cloud"}, + "secret_backend_role": {"ad", "aws", "azure", "consul", "database", "pki", "rabbitmq", "ssh"}, + "auth_backend": {"gcp", "github", "jwt", "ldap", "okta"}, + "auth_backend_role": {"alicloud", "approle", "aws", "azure", "cert", "gcp", "jwt", "kubernetes", "token"}, + "auth_backend_user": {"ldap", "okta"}, + "auth_backend_group": {"ldap", "okta"}, + } + for resource, mountTypes := range mapping { + for _, mountType := range mountTypes { + services[fmt.Sprintf("%s_%s", mountType, resource)] = + &ServiceGenerator{mountType: mountType, resource: resource} + } + } + return services +} + +func (p *Provider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + generators := getSupportedMountServices() + generators["policy"] = &ServiceGenerator{resource: "policy"} + generators["generic_secret"] = &ServiceGenerator{resource: "generic_secret", mountType: "kv"} + return generators +} + +func (Provider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} + +func (Provider) GetProviderData(_ ...string) map[string]interface{} { + return map[string]interface{}{} +} diff --git a/providers/vault/vault_service_generator.go b/providers/vault/vault_service_generator.go new file mode 100644 index 0000000000..1a49c19641 --- /dev/null +++ b/providers/vault/vault_service_generator.go @@ -0,0 +1,290 @@ +package vault + +import ( + "errors" + "fmt" + "log" + "regexp" + "sort" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + vault "github.com/hashicorp/vault/api" +) + +type ServiceGenerator struct { //nolint + terraformutils.Service + client *vault.Client + mountType string + resource string +} + +func (g *ServiceGenerator) setVaultClient() error { + client, err := vault.NewClient(&vault.Config{Address: g.Args["address"].(string)}) + if err != nil { + return err + } + if g.Args["token"] != "" { + client.SetToken(g.Args["token"].(string)) + } + g.client = client + return nil +} + +func (g *ServiceGenerator) InitResources() error { + switch g.resource { + case "secret_backend": + return g.createSecretBackendResources() + case "secret_backend_role": + return g.createSecretBackendRoleResources() + case "auth_backend": + return g.createAuthBackendResources() + case "auth_backend_role": + return g.createAuthBackendEntityResources("role", "role") + case "auth_backend_user": + return g.createAuthBackendEntityResources("users", "user") + case "auth_backend_group": + return g.createAuthBackendEntityResources("groups", "group") + case "policy": + return g.createPolicyResources() + case "generic_secret": + return g.createGenericSecretResources() + default: + return errors.New("unsupported service type. shouldn't ever reach here") + } +} + +func (g *ServiceGenerator) createSecretBackendResources() error { + mounts, err := g.mountsByType() + if err != nil { + return err + } + for _, mount := range mounts { + g.Resources = append(g.Resources, + terraformutils.NewSimpleResource( + mount, + mount, + fmt.Sprintf("vault_%s_secret_backend", g.mountType), + g.ProviderName, + []string{})) + } + return nil +} + +func (g *ServiceGenerator) createSecretBackendRoleResources() error { + mounts, err := g.mountsByType() + if err != nil { + return err + } + for _, mount := range mounts { + path := fmt.Sprintf("%s/roles", mount) + s, err := g.client.Logical().List(path) + if err != nil { + log.Printf("error calling path %s: %s", path, err) + continue + } + if s == nil { + log.Printf("call to %s returned nil result", path) + continue + } + roles, ok := s.Data["keys"] + if !ok { + log.Printf("no keys in call to %s", path) + continue + } + for _, role := range roles.([]interface{}) { + g.Resources = append(g.Resources, + terraformutils.NewSimpleResource( + fmt.Sprintf("%s/roles/%s", mount, role), + fmt.Sprintf("%s_%s", mount, role), + fmt.Sprintf("vault_%s_secret_backend_role", g.mountType), + g.ProviderName, + []string{})) + } + } + return nil +} + +func (g *ServiceGenerator) mountsByType() ([]string, error) { + mounts, err := g.client.Sys().ListMounts() + if err != nil { + return nil, err + } + var typeMounts []string + for name, mount := range mounts { + if mount.Type != g.mountType { + continue + } + id := strings.ReplaceAll(name, "/", "") + if g.filterAllow(fmt.Sprintf("%s_secret_backend", mount.Type), id) { + typeMounts = append(typeMounts, id) + } + } + return typeMounts, nil +} + +func (g *ServiceGenerator) filterAllow(serviceName, id string) bool { + add := true + for _, filter := range g.Filter { + if filter.FieldPath == "id" && + filter.IsApplicable(serviceName) { + for _, value := range filter.AcceptableValues { + add = value == id + if add { + break + } + } + } + } + return add +} + +func (g *ServiceGenerator) createAuthBackendResources() error { + backends, err := g.backendsByType() + if err != nil { + return err + } + for _, backend := range backends { + g.Resources = append(g.Resources, + terraformutils.NewSimpleResource( + backend, + backend, + fmt.Sprintf("vault_%s_auth_backend", g.mountType), + g.ProviderName, + []string{})) + } + return nil +} + +func (g *ServiceGenerator) createAuthBackendEntityResources(apiEntity, tfEntity string) error { + backends, err := g.backendsByType() + if err != nil { + return err + } + for _, backend := range backends { + path := fmt.Sprintf("/auth/%s/%s", backend, apiEntity) + s, err := g.client.Logical().List(path) + if err != nil { + log.Printf("error calling path %s: %s", path, err) + continue + } + if s == nil { + log.Printf("call to %s returned nil result", path) + continue + } + names, ok := s.Data["keys"] + if !ok { + log.Printf("no keys in call to %s", path) + continue + } + for _, name := range names.([]interface{}) { + g.Resources = append(g.Resources, + terraformutils.NewSimpleResource( + fmt.Sprintf("auth/%s/%s/%s", backend, apiEntity, name), + fmt.Sprintf("%s_%s", backend, name), + fmt.Sprintf("vault_%s_auth_backend_%s", g.mountType, tfEntity), + g.ProviderName, + []string{})) + } + } + return nil +} + +func (g *ServiceGenerator) backendsByType() ([]string, error) { + authBackends, err := g.client.Sys().ListAuth() + if err != nil { + return nil, err + } + var typeBackends []string + for name, authBackend := range authBackends { + if authBackend.Type != g.mountType { + continue + } + id := strings.ReplaceAll(name, "/", "") + if g.filterAllow(fmt.Sprintf("%s_auth_backend", authBackend.Type), id) { + typeBackends = append(typeBackends, id) + } + } + return typeBackends, nil +} + +func (g *ServiceGenerator) createPolicyResources() error { + policies, err := g.client.Sys().ListPolicies() + if err != nil { + return err + } + for _, policy := range policies { + g.Resources = append(g.Resources, + terraformutils.NewSimpleResource( + policy, + policy, + "vault_policy", + g.ProviderName, + []string{})) + } + return nil +} + +func (g *ServiceGenerator) createGenericSecretResources() error { + mounts, err := g.mountsByType() + if err != nil { + return err + } + for _, mount := range mounts { + path := fmt.Sprintf("%s/", mount) + s, err := g.client.Logical().List(path) + if err != nil { + log.Printf("error calling path %s: %s", path, err) + continue + } + if s == nil { + log.Printf("call to %s returned nil result", path) + continue + } + secrets, ok := s.Data["keys"] + if !ok { + log.Printf("no keys in call to %s", path) + continue + } + for _, secret := range secrets.([]interface{}) { + g.Resources = append(g.Resources, + terraformutils.NewSimpleResource( + fmt.Sprintf("%s/%s", mount, secret), + fmt.Sprintf("%s_%s", mount, secret), + "vault_generic_secret", + g.ProviderName, + []string{})) + } + } + return nil +} + +func (g *ServiceGenerator) PostConvertHook() error { + for _, resource := range g.Resources { + switch resource.InstanceInfo.Type { + case "vault_aws_secret_backend_role": + if policyDocument, ok := resource.Item["policy_document"]; ok { + // borrowed from providers/aws/aws_service.go + sanitizedPolicy := regexp.MustCompile(`(\${[0-9A-Za-z:]+})`). + ReplaceAllString(policyDocument.(string), "$$$1") + resource.Item["policy_document"] = fmt.Sprintf(`< Date: Tue, 29 Jun 2021 22:14:46 +0200 Subject: [PATCH 197/276] Grafana dashboards should be referenced by UID, not by slug (#971) This change is incompatible with Grafana versions <5.x, since that version introduced the ability to get dashboards by UID. --- providers/grafana/dashboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/grafana/dashboard.go b/providers/grafana/dashboard.go index a40dba018b..8e1c83b39d 100644 --- a/providers/grafana/dashboard.go +++ b/providers/grafana/dashboard.go @@ -46,7 +46,7 @@ func (g *DashboardGenerator) createDashboardResources(client *gapi.Client) error filename := fmt.Sprintf("dashboard-%s.json", dash.Meta.Slug) resource := terraformutils.NewResource( - dash.Meta.Slug, + dashboard.UID, dashboard.Title, "grafana_dashboard", "grafana", From 239d0d4ffaf3b410e76757fef979400cbbe19b62 Mon Sep 17 00:00:00 2001 From: Ethan Pransky Date: Tue, 29 Jun 2021 23:15:04 +0300 Subject: [PATCH 198/276] Remove filterAllow function when fetching Vault backend ids (#972) * Issue #964 remove filterAllow function when fetching Vault backend ids. filtering of this sort can be done using the regular filtering mechanism * add vault_mount resource --- providers/vault/vault_provider.go | 1 + providers/vault/vault_service_generator.go | 46 +++++++++++----------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/providers/vault/vault_provider.go b/providers/vault/vault_provider.go index bf075d1435..2f560fff35 100644 --- a/providers/vault/vault_provider.go +++ b/providers/vault/vault_provider.go @@ -87,6 +87,7 @@ func getSupportedMountServices() map[string]terraformutils.ServiceGenerator { func (p *Provider) GetSupportedService() map[string]terraformutils.ServiceGenerator { generators := getSupportedMountServices() generators["policy"] = &ServiceGenerator{resource: "policy"} + generators["mount"] = &ServiceGenerator{resource: "mount"} generators["generic_secret"] = &ServiceGenerator{resource: "generic_secret", mountType: "kv"} return generators } diff --git a/providers/vault/vault_service_generator.go b/providers/vault/vault_service_generator.go index 1a49c19641..f34b13a46d 100644 --- a/providers/vault/vault_service_generator.go +++ b/providers/vault/vault_service_generator.go @@ -49,6 +49,8 @@ func (g *ServiceGenerator) InitResources() error { return g.createPolicyResources() case "generic_secret": return g.createGenericSecretResources() + case "mount": + return g.createMountResources() default: return errors.New("unsupported service type. shouldn't ever reach here") } @@ -112,33 +114,14 @@ func (g *ServiceGenerator) mountsByType() ([]string, error) { } var typeMounts []string for name, mount := range mounts { - if mount.Type != g.mountType { - continue - } - id := strings.ReplaceAll(name, "/", "") - if g.filterAllow(fmt.Sprintf("%s_secret_backend", mount.Type), id) { + if g.mountType == "" || mount.Type == g.mountType { + id := strings.ReplaceAll(name, "/", "") typeMounts = append(typeMounts, id) } } return typeMounts, nil } -func (g *ServiceGenerator) filterAllow(serviceName, id string) bool { - add := true - for _, filter := range g.Filter { - if filter.FieldPath == "id" && - filter.IsApplicable(serviceName) { - for _, value := range filter.AcceptableValues { - add = value == id - if add { - break - } - } - } - } - return add -} - func (g *ServiceGenerator) createAuthBackendResources() error { backends, err := g.backendsByType() if err != nil { @@ -201,9 +184,7 @@ func (g *ServiceGenerator) backendsByType() ([]string, error) { continue } id := strings.ReplaceAll(name, "/", "") - if g.filterAllow(fmt.Sprintf("%s_auth_backend", authBackend.Type), id) { - typeBackends = append(typeBackends, id) - } + typeBackends = append(typeBackends, id) } return typeBackends, nil } @@ -259,6 +240,23 @@ func (g *ServiceGenerator) createGenericSecretResources() error { return nil } +func (g *ServiceGenerator) createMountResources() error { + mounts, err := g.mountsByType() + if err != nil { + return err + } + for _, mount := range mounts { + g.Resources = append(g.Resources, + terraformutils.NewSimpleResource( + mount, + mount, + "vault_mount", + g.ProviderName, + []string{})) + } + return nil +} + func (g *ServiceGenerator) PostConvertHook() error { for _, resource := range g.Resources { switch resource.InstanceInfo.Type { From 85a5c41b7126cd457a68a531bcef5617b0d55466 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Thu, 1 Jul 2021 02:15:20 -0300 Subject: [PATCH 199/276] Support for azurerm import data factory (#967) * fix heredoc for json arrays in hcl generation Previously when a resource had property containing a heredoc for a json array, the property was silently lost during the hcl generaion. See: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/data_factory_pipeline#example-usage-with-activities * azurerm: implement export of data_factory resources * azurerm: fix golangci-lint in datafactory * azure datafactory: fixed another annoying lint --- docs/azure.md | 37 ++++ providers/azure/azure_provider.go | 4 + providers/azure/data_factory.go | 356 ++++++++++++++++++++++++++++++ terraformutils/hcl.go | 6 +- 4 files changed, 402 insertions(+), 1 deletion(-) create mode 100644 providers/azure/data_factory.go diff --git a/docs/azure.md b/docs/azure.md index e2cad48991..3f67679625 100644 --- a/docs/azure.md +++ b/docs/azure.md @@ -62,6 +62,43 @@ List of supported Azure resources: * `azurerm_sql_firewall_rule` * `azurerm_sql_server` * `azurerm_sql_virtual_network_rule` +* `data_factory` + * `azurerm_data_factory` + * `azurerm_data_factory_pipeline` + * `azurerm_data_factory_trigger_schedule` + * `azurerm_data_factory_dataset_azure_blob` + * `azurerm_data_factory_dataset_cosmosdb_sqlapi` + * `azurerm_data_factory_dataset_delimited_text` + * `azurerm_data_factory_dataset_http` + * `azurerm_data_factory_dataset_json` + * `azurerm_data_factory_dataset_mysql` + * `azurerm_data_factory_dataset_parquet` + * `azurerm_data_factory_dataset_postgresql` + * `azurerm_data_factory_dataset_snowflake` + * `azurerm_data_factory_dataset_sql_server_table` + * `azurerm_data_factory_integration_runtime_azure` + * `azurerm_data_factory_integration_runtime_managed` + * `azurerm_data_factory_integration_runtime_azure_ssis` + * `azurerm_data_factory_integration_runtime_self_hosted` + * `azurerm_data_factory_linked_service_azure_blob_storage` + * `azurerm_data_factory_linked_service_azure_databricks` + * `azurerm_data_factory_linked_service_azure_file_storage` + * `azurerm_data_factory_linked_service_azure_function` + * `azurerm_data_factory_linked_service_azure_search` + * `azurerm_data_factory_linked_service_azure_sql_database` + * `azurerm_data_factory_linked_service_azure_table_storage` + * `azurerm_data_factory_linked_service_cosmosdb` + * `azurerm_data_factory_linked_service_data_lake_storage_gen2` + * `azurerm_data_factory_linked_service_key_vault` + * `azurerm_data_factory_linked_service_kusto` + * `azurerm_data_factory_linked_service_mysql` + * `azurerm_data_factory_linked_service_odata` + * `azurerm_data_factory_linked_service_postgresql` + * `azurerm_data_factory_linked_service_sftp` + * `azurerm_data_factory_linked_service_snowflake` + * `azurerm_data_factory_linked_service_sql_server` + * `azurerm_data_factory_linked_service_synapse` + * `azurerm_data_factory_linked_service_web` * `disk` * `azurerm_managed_disk` * `dns` diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index 06596322a6..f031a5b56c 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -157,6 +157,9 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "database": { "resource_group": []string{"resource_group_name", "name"}, }, + "data_factory": { + "resource_group": []string{"resource_group_name", "name"}, + }, "disk": { "resource_group": []string{"resource_group_name", "name"}, }, @@ -213,6 +216,7 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG "cosmosdb": &CosmosDBGenerator{}, "container": &ContainerGenerator{}, "database": &DatabasesGenerator{}, + "data_factory": &DataFactoryGenerator{}, "disk": &DiskGenerator{}, "dns": &DNSGenerator{}, "keyvault": &KeyVaultGenerator{}, diff --git a/providers/azure/data_factory.go b/providers/azure/data_factory.go new file mode 100644 index 0000000000..15684a7a75 --- /dev/null +++ b/providers/azure/data_factory.go @@ -0,0 +1,356 @@ +package azure + +import ( + "context" + "fmt" + "log" + "reflect" + "strings" + + "github.com/Azure/go-autorest/autorest" + "github.com/hashicorp/go-azure-helpers/authentication" + + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type DataFactoryGenerator struct { + AzureService +} + +// Maps item.Properties.Type -> terraform.ResoruceType +// Information extracted from +// SupportedResources +// @ github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory/registration.go +// PossibleTypeBasicDatasetValues, PossibleTypeBasicIntegrationRuntimeValues, PossibleTypeBasicLinkedServiceValues +// @ github.com/azure/azure-sdk-for-go@v42.3.0+incompatible/services/datafactory/mgmt/2018-06-01/datafactory/models.go + +var ( + SupportedResources = map[string]string{ + "ScheduleTrigger": "azurerm_data_factory_trigger_schedule", + "AzureBlob": "azurerm_data_factory_dataset_azure_blob", + "CosmosDbSqlApiCollection": "azurerm_data_factory_dataset_cosmosdb_sqlapi", + "DelimitedText": "azurerm_data_factory_dataset_delimited_text", + "HttpFile": "azurerm_data_factory_dataset_http", + "Json": "azurerm_data_factory_dataset_json", + "MySqlTable": "azurerm_data_factory_dataset_mysql", + "Parquet": "azurerm_data_factory_dataset_parquet", + "PostgreSqlTable": "azurerm_data_factory_dataset_postgresql", + "SnowflakeTable": "azurerm_data_factory_dataset_snowflake", + "SqlServerTable": "azurerm_data_factory_dataset_sql_server_table", + "IntegrationRuntime": "azurerm_data_factory_integration_runtime_azure", + "Managed": "azurerm_data_factory_integration_runtime_azure_ssis", + "SelfHosted": "azurerm_data_factory_integration_runtime_self_hosted", + "AzureBlobStorage": "azurerm_data_factory_linked_service_azure_blob_storage", + "AzureDatabricks": "azurerm_data_factory_linked_service_azure_databricks", + "AzureFileStorage": "azurerm_data_factory_linked_service_azure_file_storage", + "AzureFunction": "azurerm_data_factory_linked_service_azure_function", + "AzureSearch": "azurerm_data_factory_linked_service_azure_search", + "AzureSqlDatabase": "azurerm_data_factory_linked_service_azure_sql_database", + "AzureTableStorage": "azurerm_data_factory_linked_service_azure_table_storage", + "CosmosDb": "azurerm_data_factory_linked_service_cosmosdb", + "AzureBlobFS": "azurerm_data_factory_linked_service_data_lake_storage_gen2", + "AzureKeyVault": "azurerm_data_factory_linked_service_key_vault", + "AzureDataExplore": "azurerm_data_factory_linked_service_kusto", + "MySql": "azurerm_data_factory_linked_service_mysql", + "OData": "azurerm_data_factory_linked_service_odata", + "PostgreSql": "azurerm_data_factory_linked_service_postgresql", + "Sftp": "azurerm_data_factory_linked_service_sftp", + "Snowflake": "azurerm_data_factory_linked_service_snowflake", + "SqlServer": "azurerm_data_factory_linked_service_sql_server", + "AzureSqlDW": "azurerm_data_factory_linked_service_synapse", + "Web": "azurerm_data_factory_linked_service_web", + } +) + +func getResourceTypeFrom(azureResourceName string) string { + return SupportedResources[azureResourceName] +} + +func getFieldFrom(v interface{}, field string) reflect.Value { + reflected := reflect.ValueOf(v) + if reflected.IsValid() { + indirected := reflect.Indirect(reflected) + if indirected.Kind() == reflect.Struct { + fieldValue := indirected.FieldByName(field) + return fieldValue + } + } + return reflect.Value{} +} + +func getFieldAsString(v interface{}, field string) string { + fieldValue := getFieldFrom(v, field) + if fieldValue.IsValid() { + return fieldValue.String() + } + return "" +} + +func (g *DataFactoryGenerator) appendResourceFrom(resources []terraformutils.Resource, id string, name string, properties interface{}) []terraformutils.Resource { + azureType := getFieldAsString(properties, "Type") + if azureType != "" { + resourceType := getResourceTypeFrom(azureType) + if resourceType == "" { + msg := fmt.Sprintf(`azurerm_data_factory: resource "%s" id: %s type: %s not handled yet by terraform or terraformer`, name, id, azureType) + log.Println(msg) + } else { + resources = g.appendResourceAs(resources, id, name, resourceType) + } + } + return resources +} + +func (g *DataFactoryGenerator) appendResourceAs(resources []terraformutils.Resource, itemID string, itemName string, resourceType string) []terraformutils.Resource { + prefix := strings.ReplaceAll(resourceType, "azurerm_data_factory", "adf") + suffix := strings.ReplaceAll(itemName, "-", "_") + resourceName := prefix + "_" + suffix + res := terraformutils.NewSimpleResource(itemID, resourceName, resourceType, g.ProviderName, []string{}) + resources = append(resources, res) + return resources +} + +func (g *DataFactoryGenerator) getArgsProperties() (subscriptionID string, authorizer autorest.Authorizer) { + subs := g.Args["config"].(authentication.Config).SubscriptionID + auth := g.Args["authorizer"].(autorest.Authorizer) + return subs, auth +} + +func (g *DataFactoryGenerator) listFactories() ([]datafactory.Factory, error) { + subscriptionID, authorizer := g.getArgsProperties() + client := datafactory.NewFactoriesClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator datafactory.FactoryListResponseIterator + err error + ) + ctx := context.Background() + if rg := g.Args["resource_group"].(string); rg != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, rg) + } else { + iterator, err = client.ListComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []datafactory.Factory + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (g *DataFactoryGenerator) createDataFactoryResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + var resources []terraformutils.Resource + for _, item := range dataFactories { + resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory") + } + return resources, nil +} + +func getIntegrationRuntimeType(properties interface{}) string { + azureType := getFieldAsString(properties, "Type") + if azureType == "SelfHosted" { + return "azurerm_data_factory_integration_runtime_self_hosted" + } + // item.Properties.ManagedIntegrationRuntimeTypeProperties.SsisProperties + if typeProperties := getFieldFrom(properties, "ManagedIntegrationRuntimeTypeProperties"); typeProperties.IsValid() { + managedRuntime := typeProperties.Interface() + SsisProperties := getFieldFrom(managedRuntime, "SsisProperties") + if SsisProperties.IsNil() { + return "azurerm_data_factory_integration_runtime_azure" + } + } + return "azurerm_data_factory_integration_runtime_azure_ssis" +} + +func (g *DataFactoryGenerator) createIntegrationRuntimesResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, authorizer := g.getArgsProperties() + client := datafactory.NewIntegrationRuntimesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + var resources []terraformutils.Resource + for _, factory := range dataFactories { + id, err := ParseAzureResourceID(*factory.ID) + if err != nil { + return nil, err + } + iterator, err := client.ListByFactoryComplete(ctx, id.ResourceGroup, *factory.Name) + if err != nil { + return nil, err + } + for iterator.NotDone() { + item := iterator.Value() + resourceType := getIntegrationRuntimeType(item.Properties) + resources = g.appendResourceAs(resources, *item.ID, *item.Name, resourceType) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + } + return resources, nil +} + +func (g *DataFactoryGenerator) createLinkedServiceResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, authorizer := g.getArgsProperties() + client := datafactory.NewLinkedServicesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + var resources []terraformutils.Resource + for _, factory := range dataFactories { + id, err := ParseAzureResourceID(*factory.ID) + if err != nil { + return nil, err + } + iterator, err := client.ListByFactoryComplete(ctx, id.ResourceGroup, *factory.Name) + if err != nil { + return nil, err + } + for iterator.NotDone() { + item := iterator.Value() + resources = g.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) + if err = iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + } + return resources, nil +} + +func (g *DataFactoryGenerator) createPipelineResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, authorizer := g.getArgsProperties() + client := datafactory.NewPipelinesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + var resources []terraformutils.Resource + for _, factory := range dataFactories { + id, err := ParseAzureResourceID(*factory.ID) + if err != nil { + return nil, err + } + iterator, err := client.ListByFactoryComplete(ctx, id.ResourceGroup, *factory.Name) + if err != nil { + return nil, err + } + for iterator.NotDone() { + item := iterator.Value() + resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_pipeline") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + } + return resources, nil +} + +func (g *DataFactoryGenerator) createPipelineTriggerScheduleResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, authorizer := g.getArgsProperties() + client := datafactory.NewTriggersClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + var resources []terraformutils.Resource + for _, factory := range dataFactories { + id, err := ParseAzureResourceID(*factory.ID) + if err != nil { + return nil, err + } + iterator, err := client.ListByFactoryComplete(ctx, id.ResourceGroup, *factory.Name) + if err != nil { + return nil, err + } + for iterator.NotDone() { + item := iterator.Value() + resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_trigger_schedule") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + } + return resources, nil +} + +func (g *DataFactoryGenerator) createPipelineDatasetResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, authorizer := g.getArgsProperties() + client := datafactory.NewDatasetsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + var resources []terraformutils.Resource + for _, factory := range dataFactories { + id, err := ParseAzureResourceID(*factory.ID) + if err != nil { + return nil, err + } + iterator, err := client.ListByFactoryComplete(ctx, id.ResourceGroup, *factory.Name) + if err != nil { + return nil, err + } + for iterator.NotDone() { + item := iterator.Value() + resources = g.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + } + return resources, nil +} + +func (g *DataFactoryGenerator) InitResources() error { + + dataFactories, err := g.listFactories() + if err != nil { + return err + } + + factoriesFunctions := []func([]datafactory.Factory) ([]terraformutils.Resource, error){ + g.createDataFactoryResources, + g.createIntegrationRuntimesResources, + g.createLinkedServiceResources, + g.createPipelineResources, + g.createPipelineTriggerScheduleResources, + g.createPipelineDatasetResources, + } + + for _, f := range factoriesFunctions { + resources, ero := f(dataFactories) + if ero != nil { + return ero + } + g.Resources = append(g.Resources, resources...) + } + return nil +} + +func asHereDoc(json string) string { + return fmt.Sprintf(`< Date: Thu, 1 Jul 2021 12:39:21 +0300 Subject: [PATCH 200/276] Update version.go (#975) --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 1af2971839..a7c7e0023c 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.14" +const version = "v0.8.15" var versionCmd = &cobra.Command{ Use: "version", From ce0fb10a42772da9ce3450f908e516509ff884c0 Mon Sep 17 00:00:00 2001 From: Alessio Melani Date: Fri, 2 Jul 2021 13:37:45 +0200 Subject: [PATCH 201/276] fixed #976 (#978) --- providers/aws/firehose.go | 9 ++++++++- providers/datadog/datadog_provider.go | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/providers/aws/firehose.go b/providers/aws/firehose.go index 00c8945ca7..f4f09a8ea7 100644 --- a/providers/aws/firehose.go +++ b/providers/aws/firehose.go @@ -16,6 +16,7 @@ package aws import ( "context" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/aws/aws-sdk-go-v2/service/firehose" @@ -49,8 +50,12 @@ func (g *FirehoseGenerator) InitResources() error { } svc := firehose.NewFromConfig(config) var streamNames []string + var lastStreamName *string for { - output, err := svc.ListDeliveryStreams(context.TODO(), &firehose.ListDeliveryStreamsInput{}) + output, err := svc.ListDeliveryStreams(context.TODO(), &firehose.ListDeliveryStreamsInput{ + ExclusiveStartDeliveryStreamName: lastStreamName, + Limit: aws.Int32(100), + }) if err != nil { return err } @@ -58,6 +63,8 @@ func (g *FirehoseGenerator) InitResources() error { if !*output.HasMoreDeliveryStreams { break } + + lastStreamName = aws.String(streamNames[len(streamNames)-1]) } g.Resources = g.createResources(streamNames) diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 0301fc62c4..212b56d2f5 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -163,9 +163,9 @@ func (p *DatadogProvider) GetName() string { // GetConfig return map of provider config for Datadog func (p *DatadogProvider) GetConfig() cty.Value { return cty.ObjectVal(map[string]cty.Value{ - "api_key": cty.StringVal(p.apiKey), - "app_key": cty.StringVal(p.appKey), - "api_url": cty.StringVal(p.apiURL), + "api_key": cty.StringVal(p.apiKey), + "app_key": cty.StringVal(p.appKey), + "api_url": cty.StringVal(p.apiURL), "validate": cty.BoolVal(p.validate), }) } From 6135346ca4c287d4ea90c9cb834601b3cd0ac969 Mon Sep 17 00:00:00 2001 From: Ethan Pransky Date: Sun, 4 Jul 2021 20:21:41 +0300 Subject: [PATCH 202/276] prevent vault root acl policy from being imported. this policy cannot be updated or deleted and has no hcl associated so it does not seem proper to manage in terraform generally (#980) --- providers/vault/vault_service_generator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/providers/vault/vault_service_generator.go b/providers/vault/vault_service_generator.go index f34b13a46d..502d31c59b 100644 --- a/providers/vault/vault_service_generator.go +++ b/providers/vault/vault_service_generator.go @@ -195,6 +195,9 @@ func (g *ServiceGenerator) createPolicyResources() error { return err } for _, policy := range policies { + if policy == "root" { + continue + } g.Resources = append(g.Resources, terraformutils.NewSimpleResource( policy, @@ -269,10 +272,6 @@ func (g *ServiceGenerator) PostConvertHook() error { %s POLICY`, sanitizedPolicy) } - case "vault_policy": - if _, ok := resource.Item["policy"]; !ok { - resource.Item["policy"] = "" - } case "vault_ldap_auth_backend_group": if policies, ok := resource.Item["policies"]; ok { var strPolicies []string From c0e7990a5bff30a2bea5b15ba8b4e4d3d197c51b Mon Sep 17 00:00:00 2001 From: Alex Bulankou Date: Fri, 16 Jul 2021 11:48:37 -0700 Subject: [PATCH 203/276] Adding security policy. (#986) Adding security policy using go.co/vulnz. --- SECURITY.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..ce1f393f64 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,4 @@ +To report a security issue, please use http://g.co/vulnz. We use +http://g.co/vulnz for our intake, and do coordination and disclosure here on +GitHub (including using GitHub Security Advisory). The Google Security Team will +respond within 5 working days of your report on g.co/vulnz. From a535b6d3a6243c3127d24ed355ca02780e8403ab Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Fri, 16 Jul 2021 14:49:35 -0400 Subject: [PATCH 204/276] Fix ignored blocks when all attributes are ignored although it includes nested blocks (#985) * fix missing widgets * remove debug log lines * remove committed binary --- terraformutils/providerwrapper/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraformutils/providerwrapper/provider.go b/terraformutils/providerwrapper/provider.go index 7729f7266a..153781d307 100644 --- a/terraformutils/providerwrapper/provider.go +++ b/terraformutils/providerwrapper/provider.go @@ -151,7 +151,7 @@ func (p *ProviderWrapper) readObjBlocks(block map[string]*configschema.NestedBlo } } } - if fieldCount == len(v.Block.Attributes) && fieldCount > 0 { + if fieldCount == len(v.Block.Attributes) && fieldCount > 0 && len(v.BlockTypes) == 0 { readOnlyAttributes = append(readOnlyAttributes, "^"+k) } } From ce95fd4873f9ccb123b34bb35f6ddcc511131add Mon Sep 17 00:00:00 2001 From: v0lumehi <34629096+v0lumehi@users.noreply.github.com> Date: Fri, 23 Jul 2021 12:51:20 +0200 Subject: [PATCH 205/276] Fixed Offset not increasing when fetching Pagerduty API (#993) * Fixed Offset not increasing when fetching Pagerduty API * applied go fmt * applied linting --- .gitignore | 5 ++- providers/pagerduty/escalation_policy.go | 2 +- providers/pagerduty/ruleset.go | 4 +- providers/pagerduty/schedule.go | 2 +- providers/pagerduty/service.go | 54 +++++++++++++++--------- providers/pagerduty/team.go | 4 +- providers/pagerduty/user.go | 2 +- 7 files changed, 45 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index e630865c70..73c470e5b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ .idea generated -terraformer +terraformer* +cmd/tmp .DS_Store .terraform .vscode terraform.tfstate terraform.tfstate.backup -init.tf \ No newline at end of file +init.tf diff --git a/providers/pagerduty/escalation_policy.go b/providers/pagerduty/escalation_policy.go index c5d7732ca9..3bd87bf356 100644 --- a/providers/pagerduty/escalation_policy.go +++ b/providers/pagerduty/escalation_policy.go @@ -43,7 +43,7 @@ func (g *EscalationPolicyGenerator) createEscalationPolicyResources(client *page )) } - if resp.More != true { + if !resp.More { break } diff --git a/providers/pagerduty/ruleset.go b/providers/pagerduty/ruleset.go index 4976dc91ec..4be5db4cf3 100644 --- a/providers/pagerduty/ruleset.go +++ b/providers/pagerduty/ruleset.go @@ -42,6 +42,8 @@ func (g *RulesetGenerator) createRulesetResources(client *pagerduty.Client) erro return nil } +// golangci-lint says this function isn't used anywhere. Do we need it? Commenting it out to make the linter happy +/* func (g *RulesetGenerator) createRulesetRuleResources(client *pagerduty.Client) error { resp, _, err := client.Rulesets.List() if err != nil { @@ -67,7 +69,7 @@ func (g *RulesetGenerator) createRulesetRuleResources(client *pagerduty.Client) return nil } - +*/ func (g *RulesetGenerator) InitResources() error { client, err := g.Client() if err != nil { diff --git a/providers/pagerduty/schedule.go b/providers/pagerduty/schedule.go index 7f9683cb8a..3b28da3aa4 100644 --- a/providers/pagerduty/schedule.go +++ b/providers/pagerduty/schedule.go @@ -44,7 +44,7 @@ func (g *ScheduleGenerator) createScheduleResources(client *pagerduty.Client) er []string{}, )) } - if resp.More != true { + if !resp.More { break } diff --git a/providers/pagerduty/service.go b/providers/pagerduty/service.go index 0ff95cae0e..e5b887bd11 100644 --- a/providers/pagerduty/service.go +++ b/providers/pagerduty/service.go @@ -30,7 +30,7 @@ func (g *ServiceGenerator) createServiceResources(client *pagerduty.Client) erro options := pagerduty.ListServicesOptions{} for { options.Offset = offset - resp, _, err := client.Services.List(&pagerduty.ListServicesOptions{}) + resp, _, err := client.Services.List(&options) if err != nil { return err } @@ -45,10 +45,9 @@ func (g *ServiceGenerator) createServiceResources(client *pagerduty.Client) erro )) } - if resp.More != true { + if !resp.More { break } - offset += resp.Limit } @@ -56,29 +55,44 @@ func (g *ServiceGenerator) createServiceResources(client *pagerduty.Client) erro } func (g *ServiceGenerator) createServiceEventRuleResources(client *pagerduty.Client) error { - resp, _, err := client.Services.List(&pagerduty.ListServicesOptions{}) - if err != nil { - return err - } - - for _, service := range resp.Services { - rules, _, err := client.Services.ListEventRules(service.ID, &pagerduty.ListServiceEventRuleOptions{}) - + var offset = 0 + options := pagerduty.ListServicesOptions{} + optionsEventRules := pagerduty.ListServiceEventRuleOptions{} + for { + options.Offset = offset + optionsEventRules.Offset = offset + resp, _, err := client.Services.List(&options) if err != nil { return err } - for _, rule := range rules.EventRules { - g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - fmt.Sprintf("%s.%s", service.ID, rule.ID), - fmt.Sprintf("%s_%s", service.Name, rule.ID), - "pagerduty_service_event_rule", - g.ProviderName, - []string{}, - )) + for _, service := range resp.Services { + rules, _, err := client.Services.ListEventRules(service.ID, &optionsEventRules) + + if err != nil { + return err + } + + for _, rule := range rules.EventRules { + g.Resources = append(g.Resources, terraformutils.NewResource( + rule.ID, + fmt.Sprintf("%s_%s", service.Name, rule.ID), + "pagerduty_service_event_rule", + g.ProviderName, + map[string]string{ + "service": service.ID, + }, + []string{}, + map[string]interface{}{}, + )) + } } - } + if !resp.More { + break + } + offset += resp.Limit + } return nil } diff --git a/providers/pagerduty/team.go b/providers/pagerduty/team.go index a4c3786540..fab6ffe92b 100644 --- a/providers/pagerduty/team.go +++ b/providers/pagerduty/team.go @@ -44,7 +44,7 @@ func (g *TeamGenerator) createTeamResources(client *pagerduty.Client) error { []string{}, )) } - if resp.More != true { + if !resp.More { break } @@ -84,7 +84,7 @@ func (g *TeamGenerator) createTeamMembershipResources(client *pagerduty.Client) } } - if resp.More != true { + if !resp.More { break } diff --git a/providers/pagerduty/user.go b/providers/pagerduty/user.go index b9b3c65669..dce4b39214 100644 --- a/providers/pagerduty/user.go +++ b/providers/pagerduty/user.go @@ -45,7 +45,7 @@ func (g *UserGenerator) createUserResources(client *pagerduty.Client) error { )) } - if resp.More != true { + if !resp.More { break } From 6cfd97c7b6508d039d2eda292dd8ac94a495d49e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Jul 2021 10:02:36 +0300 Subject: [PATCH 206/276] Bump reviewdog/action-golangci-lint from 1 to 2 (#1001) Bumps [reviewdog/action-golangci-lint](https://github.com/reviewdog/action-golangci-lint) from 1 to 2. - [Release notes](https://github.com/reviewdog/action-golangci-lint/releases) - [Commits](https://github.com/reviewdog/action-golangci-lint/compare/v1...v2) --- updated-dependencies: - dependency-name: reviewdog/action-golangci-lint dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 8494815e90..c1cf615fc0 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -16,7 +16,7 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 + uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.GITHUB_TOKEN }} tool_name: golangci-lint From 6fd4836de84acbf3b1474f9481f4e5edfa7e30a2 Mon Sep 17 00:00:00 2001 From: Tim Jonas Meinerzhagen <34220101+timmeinerzhagen@users.noreply.github.com> Date: Tue, 27 Jul 2021 09:02:48 +0200 Subject: [PATCH 207/276] Change GitHub repo collaborator name to login (#998) --- providers/github/repositories.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/github/repositories.go b/providers/github/repositories.go index 447a36ee6d..2a9432663e 100644 --- a/providers/github/repositories.go +++ b/providers/github/repositories.go @@ -120,8 +120,8 @@ func (g *RepositoriesGenerator) createRepositoryCollaboratorResources(ctx contex } for _, collaborator := range collaborators { resources = append(resources, terraformutils.NewSimpleResource( - repo.GetName()+":"+collaborator.GetName(), - repo.GetName()+":"+collaborator.GetName(), + repo.GetName()+":"+collaborator.GetLogin(), + repo.GetName()+":"+collaborator.GetLogin(), "github_repository_collaborator", "github", []string{}, From 57dc58fb8fe9aabb82ed1bf4885d8ea0c0b86527 Mon Sep 17 00:00:00 2001 From: Kevin <7149904+Bladou46@users.noreply.github.com> Date: Tue, 27 Jul 2021 09:03:52 +0200 Subject: [PATCH 208/276] =?UTF-8?q?=E2=9C=A8=20If=20there=20is=20no=20OsPr?= =?UTF-8?q?ofile=20property,=20use=20the=20OsDisk=20to=20check=20the=20ost?= =?UTF-8?q?ype=20(#989)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/azure/virtual_machine.go | 44 +++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/providers/azure/virtual_machine.go b/providers/azure/virtual_machine.go index f0cb8006c7..789cc8ce0c 100644 --- a/providers/azure/virtual_machine.go +++ b/providers/azure/virtual_machine.go @@ -33,20 +33,38 @@ func (g VirtualMachineGenerator) createResources(virtualMachineListResultIterato for virtualMachineListResultIterator.NotDone() { vm := virtualMachineListResultIterator.Value() var newResource terraformutils.Resource - if vm.VirtualMachineProperties.OsProfile.WindowsConfiguration != nil { - newResource = terraformutils.NewSimpleResource( - *vm.ID, - *vm.Name, - "azurerm_windows_virtual_machine", - "azurerm", - []string{}) + if vm.VirtualMachineProperties.OsProfile == nil { + if vm.VirtualMachineProperties.StorageProfile.OsDisk.OsType == "Windows" { + newResource = terraformutils.NewSimpleResource( + *vm.ID, + *vm.Name, + "azurerm_windows_virtual_machine", + "azurerm", + []string{}) + } else { + newResource = terraformutils.NewSimpleResource( + *vm.ID, + *vm.Name, + "azurerm_linux_virtual_machine", + "azurerm", + []string{}) + } } else { - newResource = terraformutils.NewSimpleResource( - *vm.ID, - *vm.Name, - "azurerm_linux_virtual_machine", - "azurerm", - []string{}) + if vm.VirtualMachineProperties.OsProfile.WindowsConfiguration != nil { + newResource = terraformutils.NewSimpleResource( + *vm.ID, + *vm.Name, + "azurerm_windows_virtual_machine", + "azurerm", + []string{}) + } else { + newResource = terraformutils.NewSimpleResource( + *vm.ID, + *vm.Name, + "azurerm_linux_virtual_machine", + "azurerm", + []string{}) + } } resources = append(resources, newResource) From 8d1ee49ad7648d11fa727556f2a6904710a1f76b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Jul 2021 10:04:01 +0300 Subject: [PATCH 209/276] Bump actions/stale from 3 to 4 (#988) Bumps [actions/stale](https://github.com/actions/stale) from 3 to 4. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/stale.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 311c520141..88cf4faedb 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v4 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.' From 2571c21a6144debed8590fdf87734988c7a4c216 Mon Sep 17 00:00:00 2001 From: Olin-Vorechovsky-Avast <70371470+Olin-Vorechovsky@users.noreply.github.com> Date: Tue, 27 Jul 2021 09:42:33 +0200 Subject: [PATCH 210/276] Add organization resource to be able to have members, blocked users and organization projects in the same state file. (#995) * Add organization resource with memberships, blocked users and organization projects. * Refactor InitResources() to be able to reuse that code. --- providers/github/github_organization.go | 39 ++++++++++++++++++++++++ providers/github/github_provider.go | 1 + providers/github/github_service.go | 5 ++- providers/github/members.go | 19 +++++++++--- providers/github/organization_block.go | 16 ++++++++-- providers/github/organization_project.go | 15 +++++++-- 6 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 providers/github/github_organization.go diff --git a/providers/github/github_organization.go b/providers/github/github_organization.go new file mode 100644 index 0000000000..ab972fbd99 --- /dev/null +++ b/providers/github/github_organization.go @@ -0,0 +1,39 @@ +// Copyright 2020 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package github + +import ( + "context" +) + +type OrganizationGenerator struct { + GithubService +} + +// Generate TerraformResources from Github API +func (g *OrganizationGenerator) InitResources() error { + ctx := context.Background() + client, err := g.createClient() + if err != nil { + return err + } + + owner := g.Args["owner"].(string) + g.Resources = append(g.Resources, createMembershipsResources(ctx, client, owner)...) + g.Resources = append(g.Resources, createOrganizationBlocksResources(ctx, client, owner)...) + g.Resources = append(g.Resources, createOrganizationProjects(ctx, client, owner)...) + + return nil +} diff --git a/providers/github/github_provider.go b/providers/github/github_provider.go index b1fbd3a07a..59e6f0c5f7 100644 --- a/providers/github/github_provider.go +++ b/providers/github/github_provider.go @@ -97,6 +97,7 @@ func (p *GithubProvider) InitService(serviceName string, verbose bool) error { func (p *GithubProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ "members": &MembersGenerator{}, + "organization": &OrganizationGenerator{}, "organization_blocks": &OrganizationBlockGenerator{}, "organization_projects": &OrganizationProjectGenerator{}, "organization_webhooks": &OrganizationWebhooksGenerator{}, diff --git a/providers/github/github_service.go b/providers/github/github_service.go index 6bd5bd3332..583aeb8e19 100644 --- a/providers/github/github_service.go +++ b/providers/github/github_service.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/google/go-github/v35/github" - githubAPI "github.com/google/go-github/v35/github" "golang.org/x/oauth2" ) @@ -42,7 +41,7 @@ func (g *GithubService) createRegularClient() *github.Client { &oauth2.Token{AccessToken: g.Args["token"].(string)}, ) tc := oauth2.NewClient(ctx, ts) - return githubAPI.NewClient(tc) + return github.NewClient(tc) } func (g *GithubService) createEnterpriseClient() (*github.Client, error) { @@ -52,5 +51,5 @@ func (g *GithubService) createEnterpriseClient() (*github.Client, error) { ) tc := oauth2.NewClient(ctx, ts) baseURL := g.GetArgs()["base_url"].(string) - return githubAPI.NewEnterpriseClient(baseURL, baseURL, tc) + return github.NewEnterpriseClient(baseURL, baseURL, tc) } diff --git a/providers/github/members.go b/providers/github/members.go index 22e8052e6a..2ade475892 100644 --- a/providers/github/members.go +++ b/providers/github/members.go @@ -36,13 +36,22 @@ func (g *MembersGenerator) InitResources() error { return err } + owner := g.Args["owner"].(string) + g.Resources = append(g.Resources, createMembershipsResources(ctx, client, owner)...) + + return nil +} + +func createMembershipsResources(ctx context.Context, client *githubAPI.Client, owner string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &githubAPI.ListMembersOptions{ ListOptions: githubAPI.ListOptions{PerPage: 100}, } // List all organization members for the authenticated user for { - members, resp, err := client.Organizations.ListMembers(ctx, g.Args["owner"].(string), opt) + members, resp, err := client.Organizations.ListMembers(ctx, owner, opt) if err != nil { log.Println(err) return nil @@ -50,14 +59,15 @@ func (g *MembersGenerator) InitResources() error { for _, member := range members { resource := terraformutils.NewSimpleResource( - g.Args["owner"].(string)+":"+member.GetLogin(), + owner+":"+member.GetLogin(), member.GetLogin(), "github_membership", "github", []string{}, ) resource.SlowQueryRequired = true - g.Resources = append(g.Resources, resource) + + resources = append(resources, resource) } if resp.NextPage == 0 { @@ -65,5 +75,6 @@ func (g *MembersGenerator) InitResources() error { } opt.Page = resp.NextPage } - return nil + + return resources } diff --git a/providers/github/organization_block.go b/providers/github/organization_block.go index 6d82c910cc..fd7de4df1e 100644 --- a/providers/github/organization_block.go +++ b/providers/github/organization_block.go @@ -35,11 +35,20 @@ func (g *OrganizationBlockGenerator) InitResources() error { return err } + owner := g.Args["owner"].(string) + g.Resources = append(g.Resources, createOrganizationBlocksResources(ctx, client, owner)...) + + return nil +} + +func createOrganizationBlocksResources(ctx context.Context, client *githubAPI.Client, owner string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &githubAPI.ListOptions{PerPage: 100} // List all organization blocks for the authenticated user for { - blocks, resp, err := client.Organizations.ListBlockedUsers(ctx, g.Args["owner"].(string), opt) + blocks, resp, err := client.Organizations.ListBlockedUsers(ctx, owner, opt) if err != nil { log.Println(err) return nil @@ -54,7 +63,8 @@ func (g *OrganizationBlockGenerator) InitResources() error { []string{}, ) resource.SlowQueryRequired = true - g.Resources = append(g.Resources, resource) + + resources = append(resources, resource) } if resp.NextPage == 0 { @@ -62,5 +72,5 @@ func (g *OrganizationBlockGenerator) InitResources() error { } opt.Page = resp.NextPage } - return nil + return resources } diff --git a/providers/github/organization_project.go b/providers/github/organization_project.go index 207400c6a8..d56f23c427 100644 --- a/providers/github/organization_project.go +++ b/providers/github/organization_project.go @@ -36,13 +36,22 @@ func (g *OrganizationProjectGenerator) InitResources() error { return err } + owner := g.Args["owner"].(string) + g.Resources = append(g.Resources, createOrganizationProjects(ctx, client, owner)...) + + return nil +} + +func createOrganizationProjects(ctx context.Context, client *githubAPI.Client, owner string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &githubAPI.ProjectListOptions{ ListOptions: githubAPI.ListOptions{PerPage: 100}, } // List all organization projects for the authenticated user for { - projects, resp, err := client.Organizations.ListProjects(ctx, g.Args["owner"].(string), opt) + projects, resp, err := client.Organizations.ListProjects(ctx, owner, opt) if err != nil { log.Println(err) return nil @@ -57,7 +66,7 @@ func (g *OrganizationProjectGenerator) InitResources() error { []string{}, ) resource.SlowQueryRequired = true - g.Resources = append(g.Resources, resource) + resources = append(resources, resource) } if resp.NextPage == 0 { @@ -65,5 +74,5 @@ func (g *OrganizationProjectGenerator) InitResources() error { } opt.Page = resp.NextPage } - return nil + return resources } From dd5512db1e7408e05e9f9a96b1f35c94ddf82587 Mon Sep 17 00:00:00 2001 From: rajnadimpalli <55568696+rajnadimpalli@users.noreply.github.com> Date: Tue, 27 Jul 2021 22:51:58 +1000 Subject: [PATCH 211/276] Add Okta Provider (#1000) * Add Okta Support * Update Okta Provider Iteration 1 * Update Okta Provider Iteration 2 --- README.md | 2 + cmd/provider_cmd_okta.go | 59 ++++ cmd/root.go | 2 + docs/okta.md | 40 +++ go.mod | 29 +- go.sum | 292 ++++++++++++++++-- providers/okta/authorization_server.go | 74 +++++ providers/okta/authorization_server_claim.go | 72 +++++ providers/okta/authorization_server_policy.go | 68 ++++ providers/okta/authorization_server_scope.go | 68 ++++ providers/okta/event_hook.go | 59 ++++ providers/okta/group.go | 61 ++++ providers/okta/group_rule.go | 59 ++++ providers/okta/helpers.go | 33 ++ providers/okta/inline_hook.go | 59 ++++ providers/okta/okta_provider.go | 112 +++++++ providers/okta/okta_service.go | 70 +++++ providers/okta/policy_mfa.go | 73 +++++ providers/okta/policy_password.go | 73 +++++ providers/okta/policy_rule_mfa.go | 90 ++++++ providers/okta/policy_rule_password.go | 90 ++++++ providers/okta/policy_rule_signon.go | 90 ++++++ providers/okta/policy_signon.go | 71 +++++ providers/okta/template_sms.go | 59 ++++ providers/okta/trusted_origin.go | 59 ++++ providers/okta/user.go | 59 ++++ providers/okta/user_type.go | 59 ++++ 27 files changed, 1843 insertions(+), 39 deletions(-) create mode 100644 cmd/provider_cmd_okta.go create mode 100644 docs/okta.md create mode 100644 providers/okta/authorization_server.go create mode 100644 providers/okta/authorization_server_claim.go create mode 100644 providers/okta/authorization_server_policy.go create mode 100644 providers/okta/authorization_server_scope.go create mode 100644 providers/okta/event_hook.go create mode 100644 providers/okta/group.go create mode 100644 providers/okta/group_rule.go create mode 100644 providers/okta/helpers.go create mode 100644 providers/okta/inline_hook.go create mode 100644 providers/okta/okta_provider.go create mode 100644 providers/okta/okta_service.go create mode 100644 providers/okta/policy_mfa.go create mode 100644 providers/okta/policy_password.go create mode 100644 providers/okta/policy_rule_mfa.go create mode 100644 providers/okta/policy_rule_password.go create mode 100644 providers/okta/policy_rule_signon.go create mode 100644 providers/okta/policy_signon.go create mode 100644 providers/okta/template_sms.go create mode 100644 providers/okta/trusted_origin.go create mode 100644 providers/okta/user.go create mode 100644 providers/okta/user_type.go diff --git a/README.md b/README.md index 47d98c319e..a50729e446 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [GmailFilter](/docs/gmailfilter.md) * [Grafana](/docs/grafana.md) * [Vault](/docs/vault.md) + * Identity + * [Okta](/docs/okta.md) - [Contributing](#contributing) - [Developing](#developing) - [Infrastructure](#infrastructure) diff --git a/cmd/provider_cmd_okta.go b/cmd/provider_cmd_okta.go new file mode 100644 index 0000000000..db870f1293 --- /dev/null +++ b/cmd/provider_cmd_okta.go @@ -0,0 +1,59 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + "errors" + "os" + + okta_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/okta" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdOktaImporter(options ImportOptions) *cobra.Command { + cmd := &cobra.Command{ + Use: "okta", + Short: "Import current State to terraform configuration from okta", + Long: "Import current State to terraform configuration from okta", + RunE: func(cmd *cobra.Command, args []string) error { + token := os.Getenv("OKTA_API_TOKEN") + if len(token) == 0 { + return errors.New("API Token for Okta must be set through `OKTA_API_TOKEN` env var") + } + baseURL := os.Getenv("OKTA_BASE_URL") + if len(baseURL) == 0 { + return errors.New("Base URL for Okta must be set through `OKTA_BASE_URL` env var") + } + orgName := os.Getenv("OKTA_ORG_NAME") + if len(orgName) == 0 { + return errors.New("Org Name for Okta must be set through `OKTA_ORG_NAME` env var") + } + + provider := newOktaProvider() + err := Import(provider, options, []string{orgName, token, baseURL}) + if err != nil { + return err + } + return nil + }, + } + cmd.AddCommand(listCmd(newOktaProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "user", "okta_user=user1:user2:user3") + return cmd +} + +func newOktaProvider() terraformutils.ProviderGenerator { + return &okta_terraforming.OktaProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index b5f154e8b9..5fe804f2de 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -77,6 +77,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdXenorchestraImporter, newCmdGmailfilterImporter, newCmdVaultImporter, + newCmdOktaImporter, } } @@ -119,6 +120,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { newXenorchestraProvider, newGmailfilterProvider, newVaultProvider, + newOktaProvider, } { list[providerGen().GetName()] = providerGen } diff --git a/docs/okta.md b/docs/okta.md new file mode 100644 index 0000000000..25b697e13e --- /dev/null +++ b/docs/okta.md @@ -0,0 +1,40 @@ +### Use with Okta + +Example: + +``` +$ export OKTA_ORG_NAME= +$ export OKTA_BASE_URL= +$ export OKTA_API_TOKEN= +$ terraformer import okta --resources=user,group +``` + +List of supported Okta services: + +* `user` + * `okta_user` +* `user_type` +* `group` + * `okta_group` +* `policy` + * `okta_policy_password` + * `okta_policy_rule_password` + * `okta_policy_mfa` + * `okta_policy_rule_mfa` + * `okta_policy_signon` + * `okta_policy_rule_signon` +* `authorization_server` + * `okta_auth_server` + * `okta_auth_server_scope` + * `okta_auth_server_claim` + * `okta_auth_server_policy` +* `event_hook` +* `inline_hook` +* `template_sms` +* `trusted_origin` + + + + + + diff --git a/go.mod b/go.mod index 8b6accffaa..e10aa6bd67 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( cloud.google.com/go/storage v1.14.0 github.com/Azure/azure-sdk-for-go v42.3.0+incompatible github.com/Azure/azure-storage-blob-go v0.10.0 + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Azure/go-autorest/autorest v0.11.12 github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 @@ -17,8 +18,11 @@ require ( github.com/IBM/keyprotect-go-client v0.6.0 github.com/IBM/networking-go-sdk v0.13.0 github.com/IBM/vpc-go-sdk v0.4.1 + github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/OctopusDeploy/go-octopusdeploy v1.6.0 github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c + github.com/SAP/go-hdb v0.105.2 // indirect + github.com/SermoDigital/jose v0.9.1 // indirect github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 @@ -96,20 +100,28 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/cloudflare-go v0.13.6 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect + github.com/containerd/continuity v0.1.0 // indirect github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef + github.com/denisenkom/go-mssqldb v0.10.0 // indirect github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.57.0 + github.com/docker/go-connections v0.4.0 // indirect github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 + github.com/duosecurity/duo_api_golang v0.0.0-20201112143038-0e07e9f869e3 // indirect + github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect github.com/fastly/go-fastly/v3 v3.6.0 + github.com/fatih/structs v1.1.0 // indirect + github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d // indirect github.com/google/go-github/v35 v35.1.0 github.com/gophercloud/gophercloud v0.17.0 github.com/grafana/grafana-api-golang-client v0.0.0-20210218192924-9ccd2365d2a6 github.com/hashicorp/go-azure-helpers v0.10.0 - github.com/hashicorp/go-cleanhttp v0.5.1 - github.com/hashicorp/go-hclog v0.15.0 - github.com/hashicorp/go-plugin v1.4.0 + github.com/hashicorp/go-cleanhttp v0.5.2 + github.com/hashicorp/go-hclog v0.16.2 + github.com/hashicorp/go-memdb v1.3.2 // indirect + github.com/hashicorp/go-plugin v1.4.1 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.31 github.com/hashicorp/vault v0.10.4 @@ -117,6 +129,7 @@ require ( github.com/heroku/heroku-go/v5 v5.1.0 github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 + github.com/jefferai/jsonx v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 github.com/jonboydell/logzio_client v1.2.0 github.com/labd/commercetools-go-sdk v0.3.1 @@ -124,6 +137,11 @@ require ( github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/nicksnyder/go-i18n v1.10.1 // indirect github.com/ns1/ns1-go v2.4.0+incompatible + github.com/okta/okta-sdk-golang/v2 v2.3.1 + github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9 + github.com/opencontainers/image-spec v1.0.1 // indirect + github.com/opencontainers/runc v1.0.1 // indirect + github.com/ory/dockertest v3.3.5+incompatible // indirect github.com/packethost/packngo v0.9.0 github.com/paultyng/go-newrelic/v4 v4.10.0 github.com/pkg/errors v0.9.1 @@ -135,14 +153,15 @@ require ( github.com/vultr/govultr v0.5.0 github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 - github.com/zclconf/go-cty v1.7.1 + github.com/zclconf/go-cty v1.8.4 github.com/zorkian/go-datadog-api v2.30.0+incompatible golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 - golang.org/x/text v0.3.5 + golang.org/x/text v0.3.6 gonum.org/v1/gonum v0.7.0 google.golang.org/api v0.40.0 google.golang.org/genproto v0.0.0-20210226172003-ab064af71705 gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect + gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect k8s.io/apimachinery v0.21.0 k8s.io/client-go v0.21.0 ) diff --git a/go.sum b/go.sum index 55d0231e4e..efb754fd2f 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -11,6 +12,7 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= @@ -50,6 +52,8 @@ github.com/Azure/azure-sdk-for-go v42.3.0+incompatible h1:PAHkmPqd/vQV4LJcqzEUM1 github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.10.0 h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs= github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESNmQdijykocJ0YOxmMX8SE= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -109,27 +113,47 @@ github.com/IBM/networking-go-sdk v0.13.0 h1:MKDL0c5Gnc6BT10lCS1S1pZVz71UmX4mJC4e github.com/IBM/networking-go-sdk v0.13.0/go.mod h1:3/QnBTwCXAWoz98dw3z37UUfpkIwAwi8qDGntNt6F6A= github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= +github.com/Jeffail/gabs/v2 v2.1.0 h1:6dV9GGOjoQgzWTQEltZPXlJdFloxvIq7DwqgxMCbq30= +github.com/Jeffail/gabs/v2 v2.1.0/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c h1:4uQRvqtOkn0n4zb9BbYHhXzAmWDd25T6TfnE5I5gpFg= github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c/go.mod h1:xpwEKL6CHhniRcqKYTjIiGBzPd3QIyto3sz2ynsP1qg= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/SAP/go-hdb v0.105.2 h1:ZVsCj1fMBYFfAG9ZlsA9ARmM3dv24tzotBS2ghyKY0c= +github.com/SAP/go-hdb v0.105.2/go.mod h1:+xdpA6/O3mALSp1bmn8yldN2aq1TCxZ7Ah0AuAm8B7E= +github.com/SermoDigital/jose v0.9.1 h1:atYaHPD3lPICcbK1owly3aPm0iaJGSGPi0WD4vLznv8= +github.com/SermoDigital/jose v0.9.1/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 h1:fJ4XPqxuZfm11zauw9XX7c30P8xwDyucdWu8H6Htrxs= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= @@ -138,12 +162,15 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.60.295/go.mod h1:mNZkuqaeM5UCiAdkV4r+l github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= +github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= -github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -151,16 +178,20 @@ github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2 github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc h1:LoL75er+LKDHDUfU5tRvFwxH0LjPpZN8OoG8Ll+liGU= github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc/go.mod h1:w648aMHEgFYS6xb0KVMMtZ2uMeemhiKCuD2vj6gY52A= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= @@ -168,8 +199,9 @@ github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQP github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/aws/aws-sdk-go v1.37.0 h1:GzFnhOIsrGyQ69s7VgqtrG2BG8v7X7vwB3Xpbd/DBBk= +github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v1.3.0/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+testmuQeRY= github.com/aws/aws-sdk-go-v2 v1.3.1/go.mod h1:5SmWRTjN6uTRFNCc7rR69xHsdcUJnthmaRHGDsYhpTE= github.com/aws/aws-sdk-go-v2 v1.3.2/go.mod h1:7OaACgj2SX3XGWnrIjGlJM22h6yD6MEWKvm7levnnM8= @@ -331,28 +363,40 @@ github.com/aws/smithy-go v1.3.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAm github.com/aws/smithy-go v1.4.0 h1:3rsQpgRe+OoQgJhEwGNpIkosl0fJLdmQqF4gSFRjg+4= github.com/aws/smithy-go v1.4.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= +github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= +github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= +github.com/bflad/tfproviderlint v0.27.0/go.mod h1:7Z9Pyl1Z1UWJcPBuyjN89D2NaJGpjReQb5NoaaQCthQ= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.13.6 h1:G6aw092fOkvkHODCxf8EHLPqHN2BVxHU4RoTFjS51xo= github.com/cloudflare/cloudflare-go v0.13.6/go.mod h1:gNGW6MkPPVLhjgaXq4vaS7WnTaQpCfl6DE1W9JuWyt8= @@ -361,6 +405,9 @@ github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/continuity v0.1.0 h1:UFRRY5JemiAhPZrr/uE0n8fMTLcZsUvySPr1+D7pgr8= +github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -370,23 +417,31 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/crewjam/httperr v0.0.0-20190612203328-a946449404da/go.mod h1:+rmNIXRvYMqLQeR4DHyTvs6y0MEMymTz4vyFpFkKTPs= +github.com/crewjam/saml v0.4.5 h1:H9u+6CZAESUKHxMyxUbVn0IawYvKZn4nt3d4ccV4O/M= +github.com/crewjam/saml v0.4.5/go.mod h1:qCJQpUtZte9R1ZjUBcW8qtCNlinbO363ooNl02S68bk= github.com/cucumber/gherkin-go/v13 v13.0.0 h1:d09AwPZldyOFlCADAIZQMt7T+VHCrGdp5106+BCIfZU= github.com/cucumber/gherkin-go/v13 v13.0.0/go.mod h1:pzMEPEIPcPOBDkE8HaWC+Ck6eDBtBmIWVksUkSin/2E= github.com/cucumber/messages-go/v12 v12.0.0 h1:ZlZYZrYDDc35zCe0HK2y95GUcxHHqr8yB9kdrXCjnzU= github.com/cucumber/messages-go/v12 v12.0.0/go.mod h1:5zuJu21U6rB+BBqyGoQr839a4h4GUElPnSozdHyhCOQ= +github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/dave/jennifer v1.4.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9/go.mod h1:GgB8SF9nRG+GqaDtLcwJZsQFhcogVCJ79j4EdT0c2V4= github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4 h1:AMuZg5VR0/QGCqFpO4CUwAhZc4tbgDHpM8c4SvMt2yM= github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-20210401060029-7f652169b2c4/go.mod h1:JrRtRlTHCkdIr7OTHCAonKS2yWwmwdqnvf+JEy+OYAA= github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef h1:q/XC0MjIz8cl/NtyKKewDns6mNd2cUzLQ5Xnh+jGoRg= github.com/ddelnano/terraform-provider-xenorchestra/client v0.0.0-20210401070256-0d721c6762ef/go.mod h1:1T10mQuoIeT4CXsvyc1G1m/+L7mWv6p7cBwmAut/uB0= +github.com/denisenkom/go-mssqldb v0.10.0 h1:QykgLZBorFE95+gO3u9esLd0BmbvpWp0/waNNZfHBM8= +github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93 h1:ujQ4DKs+MqFWy/hoLAU4Ey/nQhqJ6pXyocMDbVJ4qSw= github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dghubble/sling v1.1.0 h1:DLu20Bq2qsB9cI5Hldaxj+TMPEaPpPE8IR2kvD22Atg= @@ -401,13 +456,23 @@ github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQ github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 h1:Od9CDqwkw5F3vjN8Lp8CQhkMOEjC70eTW+AJlTepE6g= github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884/go.mod h1:SB2lZXXkyipTEoPLxR3A5YglkZ7QwoXSsyI9h6yUeFc= +github.com/duosecurity/duo_api_golang v0.0.0-20201112143038-0e07e9f869e3 h1:7/i/g2rlBeX1DHg5xTrR2hiFi87ZrqRWV3eLZUApjdI= +github.com/duosecurity/duo_api_golang v0.0.0-20201112143038-0e07e9f869e3/go.mod h1:jdoEJUIrTIxN7nNTwwqA3TBNcSM+W1lrWM6OXVhjbG8= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= +github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE03qmvRTNfbw= +github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -419,18 +484,31 @@ github.com/fastly/go-fastly/v3 v3.6.0 h1:sRnI+MhyMkgZbQWaUnhr70gHk39kfpG9JpMUlSo github.com/fastly/go-fastly/v3 v3.6.0/go.mod h1:KOaCWsmkIKSASPzADl8PT/bTQIghOw/eEaxlHOu3jMA= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= github.com/go-bdd/gobdd v1.1.3 h1:eirGvZ9gMz6clOo2k6O7+Ys3iHAaFZoRQXVwV76B3JI= github.com/go-bdd/gobdd v1.1.3/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -466,6 +544,7 @@ github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhY github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730 h1:EuqwWLv/LPPjhvFqkeD2bz+FOlvw2DjvDI7vK8GVeyY= github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730/go.mod h1:em1mEqFKnoeQuQP9Sg7i26yaW8o05WwcNj7yLhrXxSQ= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -498,6 +577,9 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d h1:k544nNVphXK4Yt0FTduvOvCfJabEY/DMkdNw0zpCwBE= +github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -507,6 +589,8 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -537,11 +621,13 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -552,8 +638,10 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github/v35 v35.1.0 h1:KkwZnKWQ/0YryvXjZlCN/3EGRJNp6VCZPKo+RG9mG28= github.com/google/go-github/v35 v35.1.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -611,6 +699,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= +github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -622,32 +712,44 @@ github.com/hashicorp/go-azure-helpers v0.10.0/go.mod h1:YuAtHxm2v74s+IjQwUG88dHB github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.0.0-20170211013415-3573b8b52aa7/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 h1:l1KB3bHVdvegcIf5upQ5mjcHjs2qsWnKh4Yr9xgIuu8= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= +github.com/hashicorp/go-getter v1.5.2/go.mod h1:orNH3BTYLu/fIxGIdLjLoAJHWMDQ/UKQr5O4m3iBuoo= +github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= +github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.0 h1:8exGP7ego3OmkfksihtSouGMZ+hQrhxx+FVELeXpVPE= +github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-memdb v1.3.2 h1:RBKHOsnSszpU6vxq80LzC2BaQjuuvoyaQbkLTf7V7g8= +github.com/hashicorp/go-memdb v1.3.2/go.mod h1:Mluclgwib3R93Hk5fxEfiRhB+6Dar64wWh71LpNSe3g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= +github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= +github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -663,17 +765,22 @@ github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1 github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= +github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= -github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= +github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY= +github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -687,10 +794,23 @@ github.com/hashicorp/terraform v0.12.31/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhk github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2bHu4fjRB1H6Ag4U= +github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= +github.com/hashicorp/terraform-exec v0.13.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= +github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= +github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= +github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= +github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= +github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= -github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= +github.com/hashicorp/terraform-plugin-sdk v1.16.1 h1:G2iK7MBT4LuNcVASPXWS1ciBUuIm8oIY0zRfCmi3xy4= +github.com/hashicorp/terraform-plugin-sdk v1.16.1/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0/go.mod h1:grseeRo9g3yNkYW09iFlV8LG78jTa1ssBgouogQg/RU= +github.com/hashicorp/terraform-plugin-test/v2 v2.1.3/go.mod h1:pmaUHiUtDL/8Mz3FuyZ/vRDb0LpaOWQjVRW9ORF7FHs= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/vault v0.10.4 h1:4x0lHxui/ZRp/B3E0Auv1QNBJpzETqHR2kQD3mHSBJU= github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -703,18 +823,29 @@ github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZ github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570/go.mod h1:4X9u5iNUePRrRDdwjok6skjlQBXTcNfWa4C3uS1+5SQ= github.com/jarcoal/httpmock v1.0.5 h1:cHtVEcTxRSX4J0je7mWPfc9BpDpqzXSJ5HbymZmyHck= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= +github.com/jarcoal/httpmock v1.0.7/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jefferai/jsonx v1.0.1 h1:GvWkLWihoLqDG0BSP45TUQJH9qsINX50PVrFULgpc/I= +github.com/jefferai/jsonx v1.0.1/go.mod h1:yFo3l2fcm7cZVHGq3HKLXE+Pd4RWuRjNBDHksM7XekQ= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -726,8 +857,10 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jonboulle/clockwork v0.2.1 h1:S/EaQvW6FpWMYAvYvY+OBDvpaM+izu0oiwo5y0MH7U0= +github.com/jonboulle/clockwork v0.2.1/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/jonboydell/logzio_client v1.2.0 h1:SkvYSgpJcLG0P9agjwF99oFiKtBiaXH8MZt7OmtwmvQ= github.com/jonboydell/logzio_client v1.2.0/go.mod h1:ZXJYF4M9/chuG+4fQDS9BN6CqXqokUjtQOjdMqzGC/Y= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= @@ -746,18 +879,26 @@ github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= +github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -770,6 +911,7 @@ github.com/labd/commercetools-go-sdk v0.3.1 h1:Fk8/VKKDSNHhyVhDywJdmzUt3JSpNoFZb github.com/labd/commercetools-go-sdk v0.3.1/go.mod h1:I+KKNALlg6PcSertsVA7E442koO99GT7gldWqwZlUGo= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= @@ -789,6 +931,9 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e h1:qqXczln0qwkVGcpQ+sQuPOVntt2FytYarXXxYSNJkgw= +github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= @@ -810,19 +955,23 @@ github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee h1:7Ac2RNGC8DAw github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee/go.mod h1:yd3I5pyIO5TrBH7+Ym94u8qp9xc6NTHAqESeI8kOJY8= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.4 h1:ZU1VNC02qyufSZsjjs7+khruk2fKvbQ3TwRV/IBCeFA= +github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= @@ -839,9 +988,11 @@ github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -853,22 +1004,28 @@ github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSr github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 h1:TLDEP4t/KAbbIBVqMQlmf0MaLBm0eMAGHKtrOFNGHUM= github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409/go.mod h1:q1krA85sGCNuxTOIcH9WSFf4nEO7he+IDDf5SW+xs1s= +github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/okta/okta-sdk-golang/v2 v2.3.1-0.20210617075430-6c6c25f48f92/go.mod h1:G4GCqqnZJCt91zMqYhDMLhg2INVbjiiFKkQ2mnia1J0= +github.com/okta/okta-sdk-golang/v2 v2.3.1 h1:p50F8BuTyKH0yRIR58UU8a7AQ9rm7D1flqbyb+9msrk= +github.com/okta/okta-sdk-golang/v2 v2.3.1/go.mod h1:G4GCqqnZJCt91zMqYhDMLhg2INVbjiiFKkQ2mnia1J0= +github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9 h1:gC6OakV7GUVaTKm3KMpqVe9LOQfflzePtFsVDUbCPgo= +github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9/go.mod h1:G6kMVF+QIjldN0X6s1U8MAcHNOWwdwJiMWmeCyotCJc= github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -886,11 +1043,23 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v1.0.1 h1:G18PGckGdAm3yVQRWDVQ1rLSLntiniKJ0cNRT2Tm5gs= +github.com/opencontainers/runc v1.0.1/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/packethost/packngo v0.9.0 h1:dcrJFDNdbW+xCCNzWCmtol1x+hanEZmff5Myv/ku82U= github.com/packethost/packngo v0.9.0/go.mod h1:YrtUNN9IRjjqN6zK+cy2IYoi3EjHfoWTWxJkI1I1Vk0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 h1:pSCLCl6joCFRnjpeojzOpEYs4q7Vditq8fySFG5ap3Y= +github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/paultyng/go-newrelic/v4 v4.10.0 h1:6R2aC3vONWnfxbW00nAYZ9YSj7nJ3IvQRw2rG5KGijY= github.com/paultyng/go-newrelic/v4 v4.10.0/go.mod h1:RmSnSvZnV267IBAqv2/2RACv1YVmxaf+/ujOFS9DRb8= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= @@ -930,6 +1099,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russellhaering/goxmldsig v1.1.0 h1:lK/zeJie2sqG52ZAlPNn1oBBqsIsEKypUUBGpYYF6lk= +github.com/russellhaering/goxmldsig v1.1.0/go.mod h1:QK8GhXPB3+AfuCrfo0oRISa9NfzeCpWmxeGnqEpDF9o= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -939,13 +1110,20 @@ github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= +github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= @@ -963,6 +1141,7 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -972,6 +1151,7 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -987,6 +1167,7 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible h1:q+D/Y9jla3afgsIihtyhwyl0c2W+eRWNM9ohVwPiiPw= github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= @@ -1005,12 +1186,17 @@ github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFy github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= @@ -1018,6 +1204,7 @@ github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgq github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -1036,10 +1223,14 @@ github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.7.1 h1:AvsC01GMhMLFL8CgEYdHGM+yLnnDOwhPAYcgTkeF0Gw= github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= -github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= +github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= +github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= +github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zenazn/goji v0.9.1-0.20160507202103-64eb34159fe5/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -1065,6 +1256,7 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1072,15 +1264,20 @@ golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1165,12 +1362,15 @@ golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1216,16 +1416,19 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1245,6 +1448,7 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1252,8 +1456,13 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= @@ -1264,8 +1473,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1311,6 +1521,7 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= @@ -1323,10 +1534,12 @@ golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200624163319-25775e59acb7/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201030143252-cf7a54d06671/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1406,6 +1619,7 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1436,6 +1650,7 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= @@ -1450,16 +1665,19 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/DataDog/dd-trace-go.v1 v1.30.0-rc.1.0.20210420124628-f63633f38e8f h1:LmMng8lsMr7BkXin76L6+LsUFr1GSnmySvO5LaR6rhc= gopkg.in/DataDog/dd-trace-go.v1 v1.30.0-rc.1.0.20210420124628-f63633f38e8f/go.mod h1:I3nUNop4UZaHSj2C2OBCHezmsQIHczbUps8nHgw/HXs= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -1476,9 +1694,14 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1489,8 +1712,9 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/providers/okta/authorization_server.go b/providers/okta/authorization_server.go new file mode 100644 index 0000000000..36523fcb9b --- /dev/null +++ b/providers/okta/authorization_server.go @@ -0,0 +1,74 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AuthorizationServerGenerator struct { + OktaService +} + +func (g AuthorizationServerGenerator) createResources(authorizationServerList []*okta.AuthorizationServer) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, authorizationServer := range authorizationServerList { + resourceType := "okta_auth_server" + if authorizationServer.Name == "default" { + resourceType = "okta_auth_server_default" + } + + resources = append(resources, terraformutils.NewSimpleResource( + authorizationServer.Id, + "auth_server_"+authorizationServer.Name, + resourceType, + "okta", + []string{})) + } + return resources +} + +func (g *AuthorizationServerGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, err := getAuthorizationServers(ctx, client) + if err != nil { + return e + } + + g.Resources = g.createResources(output) + return nil +} + +func getAuthorizationServers(ctx context.Context, client *okta.Client) ([]*okta.AuthorizationServer, error) { + output, resp, err := client.AuthorizationServer.ListAuthorizationServers(ctx, nil) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextAuthorizationServerSet []*okta.AuthorizationServer + resp, _ = resp.Next(ctx, &nextAuthorizationServerSet) + output = append(output, nextAuthorizationServerSet...) + } + + return output, nil +} diff --git a/providers/okta/authorization_server_claim.go b/providers/okta/authorization_server_claim.go new file mode 100644 index 0000000000..89fa1d2aef --- /dev/null +++ b/providers/okta/authorization_server_claim.go @@ -0,0 +1,72 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AuthorizationServerClaimGenerator struct { + OktaService +} + +func (g AuthorizationServerClaimGenerator) createResources(authorizationServerClaimList []*okta.OAuth2Claim, authorizationServerID string, authorizationServerName string) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, authorizationServerClaim := range authorizationServerClaimList { + resourceType := "okta_auth_server_claim" + if authorizationServerClaim.Name == "sub" { + resourceType = "okta_auth_server_claim_default" + } + resources = append(resources, terraformutils.NewResource( + authorizationServerClaim.Id, + normalizeResourceName("auth_server_"+authorizationServerName+"_claim_"+authorizationServerClaim.Id), + resourceType, + "okta", + map[string]string{ + "auth_server_id": authorizationServerID, + }, + []string{}, + map[string]interface{}{}, + )) + } + return resources +} + +func (g *AuthorizationServerClaimGenerator) InitResources() error { + var resources []terraformutils.Resource + ctx, client, e := g.Client() + if e != nil { + return e + } + + authorizationServers, err := getAuthorizationServers(ctx, client) + if err != nil { + return err + } + + for _, authorizationServer := range authorizationServers { + output, _, err := client.AuthorizationServer.ListOAuth2Claims(ctx, authorizationServer.Id) + if err != nil { + return err + } + + resources = append(resources, g.createResources(output, authorizationServer.Id, authorizationServer.Name)...) + } + + g.Resources = resources + return nil +} diff --git a/providers/okta/authorization_server_policy.go b/providers/okta/authorization_server_policy.go new file mode 100644 index 0000000000..62077674f6 --- /dev/null +++ b/providers/okta/authorization_server_policy.go @@ -0,0 +1,68 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AuthorizationServerPolicyGenerator struct { + OktaService +} + +func (g AuthorizationServerPolicyGenerator) createResources(authorizationServerPolicyList []*okta.Policy, authorizationServerID string, authorizationServerName string) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, authorizationServerPolicy := range authorizationServerPolicyList { + resources = append(resources, terraformutils.NewResource( + authorizationServerPolicy.Id, + normalizeResourceName("auth_server_"+authorizationServerName+"_policy_"+authorizationServerPolicy.Name), + "okta_auth_server_policy", + "okta", + map[string]string{ + "auth_server_id": authorizationServerID, + }, + []string{}, + map[string]interface{}{}, + )) + } + return resources +} + +func (g *AuthorizationServerPolicyGenerator) InitResources() error { + var resources []terraformutils.Resource + ctx, client, e := g.Client() + if e != nil { + return e + } + + authorizationServers, err := getAuthorizationServers(ctx, client) + if err != nil { + return err + } + + for _, authorizationServer := range authorizationServers { + output, _, err := client.AuthorizationServer.ListAuthorizationServerPolicies(ctx, authorizationServer.Id) + if err != nil { + return err + } + + resources = append(resources, g.createResources(output, authorizationServer.Id, authorizationServer.Name)...) + } + + g.Resources = resources + return nil +} diff --git a/providers/okta/authorization_server_scope.go b/providers/okta/authorization_server_scope.go new file mode 100644 index 0000000000..7e470357f0 --- /dev/null +++ b/providers/okta/authorization_server_scope.go @@ -0,0 +1,68 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AuthorizationServerScopeGenerator struct { + OktaService +} + +func (g AuthorizationServerScopeGenerator) createResources(authorizationServerScopeList []*okta.OAuth2Scope, authorizationServerID string, authorizationServerName string) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, authorizationServerScope := range authorizationServerScopeList { + resources = append(resources, terraformutils.NewResource( + authorizationServerScope.Id, + normalizeResourceName("auth_server_"+authorizationServerName+"_scope_"+authorizationServerScope.Name), + "okta_auth_server_scope", + "okta", + map[string]string{ + "auth_server_id": authorizationServerID, + }, + []string{}, + map[string]interface{}{}, + )) + } + return resources +} + +func (g *AuthorizationServerScopeGenerator) InitResources() error { + var resources []terraformutils.Resource + ctx, client, e := g.Client() + if e != nil { + return e + } + + authorizationServers, err := getAuthorizationServers(ctx, client) + if err != nil { + return err + } + + for _, authorizationServer := range authorizationServers { + output, _, err := client.AuthorizationServer.ListOAuth2Scopes(ctx, authorizationServer.Id, nil) + if err != nil { + return err + } + + resources = append(resources, g.createResources(output, authorizationServer.Id, authorizationServer.Name)...) + } + + g.Resources = resources + return nil +} diff --git a/providers/okta/event_hook.go b/providers/okta/event_hook.go new file mode 100644 index 0000000000..bdc6eabb57 --- /dev/null +++ b/providers/okta/event_hook.go @@ -0,0 +1,59 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type EventHookGenerator struct { + OktaService +} + +func (g EventHookGenerator) createResources(eventHookList []*okta.EventHook) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, eventHook := range eventHookList { + + resources = append(resources, terraformutils.NewSimpleResource( + eventHook.Id, + "event_hook_"+eventHook.Name, + "okta_event_hook", + "okta", + []string{})) + } + return resources +} + +func (g *EventHookGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, resp, err := client.EventHook.ListEventHooks(ctx) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextEventHookSet []*okta.EventHook + resp, _ = resp.Next(ctx, &nextEventHookSet) + output = append(output, nextEventHookSet...) + } + + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/okta/group.go b/providers/okta/group.go new file mode 100644 index 0000000000..e73a95187d --- /dev/null +++ b/providers/okta/group.go @@ -0,0 +1,61 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/okta-sdk-golang/v2/okta/query" +) + +type GroupGenerator struct { + OktaService +} + +func (g GroupGenerator) createResources(groupList []*okta.Group) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, group := range groupList { + + resources = append(resources, terraformutils.NewSimpleResource( + group.Id, + "group_"+group.Profile.Name, + "okta_group", + "okta", + []string{})) + } + return resources +} + +func (g *GroupGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + filter := query.NewQueryParams(query.WithFilter("type eq \"OKTA_GROUP\"")) + output, resp, err := client.Group.ListGroups(ctx, filter) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextGroupSet []*okta.Group + resp, _ = resp.Next(ctx, &nextGroupSet) + output = append(output, nextGroupSet...) + } + + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/okta/group_rule.go b/providers/okta/group_rule.go new file mode 100644 index 0000000000..9f83538919 --- /dev/null +++ b/providers/okta/group_rule.go @@ -0,0 +1,59 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type GroupRuleGenerator struct { + OktaService +} + +func (g GroupRuleGenerator) createResources(groupRuleList []*okta.GroupRule) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, groupRule := range groupRuleList { + + resources = append(resources, terraformutils.NewSimpleResource( + groupRule.Id, + "grouprule_"+groupRule.Name, + "okta_group_rule", + "okta", + []string{})) + } + return resources +} + +func (g *GroupRuleGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, resp, err := client.Group.ListGroupRules(ctx, nil) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextGroupRuleSet []*okta.GroupRule + resp, _ = resp.Next(ctx, &nextGroupRuleSet) + output = append(output, nextGroupRuleSet...) + } + + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/okta/helpers.go b/providers/okta/helpers.go new file mode 100644 index 0000000000..222a4354a1 --- /dev/null +++ b/providers/okta/helpers.go @@ -0,0 +1,33 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "regexp" + "strings" +) + +// Making resource's name less ugly +func normalizeResourceName(s string) string { + specialChars := `<>()*#{}[]|@_ .%'",&` + for _, c := range specialChars { + s = strings.ReplaceAll(s, string(c), "-") + } + + s = regexp.MustCompile(`^[^a-zA-Z_]+`).ReplaceAllLiteralString(s, "") + s = strings.TrimSuffix(s, "-") + + return strings.ToLower(s) +} diff --git a/providers/okta/inline_hook.go b/providers/okta/inline_hook.go new file mode 100644 index 0000000000..56d56fbc3e --- /dev/null +++ b/providers/okta/inline_hook.go @@ -0,0 +1,59 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type InlineHookGenerator struct { + OktaService +} + +func (g InlineHookGenerator) createResources(inlineHookList []*okta.InlineHook) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, inlineHook := range inlineHookList { + + resources = append(resources, terraformutils.NewSimpleResource( + inlineHook.Id, + "inline_hook_"+inlineHook.Name, + "okta_inline_hook", + "okta", + []string{})) + } + return resources +} + +func (g *InlineHookGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, resp, err := client.InlineHook.ListInlineHooks(ctx, nil) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextInlineHookSet []*okta.InlineHook + resp, _ = resp.Next(ctx, &nextInlineHookSet) + output = append(output, nextInlineHookSet...) + } + + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/okta/okta_provider.go b/providers/okta/okta_provider.go new file mode 100644 index 0000000000..269bd1c798 --- /dev/null +++ b/providers/okta/okta_provider.go @@ -0,0 +1,112 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "errors" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" +) + +type OktaProvider struct { //nolint + terraformutils.Provider + orgName string + baseURL string + apiToken string +} + +func (p *OktaProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{ + "provider": map[string]interface{}{ + "okta": map[string]interface{}{ + "version": providerwrapper.GetProviderVersion(p.GetName()), + }, + }, + } +} + +func (p *OktaProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{ + "alerts": {"alert_notification_endpoints": []string{"alert_notification_endpoints", "id"}}, + } +} + +func (p *OktaProvider) Init(args []string) error { + orgName := os.Getenv("OKTA_ORG_NAME") + if orgName == "" { + return errors.New("set OKTA_ORG_NAME env var") + } + p.orgName = orgName + + baseURL := os.Getenv("OKTA_BASE_URL") + if baseURL == "" { + return errors.New("set OKTA_BASE_URL env var") + } + p.baseURL = baseURL + + apiToken := os.Getenv("OKTA_API_TOKEN") + if apiToken == "" { + return errors.New("set OKTA_API_TOKEN env var") + } + p.apiToken = apiToken + + return nil +} + +func (p *OktaProvider) GetName() string { + return "okta" +} + +func (p *OktaProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New(p.GetName() + ": " + serviceName + " is not a supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetProviderName(p.GetName()) + p.Service.SetVerbose(verbose) + p.Service.SetArgs(map[string]interface{}{ + "org_name": p.orgName, + "base_url": p.baseURL, + "api_token": p.apiToken, + }) + return nil +} + +func (p *OktaProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "okta_trusted_origin": &TrustedOriginGenerator{}, + "okta_user": &UserGenerator{}, + "okta_template_sms": &SMSTemplateGenerator{}, + "okta_user_type": &UserTypeGenerator{}, + "okta_group": &GroupGenerator{}, + "okta_group_rule": &GroupRuleGenerator{}, + "okta_event_hook": &EventHookGenerator{}, + "okta_inline_hook": &EventHookGenerator{}, + "okta_policy_password": &PasswordPolicyGenerator{}, + "okta_policy_rule_password": &PasswordPolicyRuleGenerator{}, + "okta_policy_signon": &SignOnPolicyGenerator{}, + "okta_policy_rule_signon": &SignOnPolicyRuleGenerator{}, + "okta_policy_mfa": &MFAPolicyGenerator{}, + "okta_policy_rule_mfa": &MFAPolicyRuleGenerator{}, + "okta_auth_server": &AuthorizationServerGenerator{}, + "okta_auth_server_scope": &AuthorizationServerScopeGenerator{}, + "okta_auth_server_claim": &AuthorizationServerClaimGenerator{}, + "okta_auth_server_policy": &AuthorizationServerPolicyGenerator{}, + } +} diff --git a/providers/okta/okta_service.go b/providers/okta/okta_service.go new file mode 100644 index 0000000000..05b10d9548 --- /dev/null +++ b/providers/okta/okta_service.go @@ -0,0 +1,70 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/terraform-provider-okta/sdk" +) + +type OktaService struct { //nolint + terraformutils.Service +} + +func (s *OktaService) Client() (context.Context, *okta.Client, error) { + orgName := s.Args["org_name"].(string) + baseURL := s.Args["base_url"].(string) + apiToken := s.Args["api_token"].(string) + + orgURL := fmt.Sprintf("https://%v.%v", orgName, baseURL) + + ctx, client, err := okta.NewClient( + context.Background(), + okta.WithOrgUrl(orgURL), + okta.WithToken(apiToken), + ) + if err != nil { + return ctx, nil, err + } + + return ctx, client, nil +} + +func (s *OktaService) APISupplementClient() (context.Context, *sdk.ApiSupplement, error) { + baseURL := s.Args["base_url"].(string) + orgName := s.Args["org_name"].(string) + apiToken := s.Args["api_token"].(string) + + orgURL := fmt.Sprintf("https://%v.%v", orgName, baseURL) + + ctx, client, err := okta.NewClient( + context.Background(), + okta.WithOrgUrl(orgURL), + okta.WithToken(apiToken), + ) + if err != nil { + return ctx, nil, err + } + + apiSupplementClient := &sdk.ApiSupplement{ + RequestExecutor: client.GetRequestExecutor(), + } + + return ctx, apiSupplementClient, nil +} diff --git a/providers/okta/policy_mfa.go b/providers/okta/policy_mfa.go new file mode 100644 index 0000000000..7c28f8edb1 --- /dev/null +++ b/providers/okta/policy_mfa.go @@ -0,0 +1,73 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/okta-sdk-golang/v2/okta/query" +) + +type MFAPolicyGenerator struct { + OktaService +} + +func (g MFAPolicyGenerator) createResources(mfaPolicyList []*okta.Policy) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, mfaPolicy := range mfaPolicyList { + resourceName := normalizeResourceName(mfaPolicy.Name) + resourceType := "okta_policy_mfa" + if mfaPolicy.Name == "Default Policy" { + resourceType = "okta_policy_mfa_default" + } + resources = append(resources, terraformutils.NewSimpleResource( + mfaPolicy.Id, + "policy_mfa_"+resourceName, + resourceType, + "okta", + []string{})) + } + return resources +} + +func (g *MFAPolicyGenerator) InitResources() error { + var output []*okta.Policy + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, _ = getMFAPolicies(ctx, client) + g.Resources = g.createResources(output) + return nil +} + +func getMFAPolicies(ctx context.Context, client *okta.Client) ([]*okta.Policy, error) { + qp := query.NewQueryParams(query.WithType("MFA_ENROLL")) + output, resp, err := client.Policy.ListPolicies(ctx, qp) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextPolicySet []*okta.Policy + resp, _ = resp.Next(ctx, &nextPolicySet) + output = append(output, nextPolicySet...) + } + + return output, nil +} diff --git a/providers/okta/policy_password.go b/providers/okta/policy_password.go new file mode 100644 index 0000000000..7a70c84593 --- /dev/null +++ b/providers/okta/policy_password.go @@ -0,0 +1,73 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/okta-sdk-golang/v2/okta/query" +) + +type PasswordPolicyGenerator struct { + OktaService +} + +func (g PasswordPolicyGenerator) createResources(passwordPolicyList []*okta.Policy) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, passwordPolicy := range passwordPolicyList { + resourceName := normalizeResourceName(passwordPolicy.Name) + resourceType := "okta_policy_password" + if passwordPolicy.Name == "Default Policy" { + resourceType = "okta_policy_password_default" + } + resources = append(resources, terraformutils.NewSimpleResource( + passwordPolicy.Id, + "policy_password_"+resourceName, + resourceType, + "okta", + []string{})) + } + return resources +} + +func (g *PasswordPolicyGenerator) InitResources() error { + var output []*okta.Policy + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, _ = getPasswordPolicies(ctx, client) + g.Resources = g.createResources(output) + return nil +} + +func getPasswordPolicies(ctx context.Context, client *okta.Client) ([]*okta.Policy, error) { + qp := query.NewQueryParams(query.WithType("PASSWORD")) + output, resp, err := client.Policy.ListPolicies(ctx, qp) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextPolicySet []*okta.Policy + resp, _ = resp.Next(ctx, &nextPolicySet) + output = append(output, nextPolicySet...) + } + + return output, nil +} diff --git a/providers/okta/policy_rule_mfa.go b/providers/okta/policy_rule_mfa.go new file mode 100644 index 0000000000..7c3067642d --- /dev/null +++ b/providers/okta/policy_rule_mfa.go @@ -0,0 +1,90 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/terraform-provider-okta/sdk" +) + +type MFAPolicyRuleGenerator struct { + OktaService +} + +func (g MFAPolicyRuleGenerator) createResources(mfaPolicyRuleList []sdk.PolicyRule, policyID string, policyName string) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, policyRule := range mfaPolicyRuleList { + resources = append(resources, terraformutils.NewResource( + policyRule.Id, + "policyrule_mfa_"+normalizeResourceName(policyName+"_"+policyRule.Name), + "okta_policy_rule_mfa", + "okta", + map[string]string{ + "policy_id": policyID, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *MFAPolicyRuleGenerator) InitResources() error { + var resources []terraformutils.Resource + + ctx, client, e := g.Client() + if e != nil { + return e + } + + mfaPolicies, err := getMFAPolicies(ctx, client) + if err != nil { + return err + } + + for _, policy := range mfaPolicies { + output, err := getMFAPolicyRules(g, policy.Id) + if err != nil { + return err + } + + resources = append(resources, g.createResources(output, policy.Id, policy.Name)...) + } + + g.Resources = resources + return nil +} + +func getMFAPolicyRules(g *MFAPolicyRuleGenerator, policyID string) ([]sdk.PolicyRule, error) { + ctx, client, e := g.APISupplementClient() + if e != nil { + return nil, e + } + + output, resp, err := client.ListPolicyRules(ctx, policyID) + if err != nil { + return nil, e + } + + for resp.HasNextPage() { + var nextPolicySet []sdk.PolicyRule + resp, _ = resp.Next(ctx, &nextPolicySet) + output = append(output, nextPolicySet...) + } + + return output, nil +} diff --git a/providers/okta/policy_rule_password.go b/providers/okta/policy_rule_password.go new file mode 100644 index 0000000000..0735264df6 --- /dev/null +++ b/providers/okta/policy_rule_password.go @@ -0,0 +1,90 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/terraform-provider-okta/sdk" +) + +type PasswordPolicyRuleGenerator struct { + OktaService +} + +func (g PasswordPolicyRuleGenerator) createResources(passwordPolicyRuleList []sdk.PolicyRule, policyID string, policyName string) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, policyRule := range passwordPolicyRuleList { + resources = append(resources, terraformutils.NewResource( + policyRule.Id, + "policyrule_password_"+normalizeResourceName(policyName+"_"+policyRule.Name), + "okta_policy_rule_password", + "okta", + map[string]string{ + "policy_id": policyID, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PasswordPolicyRuleGenerator) InitResources() error { + var resources []terraformutils.Resource + + ctx, client, e := g.Client() + if e != nil { + return e + } + + passwordPolicies, err := getPasswordPolicies(ctx, client) + if err != nil { + return err + } + + for _, policy := range passwordPolicies { + output, err := getPasswordPolicyRules(g, policy.Id) + if err != nil { + return err + } + + resources = append(resources, g.createResources(output, policy.Id, policy.Name)...) + } + + g.Resources = resources + return nil +} + +func getPasswordPolicyRules(g *PasswordPolicyRuleGenerator, policyID string) ([]sdk.PolicyRule, error) { + ctx, client, e := g.APISupplementClient() + if e != nil { + return nil, e + } + + output, resp, err := client.ListPolicyRules(ctx, policyID) + if err != nil { + return nil, e + } + + for resp.HasNextPage() { + var nextPolicySet []sdk.PolicyRule + resp, _ = resp.Next(ctx, &nextPolicySet) + output = append(output, nextPolicySet...) + } + + return output, nil +} diff --git a/providers/okta/policy_rule_signon.go b/providers/okta/policy_rule_signon.go new file mode 100644 index 0000000000..02c9c20f0b --- /dev/null +++ b/providers/okta/policy_rule_signon.go @@ -0,0 +1,90 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/terraform-provider-okta/sdk" +) + +type SignOnPolicyRuleGenerator struct { + OktaService +} + +func (g SignOnPolicyRuleGenerator) createResources(signOnPolicyRuleList []sdk.PolicyRule, policyID string, policyName string) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, policyRule := range signOnPolicyRuleList { + resources = append(resources, terraformutils.NewResource( + policyRule.Id, + "policyrule_signon_"+normalizeResourceName(policyName+"_"+policyRule.Name), + "okta_policy_rule_signon", + "okta", + map[string]string{ + "policy_id": policyID, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *SignOnPolicyRuleGenerator) InitResources() error { + var resources []terraformutils.Resource + + ctx, client, e := g.Client() + if e != nil { + return e + } + + signOnPolicies, err := getSignOnPolicies(ctx, client) + if err != nil { + return err + } + + for _, policy := range signOnPolicies { + output, err := getSignOnPolicyRules(g, policy.Id) + if err != nil { + return err + } + + resources = append(resources, g.createResources(output, policy.Id, policy.Name)...) + } + + g.Resources = resources + return nil +} + +func getSignOnPolicyRules(g *SignOnPolicyRuleGenerator, policyID string) ([]sdk.PolicyRule, error) { + ctx, client, e := g.APISupplementClient() + if e != nil { + return nil, e + } + + output, resp, err := client.ListPolicyRules(ctx, policyID) + if err != nil { + return nil, e + } + + for resp.HasNextPage() { + var nextPolicySet []sdk.PolicyRule + resp, _ = resp.Next(ctx, &nextPolicySet) + output = append(output, nextPolicySet...) + } + + return output, nil +} diff --git a/providers/okta/policy_signon.go b/providers/okta/policy_signon.go new file mode 100644 index 0000000000..270e40e4ca --- /dev/null +++ b/providers/okta/policy_signon.go @@ -0,0 +1,71 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/okta-sdk-golang/v2/okta/query" +) + +type SignOnPolicyGenerator struct { + OktaService +} + +func (g SignOnPolicyGenerator) createResources(signOnPolicyList []*okta.Policy) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, signOnPolicy := range signOnPolicyList { + resourceName := normalizeResourceName(signOnPolicy.Name) + resourceType := "okta_policy_signon" + + resources = append(resources, terraformutils.NewSimpleResource( + signOnPolicy.Id, + "policy_signon_"+resourceName, + resourceType, + "okta", + []string{})) + } + return resources +} + +func (g *SignOnPolicyGenerator) InitResources() error { + var output []*okta.Policy + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, _ = getSignOnPolicies(ctx, client) + g.Resources = g.createResources(output) + return nil +} + +func getSignOnPolicies(ctx context.Context, client *okta.Client) ([]*okta.Policy, error) { + qp := query.NewQueryParams(query.WithType("OKTA_SIGN_ON")) + output, resp, err := client.Policy.ListPolicies(ctx, qp) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextPolicySet []*okta.Policy + resp, _ = resp.Next(ctx, &nextPolicySet) + output = append(output, nextPolicySet...) + } + + return output, nil +} diff --git a/providers/okta/template_sms.go b/providers/okta/template_sms.go new file mode 100644 index 0000000000..0c7c2fe183 --- /dev/null +++ b/providers/okta/template_sms.go @@ -0,0 +1,59 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type SMSTemplateGenerator struct { + OktaService +} + +func (g SMSTemplateGenerator) createResources(smsTemplateList []*okta.SmsTemplate) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, smsTemplate := range smsTemplateList { + + resources = append(resources, terraformutils.NewSimpleResource( + smsTemplate.Id, + "template_sms_"+smsTemplate.Name, + "okta_template_sms", + "okta", + []string{})) + } + return resources +} + +func (g *SMSTemplateGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, resp, err := client.SmsTemplate.ListSmsTemplates(ctx, nil) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextSmsTemplateSet []*okta.SmsTemplate + resp, _ = resp.Next(ctx, &nextSmsTemplateSet) + output = append(output, nextSmsTemplateSet...) + } + + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/okta/trusted_origin.go b/providers/okta/trusted_origin.go new file mode 100644 index 0000000000..a0330e86ca --- /dev/null +++ b/providers/okta/trusted_origin.go @@ -0,0 +1,59 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type TrustedOriginGenerator struct { + OktaService +} + +func (g TrustedOriginGenerator) createResources(trustedOriginList []*okta.TrustedOrigin) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, trustedOrigin := range trustedOriginList { + + resources = append(resources, terraformutils.NewSimpleResource( + trustedOrigin.Id, + "trusted_origin_"+trustedOrigin.Id, + "okta_trusted_origin", + "okta", + []string{})) + } + return resources +} + +func (g *TrustedOriginGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, resp, err := client.TrustedOrigin.ListOrigins(ctx, nil) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextTrustedOriginSet []*okta.TrustedOrigin + resp, _ = resp.Next(ctx, &nextTrustedOriginSet) + output = append(output, nextTrustedOriginSet...) + } + + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/okta/user.go b/providers/okta/user.go new file mode 100644 index 0000000000..5d4d784e64 --- /dev/null +++ b/providers/okta/user.go @@ -0,0 +1,59 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type UserGenerator struct { + OktaService +} + +func (g UserGenerator) createResources(userList []*okta.User) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, user := range userList { + + resources = append(resources, terraformutils.NewSimpleResource( + user.Id, + "user_"+user.Id, + "okta_user", + "okta", + []string{})) + } + return resources +} + +func (g *UserGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, resp, err := client.User.ListUsers(ctx, nil) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextUserSet []*okta.User + resp, _ = resp.Next(ctx, &nextUserSet) + output = append(output, nextUserSet...) + } + + g.Resources = g.createResources(output) + return nil +} diff --git a/providers/okta/user_type.go b/providers/okta/user_type.go new file mode 100644 index 0000000000..fb8c9ec281 --- /dev/null +++ b/providers/okta/user_type.go @@ -0,0 +1,59 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type UserTypeGenerator struct { + OktaService +} + +func (g UserTypeGenerator) createResources(userTypeList []*okta.UserType) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, userType := range userTypeList { + + resources = append(resources, terraformutils.NewSimpleResource( + userType.Id, + "usertype_"+userType.Name, + "okta_user_type", + "okta", + []string{})) + } + return resources +} + +func (g *UserTypeGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + output, resp, err := client.UserType.ListUserTypes(ctx) + if err != nil { + return e + } + + for resp.HasNextPage() { + var nextUserTypeSet []*okta.UserType + resp, _ = resp.Next(ctx, &nextUserTypeSet) + output = append(output, nextUserTypeSet...) + } + + g.Resources = g.createResources(output) + return nil +} From 399ed6830b766ac4ef39739f96180284c3c291ba Mon Sep 17 00:00:00 2001 From: "Manuel J. Bernal" Date: Fri, 30 Jul 2021 21:34:34 +0200 Subject: [PATCH 212/276] Add change directory command and fix grammar typo (#1002) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a50729e446..9dfca5b5c5 100644 --- a/README.md +++ b/README.md @@ -198,10 +198,10 @@ It's possible to combine `--compact` `--path-pattern` parameters together. ### Installation From source: -1. Run `git clone ` +1. Run `git clone && cd terraformer/` 2. Run `go mod download` 3. Run `go build -v` for all providers OR build with one provider `go run build/main.go {google,aws,azure,kubernetes and etc}` -4. Run ```terraform init``` against an ```versions.tf``` file to install the plugins required for your platform. For example, if you need plugins for the google provider, ```versions.tf``` should contain: +4. Run ```terraform init``` against a ```versions.tf``` file to install the plugins required for your platform. For example, if you need plugins for the google provider, ```versions.tf``` should contain: ``` terraform { From 6014041261c2cae763e8fbf45faea47d67272cc0 Mon Sep 17 00:00:00 2001 From: Pierre Erraud Date: Fri, 30 Jul 2021 21:36:02 +0200 Subject: [PATCH 213/276] feat(panos): add PAN-OS Panorama support (#960) --- cmd/provider_cmd_panos.go | 17 +- docs/panos.md | 78 +- go.mod | 2 +- go.sum | 4 +- ...ce_config.go => firewall_device_config.go} | 31 +- providers/panos/firewall_networking.go | 127 ++- providers/panos/firewall_objects.go | 43 +- providers/panos/firewall_policy.go | 27 +- providers/panos/helpers.go | 78 +- providers/panos/panorama_device_config.go | 308 ++++++ providers/panos/panorama_networking.go | 931 ++++++++++++++++++ providers/panos/panorama_objects.go | 290 ++++++ providers/panos/panorama_plugins.go | 113 +++ providers/panos/panorama_policy.go | 192 ++++ providers/panos/panos_provider.go | 13 +- providers/panos/panos_service.go | 3 +- 16 files changed, 2124 insertions(+), 133 deletions(-) rename providers/panos/{device_config.go => firewall_device_config.go} (58%) create mode 100644 providers/panos/panorama_device_config.go create mode 100644 providers/panos/panorama_networking.go create mode 100644 providers/panos/panorama_objects.go create mode 100644 providers/panos/panorama_plugins.go create mode 100644 providers/panos/panorama_policy.go diff --git a/cmd/provider_cmd_panos.go b/cmd/provider_cmd_panos.go index aee4352898..a8f4a9ef1d 100644 --- a/cmd/provider_cmd_panos.go +++ b/cmd/provider_cmd_panos.go @@ -16,6 +16,7 @@ package cmd import ( "log" + "reflect" "strings" panos_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/panos" @@ -30,15 +31,27 @@ func newCmdPanosImporter(options ImportOptions) *cobra.Command { Short: "Import current state to Terraform configuration from a PAN-OS", Long: "Import current state to Terraform configuration from a PAN-OS", RunE: func(cmd *cobra.Command, args []string) error { + var t interface{} + if len(vsys) == 0 { var err error - vsys, err = panos_terraforming.GetVsysList() + vsys, t, err = panos_terraforming.GetVsysList() + if err != nil { + return err + } + } else { + c, err := panos_terraforming.Initialize() if err != nil { return err } + + t = reflect.TypeOf(c) } + resources := panos_terraforming.FilterCallableResources(t, options.Resources) + options.Resources = resources + originalPathPattern := options.PathPattern for _, v := range vsys { provider := newPanosProvider() @@ -57,7 +70,7 @@ func newCmdPanosImporter(options ImportOptions) *cobra.Command { } cmd.AddCommand(listCmd(newPanosProvider())) - baseProviderFlags(cmd.PersistentFlags(), &options, "device_config,firewall_networking,firewall_objects", "") + baseProviderFlags(cmd.PersistentFlags(), &options, "firewall_device_config,firewall_networking,firewall_objects,firewall_policy", "") cmd.PersistentFlags().StringSliceVarP(&vsys, "vsys", "", []string{}, "") return cmd diff --git a/docs/panos.md b/docs/panos.md index 7a0e01b42c..a739544378 100644 --- a/docs/panos.md +++ b/docs/panos.md @@ -7,7 +7,7 @@ Example: export PANOS_USERNAME=[PANOS_USERNAME] export PANOS_PASSWORD=[PANOS_PASSWORD] - terraformer import panos --resources=device_config,firewall_networking,firewall_objects,firewall_policy + terraformer import panos --resources=firewall_device_config,firewall_networking,firewall_objects,firewall_policy ``` The list of usable environment variables is the same as the [pango go-client](https://github.com/PaloAltoNetworks/pango): * `PANOS_HOSTNAME` @@ -24,7 +24,7 @@ The list of usable environment variables is the same as the [pango go-client](ht Here is the list of resources which are currently supported: -* `device_config` +* `firewall_device_config` * `panos_general_settings` * `panos_telemetry` * `panos_email_server_profile` @@ -91,3 +91,77 @@ Here is the list of resources which are currently supported: * `panos_nat_rule_group` * `panos_pbf_rule_group` * `panos_security_rule_group` +* `panorama_device_config` + * `panos_device_group_parent` + * `panos_panorama_device_group` + * `panos_panorama_email_server_profile` + * `panos_panorama_http_server_profile` + * `panos_panorama_snmptrap_server_profile` + * `panos_panorama_syslog_server_profile` + * `panos_panorama_template` + * `panos_panorama_template_stack` + * `panos_panorama_template_variable` +* `panorama_networking` + * `panos_panorama_aggregate_interface` + * `panos_panorama_bfd_profile` + * `panos_panorama_bgp` + * `panos_panorama_bgp_aggregate` + * `panos_panorama_bgp_aggregate_advertise_filter` + * `panos_panorama_bgp_aggregate_suppress_filter` + * `panos_panorama_bgp_auth_profile` # The secret argument will contain "(incorrect)" + * `panos_panorama_bgp_conditional_adv` + * `panos_panorama_bgp_conditional_adv_advertise_filter` + * `panos_panorama_bgp_conditional_adv_non_exist_filter` + * `panos_panorama_bgp_dampening_profile` + * `panos_panorama_bgp_export_rule_group` + * `panos_panorama_bgp_import_rule_group` + * `panos_panorama_bgp_peer` + * `panos_panorama_bgp_peer_group` + * `panos_panorama_bgp_redist_rule` + * `panos_panorama_ethernet_interface` + * `panos_panorama_gre_tunnel` + * `panos_panorama_ike_crypto_profile` + * `panos_panorama_ike_gateway` + * `panos_panorama_ipsec_crypto_profile` + * `panos_panorama_ipsec_tunnel` + * `panos_panorama_ipsec_tunnel_proxy_id_ipv4` + * `panos_panorama_layer2_subinterface` + * `panos_panorama_layer3_subinterface` + * `panos_panorama_loopback_interface` + * `panos_panorama_management_profile` + * `panos_panorama_monitor_profile` + * `panos_panorama_redistribution_profile` + * `panos_panorama_static_route_ipv4` + * `panos_panorama_tunnel_interface` + * `panos_panorama_virtual_router` + * `panos_panorama_vlan` + * `panos_panorama_vlan_interface` + * `panos_panorama_zone` +* `panorama_objects` + * `panos_panorama_address_group` + * `panos_panorama_administrative_tag` + * `panos_panorama_application_group` + * `panos_panorama_application_object` + * `panos_panorama_edl` + * `panos_panorama_log_forwarding_profile` + * `panos_panorama_service_group` + * `panos_panorama_service_object` + * `panos_address_object` + * `panos_anti_spyware_security_profile` + * `panos_antivirus_security_profile` + * `panos_custom_data_pattern_object` + * `panos_data_filtering_security_profile` + * `panos_dos_protection_profile` + * `panos_dynamic_user_group` + * `panos_file_blocking_security_profile` + * `panos_url_filtering_security_profile` + * `panos_vulnerability_security_profile` + * `panos_wildfire_analysis_security_profile` +* `panorama_plugins` + * `panos_panorama_gcp_account` + * `panos_panorama_gke_cluster` + * `panos_panorama_gke_cluster_group` +* `panorama_policy` + * `panos_panorama_nat_rule_group` + * `panos_panorama_pbf_rule_group` + * `panos_panorama_security_rule_group` diff --git a/go.mod b/go.mod index e10aa6bd67..b6e13f743a 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/IBM/vpc-go-sdk v0.4.1 github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/OctopusDeploy/go-octopusdeploy v1.6.0 - github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c + github.com/PaloAltoNetworks/pango v0.6.0 github.com/SAP/go-hdb v0.105.2 // indirect github.com/SermoDigital/jose v0.9.1 // indirect github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 diff --git a/go.sum b/go.sum index efb754fd2f..c213e26f6e 100644 --- a/go.sum +++ b/go.sum @@ -131,8 +131,8 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8 github.com/OctopusDeploy/go-octopusdeploy v1.6.0 h1:r9ThVuANGkzm3noAjLF/i7LUcxQxbCJwpvn1DLwPoOA= github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGrwiLN7XmDSML5ui+mcWR/R0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c h1:4uQRvqtOkn0n4zb9BbYHhXzAmWDd25T6TfnE5I5gpFg= -github.com/PaloAltoNetworks/pango v0.5.2-0.20210514062125-b809b85eb51c/go.mod h1:xpwEKL6CHhniRcqKYTjIiGBzPd3QIyto3sz2ynsP1qg= +github.com/PaloAltoNetworks/pango v0.6.0 h1:QKe17XsICz2P1S6sKpaH1w8zr/4Q3jYsYVq7bQTjfv8= +github.com/PaloAltoNetworks/pango v0.6.0/go.mod h1:xpwEKL6CHhniRcqKYTjIiGBzPd3QIyto3sz2ynsP1qg= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= diff --git a/providers/panos/device_config.go b/providers/panos/firewall_device_config.go similarity index 58% rename from providers/panos/device_config.go rename to providers/panos/firewall_device_config.go index aeed8237d4..03298fbfb5 100644 --- a/providers/panos/device_config.go +++ b/providers/panos/firewall_device_config.go @@ -16,15 +16,16 @@ package panos import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" ) -type DeviceConfigGenerator struct { +type FirewallDeviceConfigGenerator struct { PanosService } -func (g *DeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix, terraformResourceName string) (resources []terraformutils.Resource) { +func (g *FirewallDeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix, terraformResourceName string) (resources []terraformutils.Resource) { l, err := o.i.(getListWithOneArg).GetList(o.params[0]) - if err != nil { + if err != nil || len(l) == 0 { return []terraformutils.Resource{} } @@ -42,7 +43,7 @@ func (g *DeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix, return resources } -func (g *DeviceConfigGenerator) createGeneralSettingsResource(hostname string) terraformutils.Resource { +func (g *FirewallDeviceConfigGenerator) createGeneralSettingsResource(hostname string) terraformutils.Resource { return terraformutils.NewSimpleResource( hostname, normalizeResourceName(hostname), @@ -52,7 +53,7 @@ func (g *DeviceConfigGenerator) createGeneralSettingsResource(hostname string) t ) } -func (g *DeviceConfigGenerator) createTelemetryResource(ipAddress, hostname string) terraformutils.Resource { +func (g *FirewallDeviceConfigGenerator) createTelemetryResource(ipAddress, hostname string) terraformutils.Resource { return terraformutils.NewSimpleResource( ipAddress, normalizeResourceName(hostname), @@ -62,31 +63,31 @@ func (g *DeviceConfigGenerator) createTelemetryResource(ipAddress, hostname stri ) } -func (g *DeviceConfigGenerator) createEmailServerProfileResources() []terraformutils.Resource { - return g.createResourcesFromList(getGeneric{g.client.Device.EmailServerProfile, []string{g.vsys}}, +func (g *FirewallDeviceConfigGenerator) createEmailServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Firewall).Device.EmailServerProfile, []string{g.vsys}}, g.vsys+":", "panos_email_server_profile", ) } -func (g *DeviceConfigGenerator) createHTTPServerProfileResources() []terraformutils.Resource { - return g.createResourcesFromList(getGeneric{g.client.Device.HttpServerProfile, []string{g.vsys}}, +func (g *FirewallDeviceConfigGenerator) createHTTPServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Firewall).Device.HttpServerProfile, []string{g.vsys}}, g.vsys+":", "panos_http_server_profile", ) } -func (g *DeviceConfigGenerator) createSNMPTrapServerProfileResources() []terraformutils.Resource { - return g.createResourcesFromList(getGeneric{g.client.Device.SnmpServerProfile, []string{g.vsys}}, +func (g *FirewallDeviceConfigGenerator) createSNMPTrapServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Firewall).Device.SnmpServerProfile, []string{g.vsys}}, g.vsys+":", "panos_snmptrap_server_profile", ) } -func (g *DeviceConfigGenerator) createSyslogServerProfileResources() []terraformutils.Resource { - return g.createResourcesFromList(getGeneric{g.client.Device.SyslogServerProfile, []string{g.vsys}}, +func (g *FirewallDeviceConfigGenerator) createSyslogServerProfileResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Firewall).Device.SyslogServerProfile, []string{g.vsys}}, g.vsys+":", "panos_syslog_server_profile", ) } -func (g *DeviceConfigGenerator) InitResources() error { +func (g *FirewallDeviceConfigGenerator) InitResources() error { if err := g.Initialize(); err != nil { return err } @@ -95,7 +96,7 @@ func (g *DeviceConfigGenerator) InitResources() error { g.vsys = "shared" } - generalConfig, err := g.client.Device.GeneralSettings.Get() + generalConfig, err := g.client.(*pango.Firewall).Device.GeneralSettings.Get() if err != nil { return err } diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go index 99b68f02bb..48218a2a4e 100644 --- a/providers/panos/firewall_networking.go +++ b/providers/panos/firewall_networking.go @@ -15,9 +15,12 @@ package panos import ( + "encoding/base64" "fmt" + "strconv" "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" "github.com/PaloAltoNetworks/pango/netw/interface/eth" "github.com/PaloAltoNetworks/pango/netw/interface/subinterface/layer2" "github.com/PaloAltoNetworks/pango/netw/interface/subinterface/layer3" @@ -44,13 +47,13 @@ func (g *FirewallNetworkingGenerator) createResourcesFromList(o getGeneric, idPr default: err = fmt.Errorf("not supported") } - if err != nil { + if err != nil || len(l) == 0 { return []terraformutils.Resource{} } for _, r := range l { if checkIfIsVsys { - rv, err := g.client.IsImported(checkType, "", "", g.vsys, r) + rv, err := g.client.(*pango.Firewall).IsImported(checkType, "", "", g.vsys, r) if err != nil || !rv { continue } @@ -76,13 +79,13 @@ func (g *FirewallNetworkingGenerator) createResourcesFromList(o getGeneric, idPr } func (g *FirewallNetworkingGenerator) createAggregateInterfaceResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.AggregateInterface.GetList() + l, err := g.client.(*pango.Firewall).Network.AggregateInterface.GetList() if err != nil { return []terraformutils.Resource{} } for _, aggregateInterface := range l { - rv, err := g.client.IsImported(util.InterfaceImport, "", "", g.vsys, aggregateInterface) + rv, err := g.client.(*pango.Firewall).IsImported(util.InterfaceImport, "", "", g.vsys, aggregateInterface) if err != nil || !rv { continue } @@ -96,7 +99,7 @@ func (g *FirewallNetworkingGenerator) createAggregateInterfaceResources() (resou []string{}, )) - e, err := g.client.Network.AggregateInterface.Get(aggregateInterface) + e, err := g.client.(*pango.Firewall).Network.AggregateInterface.Get(aggregateInterface) if err != nil { continue } @@ -115,7 +118,7 @@ func (g *FirewallNetworkingGenerator) createAggregateInterfaceResources() (resou func (g *FirewallNetworkingGenerator) createBFDProfileResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BfdProfile, []string{}}, + getGeneric{g.client.(*pango.Firewall).Network.BfdProfile, []string{}}, "", false, "panos_bfd_profile", false, "", ) } @@ -131,7 +134,7 @@ func (g *FirewallNetworkingGenerator) createBGPResource(virtualRouter string) te } func (g *FirewallNetworkingGenerator) createBGPAggregateResources(virtualRouter string) (resources []terraformutils.Resource) { - l, err := g.client.Network.BgpAggregate.GetList(virtualRouter) + l, err := g.client.(*pango.Firewall).Network.BgpAggregate.GetList(virtualRouter) if err != nil { return []terraformutils.Resource{} } @@ -155,14 +158,14 @@ func (g *FirewallNetworkingGenerator) createBGPAggregateResources(virtualRouter func (g *FirewallNetworkingGenerator) createBGPAggregateAdvertiseFilterResources(virtualRouter, bgpAggregate string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpAggAdvertiseFilter, []string{virtualRouter, bgpAggregate}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpAggAdvertiseFilter, []string{virtualRouter, bgpAggregate}}, virtualRouter+":"+bgpAggregate+":", true, "panos_bgp_aggregate_advertise_filter", false, "", ) } func (g *FirewallNetworkingGenerator) createBGPAggregateSuppressFilterResources(virtualRouter, bgpAggregate string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpAggSuppressFilter, []string{virtualRouter, bgpAggregate}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpAggSuppressFilter, []string{virtualRouter, bgpAggregate}}, virtualRouter+":"+bgpAggregate+":", true, "panos_bgp_aggregate_suppress_filter", false, "", ) } @@ -170,13 +173,13 @@ func (g *FirewallNetworkingGenerator) createBGPAggregateSuppressFilterResources( // The secret argument will contain "(incorrect)", not the real value func (g *FirewallNetworkingGenerator) createBGPAuthProfileResources(virtualRouter string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpAuthProfile, []string{virtualRouter}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpAuthProfile, []string{virtualRouter}}, virtualRouter+":", true, "panos_bgp_auth_profile", false, "", ) } func (g *FirewallNetworkingGenerator) createBGPConditionalAdvertisementResources(virtualRouter string) (resources []terraformutils.Resource) { - l, err := g.client.Network.BgpConditionalAdv.GetList(virtualRouter) + l, err := g.client.(*pango.Firewall).Network.BgpConditionalAdv.GetList(virtualRouter) if err != nil { return []terraformutils.Resource{} } @@ -200,41 +203,70 @@ func (g *FirewallNetworkingGenerator) createBGPConditionalAdvertisementResources func (g *FirewallNetworkingGenerator) createBGPConditionalAdvertisementAdvertiseFilterResources(virtualRouter, bgpConditionalAdv string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpConAdvAdvertiseFilter, []string{virtualRouter, bgpConditionalAdv}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpConAdvAdvertiseFilter, []string{virtualRouter, bgpConditionalAdv}}, virtualRouter+":"+bgpConditionalAdv+":", true, "panos_bgp_conditional_adv_advertise_filter", false, "", ) } func (g *FirewallNetworkingGenerator) createBGPConditionalAdvertisementNonExistFilterResources(virtualRouter, bgpConditionalAdv string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpConAdvNonExistFilter, []string{virtualRouter, bgpConditionalAdv}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpConAdvNonExistFilter, []string{virtualRouter, bgpConditionalAdv}}, virtualRouter+":"+bgpConditionalAdv+":", true, "panos_bgp_conditional_adv_non_exist_filter", false, "", ) } func (g *FirewallNetworkingGenerator) createBGPDampeningProfileResources(virtualRouter string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpDampeningProfile, []string{virtualRouter}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpDampeningProfile, []string{virtualRouter}}, virtualRouter+":", true, "panos_bgp_dampening_profile", false, "", ) } +func (g *FirewallNetworkingGenerator) createBGPRuleGroupResourcesFromList(o getGeneric, terraformResourceName string) (resources []terraformutils.Resource) { + l, err := o.i.(getListWithOneArg).GetList(o.params[0]) + if err != nil || len(l) == 0 { + return []terraformutils.Resource{} + } + + var positionReference string + id := o.params[0] + ":" + strconv.Itoa(util.MoveTop) + "::" + + for k, r := range l { + if k > 0 { + id = o.params[0] + ":" + strconv.Itoa(util.MoveAfter) + ":" + positionReference + ":" + } + + id += base64.StdEncoding.EncodeToString([]byte(r)) + positionReference = r + + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(r), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + func (g *FirewallNetworkingGenerator) createBGPExportRuleGroupResources(virtualRouter string) []terraformutils.Resource { - return g.createResourcesFromList( - getGeneric{g.client.Network.BgpExport, []string{virtualRouter}}, - virtualRouter+":", true, "panos_bgp_export_rule_group", false, "", + return g.createBGPRuleGroupResourcesFromList( + getGeneric{g.client.(*pango.Firewall).Network.BgpExport, []string{virtualRouter}}, + "panos_bgp_export_rule_group", ) } func (g *FirewallNetworkingGenerator) createBGPImportRuleGroupResources(virtualRouter string) []terraformutils.Resource { - return g.createResourcesFromList( - getGeneric{g.client.Network.BgpImport, []string{virtualRouter}}, - virtualRouter+":", true, "panos_bgp_import_rule_group", false, "", + return g.createBGPRuleGroupResourcesFromList( + getGeneric{g.client.(*pango.Firewall).Network.BgpImport, []string{virtualRouter}}, + "panos_bgp_import_rule_group", ) } func (g *FirewallNetworkingGenerator) createBGPPeerGroupResources(virtualRouter string) (resources []terraformutils.Resource) { - l, err := g.client.Network.BgpPeerGroup.GetList(virtualRouter) + l, err := g.client.(*pango.Firewall).Network.BgpPeerGroup.GetList(virtualRouter) if err != nil { return []terraformutils.Resource{} } @@ -257,26 +289,26 @@ func (g *FirewallNetworkingGenerator) createBGPPeerGroupResources(virtualRouter func (g *FirewallNetworkingGenerator) createBGPPeerResources(virtualRouter, bgpPeerGroup string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpPeer, []string{virtualRouter, bgpPeerGroup}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpPeer, []string{virtualRouter, bgpPeerGroup}}, virtualRouter+":"+bgpPeerGroup+":", true, "panos_bgp_peer", false, "", ) } func (g *FirewallNetworkingGenerator) createBGPRedistResources(virtualRouter string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.BgpRedistRule, []string{virtualRouter}}, + getGeneric{g.client.(*pango.Firewall).Network.BgpRedistRule, []string{virtualRouter}}, virtualRouter+":", true, "panos_bgp_redist_rule", false, "", ) } func (g *FirewallNetworkingGenerator) createEthernetInterfaceResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.EthernetInterface.GetList() + l, err := g.client.(*pango.Firewall).Network.EthernetInterface.GetList() if err != nil { return []terraformutils.Resource{} } for _, ethernetInterface := range l { - rv, err := g.client.IsImported(util.InterfaceImport, "", "", g.vsys, ethernetInterface) + rv, err := g.client.(*pango.Firewall).IsImported(util.InterfaceImport, "", "", g.vsys, ethernetInterface) if err != nil || !rv { continue } @@ -290,7 +322,7 @@ func (g *FirewallNetworkingGenerator) createEthernetInterfaceResources() (resour []string{}, )) - e, err := g.client.Network.EthernetInterface.Get(ethernetInterface) + e, err := g.client.(*pango.Firewall).Network.EthernetInterface.Get(ethernetInterface) if err != nil { continue } @@ -309,13 +341,13 @@ func (g *FirewallNetworkingGenerator) createEthernetInterfaceResources() (resour func (g *FirewallNetworkingGenerator) createGRETunnelResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.GreTunnel, []string{}}, + getGeneric{g.client.(*pango.Firewall).Network.GreTunnel, []string{}}, "", false, "panos_gre_tunnel", false, "", ) } func (g *FirewallNetworkingGenerator) createIKECryptoProfileResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.IkeCryptoProfile.GetList() + l, err := g.client.(*pango.Firewall).Network.IkeCryptoProfile.GetList() if err != nil { return []terraformutils.Resource{} } @@ -338,7 +370,7 @@ func (g *FirewallNetworkingGenerator) createIKECryptoProfileResources() (resourc } func (g *FirewallNetworkingGenerator) createIKEGatewayResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.IkeGateway.GetList() + l, err := g.client.(*pango.Firewall).Network.IkeGateway.GetList() if err != nil { return []terraformutils.Resource{} } @@ -361,7 +393,7 @@ func (g *FirewallNetworkingGenerator) createIKEGatewayResources() (resources []t } func (g *FirewallNetworkingGenerator) createIPSECCryptoProfileResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.IpsecCryptoProfile.GetList() + l, err := g.client.(*pango.Firewall).Network.IpsecCryptoProfile.GetList() if err != nil { return []terraformutils.Resource{} } @@ -385,13 +417,13 @@ func (g *FirewallNetworkingGenerator) createIPSECCryptoProfileResources() (resou func (g *FirewallNetworkingGenerator) createIPSECTunnelProxyIDIPv4Resources(ipsecTunnel string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.IpsecTunnelProxyId, []string{ipsecTunnel}}, + getGeneric{g.client.(*pango.Firewall).Network.IpsecTunnelProxyId, []string{ipsecTunnel}}, ipsecTunnel+":", false, "panos_ipsec_tunnel_proxy_id_ipv4", false, "", ) } func (g *FirewallNetworkingGenerator) createIPSECTunnelResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.IpsecTunnel.GetList() + l, err := g.client.(*pango.Firewall).Network.IpsecTunnel.GetList() if err != nil { return []terraformutils.Resource{} } @@ -413,27 +445,27 @@ func (g *FirewallNetworkingGenerator) createIPSECTunnelResources() (resources [] func (g *FirewallNetworkingGenerator) createLayer2SubInterfaceResources(interfaceType, parentInterface, parentMode string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.Layer2Subinterface, []string{interfaceType, parentInterface, parentMode}}, + getGeneric{g.client.(*pango.Firewall).Network.Layer2Subinterface, []string{interfaceType, parentInterface, parentMode}}, interfaceType+":"+parentInterface+":"+parentMode+":"+g.vsys+":", false, "panos_layer2_subinterface", true, util.InterfaceImport, ) } func (g *FirewallNetworkingGenerator) createLayer3SubInterfaceResources(interfaceType, parentInterface string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.Layer3Subinterface, []string{interfaceType, parentInterface}}, + getGeneric{g.client.(*pango.Firewall).Network.Layer3Subinterface, []string{interfaceType, parentInterface}}, interfaceType+":"+parentInterface+":"+g.vsys+":", false, "panos_layer3_subinterface", true, util.InterfaceImport, ) } func (g *FirewallNetworkingGenerator) createLoopbackInterfaceResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.LoopbackInterface, []string{}}, + getGeneric{g.client.(*pango.Firewall).Network.LoopbackInterface, []string{}}, g.vsys+":", false, "panos_loopback_interface", true, util.InterfaceImport, ) } func (g *FirewallNetworkingGenerator) createManagementProfileResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.ManagementProfile.GetList() + l, err := g.client.(*pango.Firewall).Network.ManagementProfile.GetList() if err != nil { return []terraformutils.Resource{} } @@ -457,41 +489,41 @@ func (g *FirewallNetworkingGenerator) createManagementProfileResources() (resour func (g *FirewallNetworkingGenerator) createMonitorProfileResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.MonitorProfile, []string{}}, + getGeneric{g.client.(*pango.Firewall).Network.MonitorProfile, []string{}}, "", false, "panos_monitor_profile", false, "", ) } func (g *FirewallNetworkingGenerator) createRedistributionProfileResources(virtualRouter string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.RedistributionProfile, []string{virtualRouter}}, + getGeneric{g.client.(*pango.Firewall).Network.RedistributionProfile, []string{virtualRouter}}, virtualRouter+":", true, "panos_redistribution_profile_ipv4", false, "", ) } func (g *FirewallNetworkingGenerator) createStaticRouteIpv4Resources(virtualRouter string) []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.StaticRoute, []string{virtualRouter}}, + getGeneric{g.client.(*pango.Firewall).Network.StaticRoute, []string{virtualRouter}}, virtualRouter+":", true, "panos_static_route_ipv4", false, "", ) } func (g *FirewallNetworkingGenerator) createTunnelInterfaceResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.TunnelInterface, []string{}}, + getGeneric{g.client.(*pango.Firewall).Network.TunnelInterface, []string{}}, g.vsys+":", false, "panos_tunnel_interface", true, util.InterfaceImport, ) } func (g *FirewallNetworkingGenerator) createVirtualRouterResources() (resources []terraformutils.Resource) { - l, err := g.client.Network.VirtualRouter.GetList() + l, err := g.client.(*pango.Firewall).Network.VirtualRouter.GetList() if err != nil { return []terraformutils.Resource{} } for _, virtualRouter := range l { // TODO: doesn't work!!? - // rv, err := g.client.IsImported(util.VirtualRouterImport, "", "", g.vsys, virtualRouter) + // rv, err := g.client.(*pango.Firewall).IsImported(util.VirtualRouterImport, "", "", g.vsys, virtualRouter) // if err != nil || !rv { // continue // } @@ -524,21 +556,21 @@ func (g *FirewallNetworkingGenerator) createVirtualRouterResources() (resources func (g *FirewallNetworkingGenerator) createVlanResources() []terraformutils.Resource { // TODO: should activate check with util.VlanImport, but doesn't work? return g.createResourcesFromList( - getGeneric{g.client.Network.Vlan, []string{}}, + getGeneric{g.client.(*pango.Firewall).Network.Vlan, []string{}}, g.vsys+":", false, "panos_vlan", false, "", ) } func (g *FirewallNetworkingGenerator) createVlanInterfaceResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.VlanInterface, []string{}}, + getGeneric{g.client.(*pango.Firewall).Network.VlanInterface, []string{}}, g.vsys+":", false, "panos_vlan_interface", true, util.InterfaceImport, ) } func (g *FirewallNetworkingGenerator) createZoneResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Network.Zone, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Network.Zone, []string{g.vsys}}, g.vsys+":", false, "panos_zone", false, "", ) } @@ -645,7 +677,6 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { if r.InstanceInfo.Type == "panos_bgp_peer" { r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" - r.Item["bgp_peer_group"] = "${panos_bgp_peer_group." + normalizeResourceName(r.Item["panos_bgp_peer_group"].(string)) + ".name}" r.Item["peer_as"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".as_number}" } @@ -669,7 +700,9 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { if r.InstanceInfo.Type == "panos_ipsec_tunnel" { r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] r.Item["ak_ike_gateway"] = mapIKEGatewayNames[r.Item["ak_ike_gateway"].(string)] - r.Item["ak_ipsec_crypto_profile"] = mapIPSECCryptoProfileNames[r.Item["ak_ipsec_crypto_profile"].(string)] + if _, ok := r.Item["ak_ipsec_crypto_profile"]; ok { + r.Item["ak_ipsec_crypto_profile"] = mapIPSECCryptoProfileNames[r.Item["ak_ipsec_crypto_profile"].(string)] + } } if r.InstanceInfo.Type == "panos_ipsec_tunnel_proxy_id_ipv4" { diff --git a/providers/panos/firewall_objects.go b/providers/panos/firewall_objects.go index b2f3b942ff..ce29adf852 100644 --- a/providers/panos/firewall_objects.go +++ b/providers/panos/firewall_objects.go @@ -16,6 +16,7 @@ package panos import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" ) type FirewallObjectsGenerator struct { @@ -24,7 +25,7 @@ type FirewallObjectsGenerator struct { func (g *FirewallObjectsGenerator) createResourcesFromList(o getGeneric, idPrefix string, terraformResourceName string) (resources []terraformutils.Resource) { l, err := o.i.(getListWithOneArg).GetList(o.params[0]) - if err != nil { + if err != nil || len(l) == 0 { return []terraformutils.Resource{} } @@ -69,27 +70,27 @@ func (g *FirewallObjectsGenerator) createResourcesFromListWithVsys(o getGeneric, func (g *FirewallObjectsGenerator) createAddressGroupResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.AddressGroup, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.AddressGroup, []string{g.vsys}}, g.vsys+":", "panos_address_group", ) } func (g *FirewallObjectsGenerator) createAdministrativeTagResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.Tags, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.Tags, []string{g.vsys}}, g.vsys+":", "panos_administrative_tag", ) } func (g *FirewallObjectsGenerator) createApplicationGroupResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.AppGroup, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.AppGroup, []string{g.vsys}}, g.vsys+":", "panos_application_group", ) } func (g *FirewallObjectsGenerator) createApplicationObjectResources() (resources []terraformutils.Resource) { - l, err := g.client.Objects.Application.GetList(g.vsys) + l, err := g.client.(*pango.Firewall).Objects.Application.GetList(g.vsys) if err != nil { return []terraformutils.Resource{} } @@ -113,112 +114,112 @@ func (g *FirewallObjectsGenerator) createApplicationObjectResources() (resources // func (g *FirewallObjectsGenerator) createApplicationSignatureResources(applicationObject string) []terraformutils.Resource { // return g.createResourcesFromList( -// getGeneric{g.client.Objects.AppSignature, []string{g.vsys, applicationObject}}, +// getGeneric{g.client.(*pango.Firewall).Objects.AppSignature, []string{g.vsys, applicationObject}}, // g.vsys+":"+applicationObject+":", "panos_application_signature", // ) // } func (g *FirewallObjectsGenerator) createEDLResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.Edl, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.Edl, []string{g.vsys}}, g.vsys+":", "panos_edl", ) } func (g *FirewallObjectsGenerator) createLogForwardingResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.LogForwardingProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.LogForwardingProfile, []string{g.vsys}}, g.vsys+":", "panos_log_forwarding_profile", ) } func (g *FirewallObjectsGenerator) createServiceGroupResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.ServiceGroup, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.ServiceGroup, []string{g.vsys}}, g.vsys+":", "panos_service_group", ) } func (g *FirewallObjectsGenerator) createServiceObjectResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.Services, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.Services, []string{g.vsys}}, g.vsys+":", "panos_service_object", ) } func (g *FirewallObjectsGenerator) createAddressObjectResources() []terraformutils.Resource { return g.createResourcesFromList( - getGeneric{g.client.Objects.Address, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.Address, []string{g.vsys}}, g.vsys+":", "panos_address_object", ) } func (g *FirewallObjectsGenerator) createAntiSpywareSecurityProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.AntiSpywareProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.AntiSpywareProfile, []string{g.vsys}}, g.vsys+":", "panos_anti_spyware_security_profile", ) } func (g *FirewallObjectsGenerator) createAntivirusSecurityProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.AntivirusProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.AntivirusProfile, []string{g.vsys}}, g.vsys+":", "panos_antivirus_security_profile", ) } func (g *FirewallObjectsGenerator) createCustomDataPatternObjectResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.DataPattern, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.DataPattern, []string{g.vsys}}, g.vsys+":", "panos_custom_data_pattern_object", ) } func (g *FirewallObjectsGenerator) createDataFilteringSecurityProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.DataFilteringProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.DataFilteringProfile, []string{g.vsys}}, g.vsys+":", "panos_data_filtering_security_profile", ) } func (g *FirewallObjectsGenerator) createDOSProtectionProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.DosProtectionProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.DosProtectionProfile, []string{g.vsys}}, g.vsys+":", "panos_dos_protection_profile", ) } func (g *FirewallObjectsGenerator) createDynamicUserGroupResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.DynamicUserGroup, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.DynamicUserGroup, []string{g.vsys}}, g.vsys+":", "panos_dynamic_user_group", ) } func (g *FirewallObjectsGenerator) createFileBlockingSecurityProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.FileBlockingProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.FileBlockingProfile, []string{g.vsys}}, g.vsys+":", "panos_file_blocking_security_profile", ) } func (g *FirewallObjectsGenerator) createURLFilteringSecurityProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.UrlFilteringProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.UrlFilteringProfile, []string{g.vsys}}, g.vsys+":", "panos_url_filtering_security_profile", ) } func (g *FirewallObjectsGenerator) createVulnerabilitySecurityProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.VulnerabilityProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.VulnerabilityProfile, []string{g.vsys}}, g.vsys+":", "panos_vulnerability_security_profile", ) } func (g *FirewallObjectsGenerator) createWildfireAnalysisSecurityProfileResources() []terraformutils.Resource { return g.createResourcesFromListWithVsys( - getGeneric{g.client.Objects.WildfireAnalysisProfile, []string{g.vsys}}, + getGeneric{g.client.(*pango.Firewall).Objects.WildfireAnalysisProfile, []string{g.vsys}}, g.vsys+":", "panos_wildfire_analysis_security_profile", ) } diff --git a/providers/panos/firewall_policy.go b/providers/panos/firewall_policy.go index 0826b7c8ec..cecf00ea2a 100644 --- a/providers/panos/firewall_policy.go +++ b/providers/panos/firewall_policy.go @@ -19,6 +19,7 @@ import ( "strconv" "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" "github.com/PaloAltoNetworks/pango/util" ) @@ -28,7 +29,7 @@ type FirewallPolicyGenerator struct { func (g *FirewallPolicyGenerator) createResourcesFromList(o getGeneric, terraformResourceName string) (resources []terraformutils.Resource) { l, err := o.i.(getListWithOneArg).GetList(o.params[0]) - if err != nil { + if err != nil || len(l) == 0 { return []terraformutils.Resource{} } @@ -56,15 +57,15 @@ func (g *FirewallPolicyGenerator) createResourcesFromList(o getGeneric, terrafor } func (g *FirewallPolicyGenerator) createNATRuleGroupResources() []terraformutils.Resource { - return g.createResourcesFromList(getGeneric{g.client.Policies.Nat, []string{g.vsys}}, "panos_nat_rule_group") + return g.createResourcesFromList(getGeneric{g.client.(*pango.Firewall).Policies.Nat, []string{g.vsys}}, "panos_nat_rule_group") } func (g *FirewallPolicyGenerator) createPBFRuleGroupResources() []terraformutils.Resource { - return g.createResourcesFromList(getGeneric{g.client.Policies.PolicyBasedForwarding, []string{g.vsys}}, "panos_pbf_rule_group") + return g.createResourcesFromList(getGeneric{g.client.(*pango.Firewall).Policies.PolicyBasedForwarding, []string{g.vsys}}, "panos_pbf_rule_group") } func (g *FirewallPolicyGenerator) createSecurityRuleGroupResources() []terraformutils.Resource { - return g.createResourcesFromList(getGeneric{g.client.Policies.Security, []string{g.vsys}}, "panos_security_rule_group") + return g.createResourcesFromList(getGeneric{g.client.(*pango.Firewall).Policies.Security, []string{g.vsys}}, "panos_security_rule_group") } func (g *FirewallPolicyGenerator) InitResources() error { @@ -83,16 +84,18 @@ func (g *FirewallPolicyGenerator) PostConvertHook() error { for _, res := range g.Resources { if res.InstanceInfo.Type == "panos_nat_rule_group" { for _, rule := range res.Item["rule"].([]interface{}) { - a := rule.(map[string]interface{})["translated_packet"].([]interface{}) - for _, b := range a { - if _, ok := b.(map[string]interface{})["source"]; !ok { - b.(map[string]interface{})["source"] = make(map[string]interface{}) + if _, ok := rule.(map[string]interface{})["translated_packet"]; ok { + a := rule.(map[string]interface{})["translated_packet"].([]interface{}) + for _, b := range a { + if _, okb := b.(map[string]interface{})["source"]; !okb { + b.(map[string]interface{})["source"] = make(map[string]interface{}) + } } - } - for _, b := range a { - if _, ok := b.(map[string]interface{})["destination"]; !ok { - b.(map[string]interface{})["destination"] = make(map[string]interface{}) + for _, b := range a { + if _, okb := b.(map[string]interface{})["destination"]; !okb { + b.(map[string]interface{})["destination"] = make(map[string]interface{}) + } } } } diff --git a/providers/panos/helpers.go b/providers/panos/helpers.go index d664c1db5b..ead6433bd8 100644 --- a/providers/panos/helpers.go +++ b/providers/panos/helpers.go @@ -15,48 +15,59 @@ package panos import ( - "os" + "fmt" "strings" "unicode" "github.com/PaloAltoNetworks/pango" - "github.com/PaloAltoNetworks/pango/util" "golang.org/x/text/secure/precis" "golang.org/x/text/transform" "golang.org/x/text/unicode/norm" ) -func Initialize() (*pango.Firewall, error) { - fw := &pango.Firewall{ - Client: pango.Client{ - CheckEnvironment: true, - }, - } - - if val := os.Getenv("PANOS_LOGGING"); val == "" { - fw.Client.Logging = pango.LogQuiet - } - - return fw, fw.Initialize() +func Initialize() (interface{}, error) { + return pango.Connect(pango.Client{ + CheckEnvironment: true, + }) } -func GetVsysList() ([]string, error) { +func GetVsysList() ([]string, interface{}, error) { client, err := Initialize() if err != nil { - return []string{}, err + return []string{}, nil, err } - vsysList, err := client.EntryListUsing(client.Get, []string{ - "config", - "devices", - util.AsEntryXpath([]string{"localhost.localdomain"}), - "vsys", - }) - if err != nil { - return []string{}, err + switch c := client.(type) { + case *pango.Panorama: + return []string{"shared"}, pango.Panorama{}, nil + case *pango.Firewall: + var vsysList []string + vsysList, err = c.Vsys.GetList() + return vsysList, pango.Firewall{}, err + } + + return []string{}, nil, fmt.Errorf("client type not supported") +} + +func FilterCallableResources(t interface{}, resources []string) []string { + var filteredResources []string + + switch t.(type) { + case pango.Panorama: + for _, r := range resources { + if strings.HasPrefix(r, "panorama_") { + filteredResources = append(filteredResources, r) + } + } + case pango.Firewall: + for _, r := range resources { + if strings.HasPrefix(r, "firewall_") { + filteredResources = append(filteredResources, r) + } + } } - return vsysList, nil + return filteredResources } func normalizeResourceName(s string) string { @@ -127,7 +138,24 @@ type getListWithThreeArgs interface { GetList(string, string, string) ([]string, error) } +type getListWithFourArgs interface { + GetList(string, string, string, string) ([]string, error) +} + +type getListWithFiveArgs interface { + GetList(string, string, string, string, string) ([]string, error) +} + type getGeneric struct { i interface{} params []string } + +func contains(s []string, e string) bool { + for _, v := range s { + if v == e { + return true + } + } + return false +} diff --git a/providers/panos/panorama_device_config.go b/providers/panos/panorama_device_config.go new file mode 100644 index 0000000000..6bf94ba4fc --- /dev/null +++ b/providers/panos/panorama_device_config.go @@ -0,0 +1,308 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" + "github.com/PaloAltoNetworks/pango/util" +) + +type PanoramaDeviceConfigGenerator struct { + PanosService +} + +func (g *PanoramaDeviceConfigGenerator) createResourcesFromList(o getGeneric, idPrefix string, useIDForResourceName bool, terraformResourceName string) (resources []terraformutils.Resource) { + var l []string + var err error + + switch f := o.i.(type) { + case getListWithoutArg: + l, err = f.GetList() + case getListWithTwoArgs: + l, err = f.GetList(o.params[0], o.params[1]) + default: + err = fmt.Errorf("not supported") + } + if err != nil || len(l) == 0 { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := idPrefix + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(func() string { + if useIDForResourceName { + return id + } + + return r + }()), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + +func (g *PanoramaDeviceConfigGenerator) createDeviceGroupResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Panorama).Panorama.DeviceGroup, []string{}}, + "", false, "panos_panorama_device_group", + ) +} + +func (g *PanoramaDeviceConfigGenerator) createDeviceGroupParentResources() (resources []terraformutils.Resource) { + p, err := g.client.(*pango.Panorama).Panorama.DeviceGroup.GetParents() + if err != nil { + return resources + } + + for dg, parent := range p { + if parent != "" { + resources = append(resources, terraformutils.NewResource( + dg, + normalizeResourceName(dg), + "panos_device_group_parent", + "panos", + map[string]string{ + "device_group": dg, + "parent": parent, + }, + []string{}, + map[string]interface{}{}, + )) + } + } + + return resources +} + +func createAttributes(tmpl, ts, dg string) map[string]string { + attributes := make(map[string]string) + + if tmpl != "" { + attributes["template"] = tmpl + } + if ts != "" { + attributes["template_stack"] = ts + } + if dg != "" { + attributes["device_group"] = dg + } + + return attributes +} + +func createServerProfileResources(tmpl, ts, vsys, dg, terraformResourceName string, l []string) (resources []terraformutils.Resource) { + attributes := createAttributes(tmpl, ts, dg) + + for _, r := range l { + id := tmpl + ":" + ts + ":" + vsys + ":" + dg + ":" + r + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(id), + terraformResourceName, + "panos", + attributes, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PanoramaDeviceConfigGenerator) createEmailServerProfileResources(tmpl, ts, vsys, dg string) (resources []terraformutils.Resource) { + l := make([]string, 0) + var err error + + if tmpl != "" || ts != "" { + l, err = g.client.(*pango.Panorama).Device.EmailServerProfile.GetList(tmpl, ts, vsys) + } + if dg != "" { + ans := make([]string, 0, 7) + ans = append(ans, util.DeviceGroupXpathPrefix(dg)...) + ans = append(ans, []string{"log-settings", "email"}...) + l, err = g.client.(util.XapiClient).EntryListUsing(g.client.(util.XapiClient).Get, ans) + } + + if err != nil || len(l) == 0 { + return resources + } + + return createServerProfileResources(tmpl, ts, vsys, dg, "panos_panorama_email_server_profile", l) +} + +func (g *PanoramaDeviceConfigGenerator) createHTTPServerProfileResources(tmpl, ts, vsys, dg string) (resources []terraformutils.Resource) { + l := make([]string, 0) + var err error + + if tmpl != "" || ts != "" { + l, err = g.client.(*pango.Panorama).Device.HttpServerProfile.GetList(tmpl, ts, vsys) + } + if dg != "" { + ans := make([]string, 0, 7) + ans = append(ans, util.DeviceGroupXpathPrefix(dg)...) + ans = append(ans, []string{"log-settings", "http"}...) + l, err = g.client.(util.XapiClient).EntryListUsing(g.client.(util.XapiClient).Get, ans) + } + + if err != nil || len(l) == 0 { + return resources + } + + return createServerProfileResources(tmpl, ts, vsys, dg, "panos_panorama_http_server_profile", l) +} + +func (g *PanoramaDeviceConfigGenerator) createSNMPTrapServerProfileResources(tmpl, ts, vsys, dg string) (resources []terraformutils.Resource) { + l := make([]string, 0) + var err error + + if tmpl != "" || ts != "" { + l, err = g.client.(*pango.Panorama).Device.SnmpServerProfile.GetList(tmpl, ts, vsys) + } + if dg != "" { + ans := make([]string, 0, 7) + ans = append(ans, util.DeviceGroupXpathPrefix(dg)...) + ans = append(ans, []string{"log-settings", "snmptrap"}...) + l, err = g.client.(util.XapiClient).EntryListUsing(g.client.(util.XapiClient).Get, ans) + } + + if err != nil || len(l) == 0 { + return resources + } + + return createServerProfileResources(tmpl, ts, vsys, dg, "panos_panorama_snmptrap_server_profile", l) +} + +func (g *PanoramaDeviceConfigGenerator) createSyslogServerProfileResources(tmpl, ts, vsys, dg string) (resources []terraformutils.Resource) { + l := make([]string, 0) + var err error + + if tmpl != "" || ts != "" { + l, err = g.client.(*pango.Panorama).Device.SyslogServerProfile.GetList(tmpl, ts, vsys) + } + if dg != "" { + ans := make([]string, 0, 7) + ans = append(ans, util.DeviceGroupXpathPrefix(dg)...) + ans = append(ans, []string{"log-settings", "syslog"}...) + l, err = g.client.(util.XapiClient).EntryListUsing(g.client.(util.XapiClient).Get, ans) + } + + if err != nil || len(l) == 0 { + return resources + } + + return createServerProfileResources(tmpl, ts, vsys, dg, "panos_panorama_syslog_server_profile", l) +} + +func (g *PanoramaDeviceConfigGenerator) createTemplateResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Panorama).Panorama.Template, []string{}}, + "", false, "panos_panorama_template", + ) +} + +func (g *PanoramaDeviceConfigGenerator) createTemplateStackResources() []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Panorama).Panorama.TemplateStack, []string{}}, + "", false, "panos_panorama_template_stack", + ) +} + +func (g *PanoramaDeviceConfigGenerator) createTemplateVariableResources(tmpl, ts string) []terraformutils.Resource { + return g.createResourcesFromList(getGeneric{g.client.(*pango.Panorama).Panorama.TemplateVariable, []string{tmpl, ts}}, + tmpl+":"+ts+":", true, "panos_panorama_template_variable", + ) +} + +func (g *PanoramaDeviceConfigGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + g.Resources = append(g.Resources, g.createTemplateStackResources()...) + g.Resources = append(g.Resources, g.createTemplateResources()...) + g.Resources = append(g.Resources, g.createDeviceGroupResources()...) + g.Resources = append(g.Resources, g.createDeviceGroupParentResources()...) + + ts, err := g.client.(*pango.Panorama).Panorama.TemplateStack.GetList() + if err != nil { + return err + } + + for _, v := range ts { + g.Resources = append(g.Resources, g.createTemplateVariableResources("", v)...) + + vsysList, err := g.client.(*pango.Panorama).Vsys.GetList("", v) + if err != nil { + continue + } + + vsysList = append(vsysList, "shared") + + for _, vsys := range vsysList { + g.Resources = append(g.Resources, g.createEmailServerProfileResources("", v, vsys, "")...) + g.Resources = append(g.Resources, g.createHTTPServerProfileResources("", v, vsys, "")...) + g.Resources = append(g.Resources, g.createSNMPTrapServerProfileResources("", v, vsys, "")...) + g.Resources = append(g.Resources, g.createSyslogServerProfileResources("", v, vsys, "")...) + } + } + + tmpl, err := g.client.(*pango.Panorama).Panorama.Template.GetList() + if err != nil { + return err + } + + for _, v := range tmpl { + g.Resources = append(g.Resources, g.createTemplateVariableResources(v, "")...) + + vsysList, err := g.client.(*pango.Panorama).Vsys.GetList(v, "") + if err != nil { + continue + } + if err != nil { + continue + } + + vsysList = append(vsysList, "shared") + + for _, vsys := range vsysList { + g.Resources = append(g.Resources, g.createEmailServerProfileResources(v, "", vsys, "")...) + g.Resources = append(g.Resources, g.createHTTPServerProfileResources(v, "", vsys, "")...) + g.Resources = append(g.Resources, g.createSNMPTrapServerProfileResources(v, "", vsys, "")...) + g.Resources = append(g.Resources, g.createSyslogServerProfileResources(v, "", vsys, "")...) + } + } + + dg, err := g.client.(*pango.Panorama).Panorama.DeviceGroup.GetList() + if err != nil { + return err + } + + for _, v := range dg { + g.Resources = append(g.Resources, g.createEmailServerProfileResources("", "", "", v)...) + g.Resources = append(g.Resources, g.createHTTPServerProfileResources("", "", "", v)...) + g.Resources = append(g.Resources, g.createSNMPTrapServerProfileResources("", "", "", v)...) + g.Resources = append(g.Resources, g.createSyslogServerProfileResources("", "", "", v)...) + } + + // TODO: Panorama's own profiles are not yet supported by the Terraform provider + + return nil +} diff --git a/providers/panos/panorama_networking.go b/providers/panos/panorama_networking.go new file mode 100644 index 0000000000..13ca32e504 --- /dev/null +++ b/providers/panos/panorama_networking.go @@ -0,0 +1,931 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" + "github.com/PaloAltoNetworks/pango/netw/interface/eth" + "github.com/PaloAltoNetworks/pango/netw/interface/subinterface/layer2" + "github.com/PaloAltoNetworks/pango/netw/interface/subinterface/layer3" + "github.com/PaloAltoNetworks/pango/util" + "github.com/PaloAltoNetworks/pango/vsys" +) + +type PanoramaNetworkingGenerator struct { + PanosService +} + +func (g *PanoramaNetworkingGenerator) createResourcesFromList( + o getGeneric, + idPrefix string, + useIDForResourceName bool, + terraformResourceName string, +) (resources []terraformutils.Resource) { + var l []string + var err error + + switch f := o.i.(type) { + case getListWithoutArg: + l, err = f.GetList() + case getListWithOneArg: + l, err = f.GetList(o.params[0]) + case getListWithTwoArgs: + l, err = f.GetList(o.params[0], o.params[1]) + case getListWithThreeArgs: + l, err = f.GetList(o.params[0], o.params[1], o.params[2]) + case getListWithFourArgs: + l, err = f.GetList(o.params[0], o.params[1], o.params[2], o.params[3]) + case getListWithFiveArgs: + l, err = f.GetList(o.params[0], o.params[1], o.params[2], o.params[3], o.params[4]) + default: + err = fmt.Errorf("not supported") + } + if err != nil || len(l) == 0 { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := idPrefix + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(func() string { + if useIDForResourceName { + return id + } + + return r + }()), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createAggregateInterfaceResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.AggregateInterface.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + for _, vsys := range v { + for _, aggregateInterface := range l { + if !contains(vsys.NetworkImports.Interfaces, aggregateInterface) { + continue + } + + rv, err := g.client.(*pango.Panorama).IsImported(util.InterfaceImport, tmpl, ts, vsys.Name, aggregateInterface) + if err != nil || !rv { + continue + } + + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + aggregateInterface + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_aggregate_interface", + "panos", + []string{}, + )) + + e, err := g.client.(*pango.Panorama).Network.AggregateInterface.Get(tmpl, ts, aggregateInterface) + if err != nil { + continue + } + + if e.Mode == eth.ModeLayer2 || e.Mode == eth.ModeVirtualWire { + g.Resources = append(g.Resources, g.createLayer2SubInterfaceResources(tmpl, ts, vsys.Name, layer2.EthernetInterface, aggregateInterface, e.Mode)...) + } + + if e.Mode == eth.ModeLayer3 { + g.Resources = append(g.Resources, g.createLayer3SubInterfaceResources(tmpl, ts, vsys.Name, layer3.EthernetInterface, aggregateInterface)...) + } + } + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createBFDProfileResources(tmpl, ts string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BfdProfile, []string{tmpl, ts}}, + tmpl+":"+ts+":", false, "panos_panorama_bfd_profile", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPResource(tmpl, ts, virtualRouter string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + tmpl+":"+ts+":"+virtualRouter, + normalizeResourceName(tmpl+":"+ts+":"+virtualRouter), + "panos_panorama_bgp", + "panos", + []string{}, + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPAggregateResources(tmpl, ts, virtualRouter string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.BgpAggregate.GetList(tmpl, ts, virtualRouter) + if err != nil { + return []terraformutils.Resource{} + } + + for _, bgpAggregate := range l { + id := tmpl + ":" + ts + ":" + virtualRouter + ":" + bgpAggregate + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_bgp_aggregate", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPAggregateAdvertiseFilterResources(tmpl, ts, virtualRouter, bgpAggregate)...) + resources = append(resources, g.createBGPAggregateSuppressFilterResources(tmpl, ts, virtualRouter, bgpAggregate)...) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createBGPAggregateAdvertiseFilterResources(tmpl, ts, virtualRouter, bgpAggregate string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpAggAdvertiseFilter, []string{tmpl, ts, virtualRouter, bgpAggregate}}, + tmpl+":"+ts+":"+virtualRouter+":"+bgpAggregate+":", true, "panos_panorama_bgp_aggregate_advertise_filter", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPAggregateSuppressFilterResources(tmpl, ts, virtualRouter, bgpAggregate string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpAggSuppressFilter, []string{tmpl, ts, virtualRouter, bgpAggregate}}, + tmpl+":"+ts+":"+virtualRouter+":"+bgpAggregate+":", true, "panos_panorama_bgp_aggregate_suppress_filter", + ) +} + +// The secret argument will contain "(incorrect)", not the real value +func (g *PanoramaNetworkingGenerator) createBGPAuthProfileResources(tmpl, ts, virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpAuthProfile, []string{tmpl, ts, virtualRouter}}, + tmpl+":"+ts+":"+virtualRouter+":", true, "panos_panorama_bgp_auth_profile", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPConditionalAdvertisementResources(tmpl, ts, virtualRouter string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.BgpConditionalAdv.GetList(tmpl, ts, virtualRouter) + if err != nil { + return []terraformutils.Resource{} + } + + for _, bgpConditionalAdv := range l { + id := tmpl + ":" + ts + ":" + virtualRouter + ":" + bgpConditionalAdv + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_bgp_conditional_adv", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPConditionalAdvertisementAdvertiseFilterResources(tmpl, ts, virtualRouter, bgpConditionalAdv)...) + resources = append(resources, g.createBGPConditionalAdvertisementNonExistFilterResources(tmpl, ts, virtualRouter, bgpConditionalAdv)...) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createBGPConditionalAdvertisementAdvertiseFilterResources(tmpl, ts, virtualRouter, bgpConditionalAdv string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpConAdvAdvertiseFilter, []string{tmpl, ts, virtualRouter, bgpConditionalAdv}}, + tmpl+":"+ts+":"+virtualRouter+":"+bgpConditionalAdv+":", true, "panos_panorama_bgp_conditional_adv_advertise_filter", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPConditionalAdvertisementNonExistFilterResources(tmpl, ts, virtualRouter, bgpConditionalAdv string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpConAdvNonExistFilter, []string{tmpl, ts, virtualRouter, bgpConditionalAdv}}, + tmpl+":"+ts+":"+virtualRouter+":"+bgpConditionalAdv+":", true, "panos_panorama_bgp_conditional_adv_non_exist_filter", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPDampeningProfileResources(tmpl, ts, virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpDampeningProfile, []string{tmpl, ts, virtualRouter}}, + tmpl+":"+ts+":"+virtualRouter+":", true, "panos_panorama_bgp_dampening_profile", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPExportRuleGroupResources(tmpl, ts, virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpExport, []string{tmpl, ts, virtualRouter}}, + tmpl+":"+ts+":"+virtualRouter+":", true, "panos_panorama_bgp_export_rule_group", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPImportRuleGroupResources(tmpl, ts, virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpImport, []string{tmpl, ts, virtualRouter}}, + tmpl+":"+ts+":"+virtualRouter+":", true, "panos_panorama_bgp_import_rule_group", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPPeerGroupResources(tmpl, ts, virtualRouter string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.BgpPeerGroup.GetList(tmpl, ts, virtualRouter) + if err != nil { + return []terraformutils.Resource{} + } + + for _, bgpPeerGroup := range l { + id := tmpl + ":" + ts + ":" + virtualRouter + ":" + bgpPeerGroup + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_bgp_peer_group", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPPeerResources(tmpl, ts, virtualRouter, bgpPeerGroup)...) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createBGPPeerResources(tmpl, ts, virtualRouter, bgpPeerGroup string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpPeer, []string{tmpl, ts, virtualRouter, bgpPeerGroup}}, + tmpl+":"+ts+":"+virtualRouter+":"+bgpPeerGroup+":", true, "panos_panorama_bgp_peer", + ) +} + +func (g *PanoramaNetworkingGenerator) createBGPRedistResources(tmpl, ts, virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.BgpRedistRule, []string{tmpl, ts, virtualRouter}}, + tmpl+":"+ts+":"+virtualRouter+":", true, "panos_panorama_bgp_redist_rule", + ) +} + +func (g *PanoramaNetworkingGenerator) createEthernetInterfaceResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.EthernetInterface.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + for _, vsys := range v { + for _, ethernetInterface := range l { + if !contains(vsys.NetworkImports.Interfaces, ethernetInterface) { + continue + } + + rv, err := g.client.(*pango.Panorama).IsImported(util.InterfaceImport, tmpl, ts, vsys.Name, ethernetInterface) + if err != nil || !rv { + continue + } + + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + ethernetInterface + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_ethernet_interface", + "panos", + []string{}, + )) + + e, err := g.client.(*pango.Panorama).Network.EthernetInterface.Get(tmpl, ts, ethernetInterface) + if err != nil { + continue + } + + if e.Mode == eth.ModeLayer2 || e.Mode == eth.ModeVirtualWire { + g.Resources = append(g.Resources, g.createLayer2SubInterfaceResources(tmpl, ts, vsys.Name, layer2.EthernetInterface, ethernetInterface, e.Mode)...) + } + + if e.Mode == eth.ModeLayer3 { + g.Resources = append(g.Resources, g.createLayer3SubInterfaceResources(tmpl, ts, vsys.Name, layer3.EthernetInterface, ethernetInterface)...) + } + } + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createGRETunnelResources(tmpl, ts string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.GreTunnel, []string{tmpl, ts}}, + tmpl+":"+ts+":", false, "panos_panorama_gre_tunnel", + ) +} + +func (g *PanoramaNetworkingGenerator) createIKECryptoProfileResources(tmpl, ts string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.IkeCryptoProfile.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + idPrefix := tmpl + ":" + ts + ":" + for _, ikeCryptoProfile := range l { + id := idPrefix + ikeCryptoProfile + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(id), + "panos_panorama_ike_crypto_profile", + "panos", + map[string]string{ + "name": ikeCryptoProfile, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createIKEGatewayResources(tmpl, ts string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.IkeGateway.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + idPrefix := tmpl + ":" + ts + ":" + for _, ikeGateway := range l { + id := idPrefix + ikeGateway + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(id), + "panos_panorama_ike_gateway", + "panos", + map[string]string{ + "name": ikeGateway, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createIPSECCryptoProfileResources(tmpl, ts string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.IpsecCryptoProfile.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + idPrefix := tmpl + ":" + ts + ":" + for _, ipsecCryptoProfile := range l { + id := idPrefix + ipsecCryptoProfile + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(id), + "panos_panorama_ipsec_crypto_profile", + "panos", + map[string]string{ + "name": ipsecCryptoProfile, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createIPSECTunnelProxyIDIPv4Resources(tmpl, ts, ipsecTunnel string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.IpsecTunnelProxyId, []string{tmpl, ts, ipsecTunnel}}, + tmpl+":"+ts+":"+ipsecTunnel+":", true, "panos_panorama_ipsec_tunnel_proxy_id_ipv4", + ) +} + +func (g *PanoramaNetworkingGenerator) createIPSECTunnelResources(tmpl, ts string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.IpsecTunnel.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + idPrefix := tmpl + "::" + for _, ipsecTunnel := range l { + id := idPrefix + ipsecTunnel + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_ipsec_tunnel", + "panos", + []string{}, + )) + + resources = append(resources, g.createIPSECTunnelProxyIDIPv4Resources(tmpl, ts, ipsecTunnel)...) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createLayer2SubInterfaceResources(tmpl, ts, vsys, interfaceType, parentInterface, parentMode string) []terraformutils.Resource { + // TO FIX: check disabled! + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.Layer2Subinterface, []string{tmpl, ts, interfaceType, parentInterface, parentMode}}, + tmpl+":"+ts+":"+interfaceType+":"+parentInterface+":"+parentMode+":"+vsys+":", true, "panos_panorama_layer2_subinterface", + ) +} + +func (g *PanoramaNetworkingGenerator) createLayer3SubInterfaceResources(tmpl, ts, vsys, interfaceType, parentInterface string) []terraformutils.Resource { + // TO FIX: check disabled! + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.Layer3Subinterface, []string{tmpl, ts, interfaceType, parentInterface}}, + tmpl+":"+ts+":"+interfaceType+":"+parentInterface+":"+vsys+":", true, "panos_panorama_layer3_subinterface", + ) +} + +func (g *PanoramaNetworkingGenerator) createLoopbackInterfaceResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.LoopbackInterface.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + for _, vsys := range v { + for _, loopbackInterface := range l { + if !contains(vsys.NetworkImports.Interfaces, loopbackInterface) { + continue + } + + rv, err := g.client.(*pango.Panorama).IsImported(util.InterfaceImport, tmpl, ts, vsys.Name, loopbackInterface) + if err != nil || !rv { + continue + } + + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + loopbackInterface + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_loopback_interface", + "panos", + []string{}, + )) + } + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createManagementProfileResources(tmpl, ts string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.ManagementProfile.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + idPrefix := tmpl + ":" + ts + ":" + for _, managementProfile := range l { + id := idPrefix + managementProfile + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(id), + "panos_panorama_management_profile", + "panos", + map[string]string{ + "name": managementProfile, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createMonitorProfileResources(tmpl, ts string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.MonitorProfile, []string{tmpl, ts}}, + tmpl+":"+ts+":", true, "panos_panorama_monitor_profile", + ) +} + +func (g *PanoramaNetworkingGenerator) createRedistributionProfileResources(tmpl, ts, virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.RedistributionProfile, []string{tmpl, ts, virtualRouter}}, + tmpl+":"+ts+":"+virtualRouter+":", true, "panos_panorama_redistribution_profile_ipv4", + ) +} + +func (g *PanoramaNetworkingGenerator) createStaticRouteIpv4Resources(tmpl, ts, virtualRouter string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Network.StaticRoute, []string{tmpl, ts, virtualRouter}}, + tmpl+":"+ts+":"+virtualRouter+":", true, "panos_panorama_static_route_ipv4", + ) +} + +func (g *PanoramaNetworkingGenerator) createTunnelInterfaceResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.TunnelInterface.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + for _, vsys := range v { + for _, tunnelInterface := range l { + if !contains(vsys.NetworkImports.Interfaces, tunnelInterface) { + continue + } + + rv, err := g.client.(*pango.Panorama).IsImported(util.InterfaceImport, tmpl, ts, vsys.Name, tunnelInterface) + if err != nil || !rv { + continue + } + + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + tunnelInterface + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_tunnel_interface", + "panos", + []string{}, + )) + } + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createVirtualRouterResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.VirtualRouter.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + for _, vsys := range v { + for _, virtualRouter := range l { + if !contains(vsys.NetworkImports.VirtualRouters, virtualRouter) { + continue + } + + // TODO: doesn't work!!? + // rv, err := g.client.(*pango.Panorama).IsImported(util.InterfaceImport, tmpl, ts, vsys.Name, virtualRouter) + // if err != nil || !rv { + // continue + // } + + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + virtualRouter + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_virtual_router", + "panos", + []string{}, + )) + + resources = append(resources, g.createBGPResource(tmpl, ts, virtualRouter)) + resources = append(resources, g.createBGPAggregateResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createBGPAuthProfileResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createBGPConditionalAdvertisementResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createBGPDampeningProfileResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createBGPExportRuleGroupResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createBGPImportRuleGroupResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createBGPPeerGroupResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createBGPRedistResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createRedistributionProfileResources(tmpl, ts, virtualRouter)...) + resources = append(resources, g.createStaticRouteIpv4Resources(tmpl, ts, virtualRouter)...) + } + } + + return resources +} + +// FIX: get VLANs in Vsys = None +func (g *PanoramaNetworkingGenerator) createVlanResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.Vlan.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + for _, vsys := range v { + for _, vlan := range l { + if !contains(vsys.NetworkImports.Vlans, vlan) { + continue + } + + rv, err := g.client.(*pango.Panorama).IsImported(util.VlanImport, tmpl, ts, vsys.Name, vlan) + if err != nil || !rv { + continue + } + + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + vlan + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_vlan", + "panos", + []string{}, + )) + } + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createVlanInterfaceResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Network.VlanInterface.GetList(tmpl, ts) + if err != nil { + return []terraformutils.Resource{} + } + + for _, vsys := range v { + for _, vlanInterface := range l { + if !contains(vsys.NetworkImports.Interfaces, vlanInterface) { + continue + } + + rv, err := g.client.(*pango.Panorama).IsImported(util.InterfaceImport, tmpl, ts, vsys.Name, vlanInterface) + if err != nil || !rv { + continue + } + + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + vlanInterface + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_vlan_interface", + "panos", + []string{}, + )) + } + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) createZoneResources(tmpl, ts string, v []vsys.Entry) (resources []terraformutils.Resource) { + for _, vsys := range v { + l, err := g.client.(*pango.Panorama).Network.Zone.GetList(tmpl, ts, vsys.Name) + if err != nil { + return []terraformutils.Resource{} + } + + for _, zone := range l { + id := tmpl + ":" + ts + ":" + vsys.Name + ":" + zone + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_zone", + "panos", + []string{}, + )) + } + } + + return resources +} + +func (g *PanoramaNetworkingGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + ts, err := g.client.(*pango.Panorama).Panorama.TemplateStack.GetList() + if err != nil { + return err + } + + for _, v := range ts { + g.Resources = append(g.Resources, g.createBFDProfileResources("", v)...) + g.Resources = append(g.Resources, g.createIKECryptoProfileResources("", v)...) + g.Resources = append(g.Resources, g.createIKEGatewayResources("", v)...) + g.Resources = append(g.Resources, g.createIPSECCryptoProfileResources("", v)...) + g.Resources = append(g.Resources, g.createManagementProfileResources("", v)...) + g.Resources = append(g.Resources, g.createMonitorProfileResources("", v)...) + } + + tmpl, err := g.client.(*pango.Panorama).Panorama.Template.GetList() + if err != nil { + return err + } + + for _, v := range tmpl { + vsysAll, err := g.client.(*pango.Panorama).Vsys.GetAll(v, "") + if err != nil { + return err + } + + g.Resources = append(g.Resources, g.createAggregateInterfaceResources(v, "", vsysAll)...) + g.Resources = append(g.Resources, g.createBFDProfileResources(v, "")...) + g.Resources = append(g.Resources, g.createEthernetInterfaceResources(v, "", vsysAll)...) + g.Resources = append(g.Resources, g.createGRETunnelResources(v, "")...) + g.Resources = append(g.Resources, g.createIKECryptoProfileResources(v, "")...) + g.Resources = append(g.Resources, g.createIKEGatewayResources(v, "")...) + g.Resources = append(g.Resources, g.createIPSECCryptoProfileResources(v, "")...) + g.Resources = append(g.Resources, g.createIPSECTunnelResources(v, "")...) + g.Resources = append(g.Resources, g.createLoopbackInterfaceResources(v, "", vsysAll)...) + g.Resources = append(g.Resources, g.createManagementProfileResources(v, "")...) + g.Resources = append(g.Resources, g.createMonitorProfileResources(v, "")...) + g.Resources = append(g.Resources, g.createTunnelInterfaceResources(v, "", vsysAll)...) + g.Resources = append(g.Resources, g.createVirtualRouterResources(v, "", vsysAll)...) + g.Resources = append(g.Resources, g.createVlanResources(v, "", vsysAll)...) + g.Resources = append(g.Resources, g.createVlanInterfaceResources(v, "", vsysAll)...) + g.Resources = append(g.Resources, g.createZoneResources(v, "", vsysAll)...) + } + + return nil +} + +func (g *PanoramaNetworkingGenerator) PostConvertHook() error { + mapInterfaceNames := map[string]string{} + mapInterfaceModes := map[string]string{} + mapIKECryptoProfileNames := map[string]string{} + mapIKEGatewayNames := map[string]string{} + mapIPSECCryptoProfileNames := map[string]string{} + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_panorama_aggregate_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } + + if r.InstanceInfo.Type == "panos_panorama_ethernet_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } + + if r.InstanceInfo.Type == "panos_panorama_layer2_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_layer3_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_loopback_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_tunnel_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_vlan_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_ike_crypto_profile" { + mapIKECryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_ike_gateway" { + mapIKEGatewayNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_ipsec_crypto_profile" { + mapIPSECCryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + } + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_panorama_bgp" || + r.InstanceInfo.Type == "panos_panorama_redistribution_profile_ipv4" || + r.InstanceInfo.Type == "panos_panorama_static_route_ipv4" { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_virtual_router." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".name}" + } + } + + if r.InstanceInfo.Type == "panos_panorama_bgp_aggregate" || + r.InstanceInfo.Type == "panos_panorama_bgp_auth_profile" || + r.InstanceInfo.Type == "panos_panorama_bgp_conditional_adv" || + r.InstanceInfo.Type == "panos_panorama_bgp_dampening_profile" || + r.InstanceInfo.Type == "panos_panorama_bgp_export_rule_group" || + r.InstanceInfo.Type == "panos_panorama_bgp_import_rule_group" || + r.InstanceInfo.Type == "panos_panorama_bgp_peer_group" || + r.InstanceInfo.Type == "panos_panorama_bgp_redist_rule" { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + } + + if r.InstanceInfo.Type == "panos_panorama_bgp_aggregate_advertise_filter" || + r.InstanceInfo.Type == "panos_panorama_bgp_aggregate_suppress_filter" { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp_aggregate." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + r.Item["bgp_aggregate"] = "${panos_panorama_bgp_aggregate." + normalizeResourceName(r.Item["bgp_aggregate"].(string)) + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_bgp_peer" { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + r.Item["peer_as"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".as_number}" + } + r.Item["bgp_peer_group"] = "${panos_panorama_bgp_peer_group." + normalizeResourceName(r.Item["panos_bgp_peer_group"].(string)) + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_bgp_conditional_adv_advertise_filter" || + r.InstanceInfo.Type == "panos_panorama_bgp_conditional_adv_non_exist_filter" { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + r.Item["bgp_conditional_adv"] = "${panos_panorama_bgp_conditional_adv." + normalizeResourceName(r.Item["panos_bgp_conditional_adv"].(string)) + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_gre_tunnel" { + r.Item["interface"] = mapInterfaceNames[r.Item["interface"].(string)] + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } + + if r.InstanceInfo.Type == "panos_panorama_ike_gateway" { + if _, ok := r.Item["ikev1_crypto_profile"]; ok { + r.Item["ikev1_crypto_profile"] = mapIKECryptoProfileNames[r.Item["ikev1_crypto_profile"].(string)] + } + } + + if r.InstanceInfo.Type == "panos_panorama_ipsec_tunnel" { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + r.Item["ak_ike_gateway"] = mapIKEGatewayNames[r.Item["ak_ike_gateway"].(string)] + r.Item["ak_ipsec_crypto_profile"] = mapIPSECCryptoProfileNames[r.Item["ak_ipsec_crypto_profile"].(string)] + } + + if r.InstanceInfo.Type == "panos_panorama_ipsec_tunnel_proxy_id_ipv4" { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } + + if r.InstanceInfo.Type == "panos_panorama_layer2_subinterface" { + if _, ok := mapInterfaceModes[r.Item["parent_interface"].(string)]; ok { + r.Item["parent_mode"] = mapInterfaceModes[r.Item["parent_interface"].(string)] + } + } + + if r.InstanceInfo.Type == "panos_panorama_layer2_subinterface" || + r.InstanceInfo.Type == "panos_panorama_layer3_subinterface" { + if _, ok := mapInterfaceNames[r.Item["parent_interface"].(string)]; ok { + r.Item["parent_interface"] = mapInterfaceNames[r.Item["parent_interface"].(string)] + } + } + + if r.InstanceInfo.Type == "panos_panorama_virtual_router" { + if r.Item["ospfv3_ext_dist"].(string) == "0" { + r.Item["ospfv3_ext_dist"] = "110" + } + + if r.Item["ebgp_dist"].(string) == "0" { + r.Item["ebgp_dist"] = "20" + } + + if r.Item["rip_dist"].(string) == "0" { + r.Item["rip_dist"] = "120" + } + + if r.Item["ibgp_dist"].(string) == "0" { + r.Item["ibgp_dist"] = "200" + } + + if r.Item["static_dist"].(string) == "0" { + r.Item["static_dist"] = "10" + } + + if r.Item["ospf_int_dist"].(string) == "0" { + r.Item["ospf_int_dist"] = "30" + } + + if r.Item["static_ipv6_dist"].(string) == "0" { + r.Item["static_ipv6_dist"] = "10" + } + + if r.Item["ospf_ext_dist"].(string) == "0" { + r.Item["ospf_ext_dist"] = "110" + } + + if r.Item["ospfv3_int_dist"].(string) == "0" { + r.Item["ospfv3_int_dist"] = "30" + } + } + + if r.InstanceInfo.Type == "panos_panorama_virtual_router" || + r.InstanceInfo.Type == "panos_panorama_zone" { + if _, ok := r.Item["interfaces"]; ok { + interfaces := make([]string, len(r.Item["interfaces"].([]interface{}))) + for k, eth := range r.Item["interfaces"].([]interface{}) { + if name, ok := mapInterfaceNames[eth.(string)]; ok { + interfaces[k] = name + } + } + + r.Item["interfaces"] = interfaces + } + } + + if r.InstanceInfo.Type == "panos_panorama_vlan" { + r.Item["vlan_interface"] = mapInterfaceNames[r.Item["vlan_interface"].(string)] + } + } + + return nil +} diff --git a/providers/panos/panorama_objects.go b/providers/panos/panorama_objects.go new file mode 100644 index 0000000000..3829c8a28e --- /dev/null +++ b/providers/panos/panorama_objects.go @@ -0,0 +1,290 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" +) + +type PanoramaObjectsGenerator struct { + PanosService +} + +func (g *PanoramaObjectsGenerator) createResourcesFromList(o getGeneric, dg string, terraformResourceName string) (resources []terraformutils.Resource) { + l, err := o.i.(getListWithOneArg).GetList(o.params[0]) + if err != nil || len(l) == 0 { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := dg + ":" + r + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(id), + terraformResourceName, + "panos", + map[string]string{ + "device_group": dg, + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PanoramaObjectsGenerator) createAddressGroupResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.AddressGroup, []string{dg}}, + dg, "panos_panorama_address_group", + ) +} + +func (g *PanoramaObjectsGenerator) createAdministrativeTagResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.Tags, []string{dg}}, + dg, "panos_panorama_administrative_tag", + ) +} + +func (g *PanoramaObjectsGenerator) createApplicationGroupResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.AppGroup, []string{dg}}, + dg, "panos_panorama_application_group", + ) +} + +func (g *PanoramaObjectsGenerator) createApplicationObjectResources(dg string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Objects.Application.GetList(dg) + if err != nil { + return []terraformutils.Resource{} + } + + for _, r := range l { + id := dg + ":" + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_application_object", + "panos", + []string{}, + )) + + // TODO + // resources = append(resources, g.createApplicationSignatureResources(dg, r)...) + } + + return resources +} + +func (g *PanoramaObjectsGenerator) createEDLResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.Edl, []string{dg}}, + dg, "panos_panorama_edl", + ) +} + +func (g *PanoramaObjectsGenerator) createLogForwardingResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.LogForwardingProfile, []string{dg}}, + dg, "panos_panorama_log_forwarding_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createServiceGroupResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.ServiceGroup, []string{dg}}, + dg, "panos_panorama_service_group", + ) +} + +func (g *PanoramaObjectsGenerator) createServiceObjectResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.Services, []string{dg}}, + dg, "panos_panorama_service_object", + ) +} + +func (g *PanoramaObjectsGenerator) createAddressObjectResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.Address, []string{dg}}, + dg, "panos_address_object", + ) +} + +func (g *PanoramaObjectsGenerator) createAntiSpywareSecurityProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.AntiSpywareProfile, []string{dg}}, + dg, "panos_anti_spyware_security_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createAntivirusSecurityProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.AntivirusProfile, []string{dg}}, + dg, "panos_antivirus_security_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createCustomDataPatternObjectResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.DataPattern, []string{dg}}, + dg, "panos_custom_data_pattern_object", + ) +} + +func (g *PanoramaObjectsGenerator) createDataFilteringSecurityProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.DataFilteringProfile, []string{dg}}, + dg, "panos_data_filtering_security_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createDOSProtectionProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.DosProtectionProfile, []string{dg}}, + dg, "panos_dos_protection_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createDynamicUserGroupResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.DynamicUserGroup, []string{dg}}, + dg, "panos_dynamic_user_group", + ) +} + +func (g *PanoramaObjectsGenerator) createFileBlockingSecurityProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.FileBlockingProfile, []string{dg}}, + dg, "panos_file_blocking_security_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createURLFilteringSecurityProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.UrlFilteringProfile, []string{dg}}, + dg, "panos_url_filtering_security_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createVulnerabilitySecurityProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.VulnerabilityProfile, []string{dg}}, + dg, "panos_vulnerability_security_profile", + ) +} + +func (g *PanoramaObjectsGenerator) createWildfireAnalysisSecurityProfileResources(dg string) []terraformutils.Resource { + return g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Objects.WildfireAnalysisProfile, []string{dg}}, + dg, "panos_wildfire_analysis_security_profile", + ) +} +func (g *PanoramaObjectsGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + dg, err := g.client.(*pango.Panorama).Panorama.DeviceGroup.GetList() + if err != nil { + return err + } + + for _, v := range dg { + g.Resources = append(g.Resources, g.createAddressGroupResources(v)...) + g.Resources = append(g.Resources, g.createAdministrativeTagResources(v)...) + g.Resources = append(g.Resources, g.createApplicationGroupResources(v)...) + g.Resources = append(g.Resources, g.createApplicationObjectResources(v)...) + g.Resources = append(g.Resources, g.createEDLResources(v)...) + g.Resources = append(g.Resources, g.createLogForwardingResources(v)...) + g.Resources = append(g.Resources, g.createServiceGroupResources(v)...) + g.Resources = append(g.Resources, g.createServiceObjectResources(v)...) + g.Resources = append(g.Resources, g.createAddressObjectResources(v)...) + g.Resources = append(g.Resources, g.createAntiSpywareSecurityProfileResources(v)...) + g.Resources = append(g.Resources, g.createAntivirusSecurityProfileResources(v)...) + g.Resources = append(g.Resources, g.createCustomDataPatternObjectResources(v)...) + g.Resources = append(g.Resources, g.createDataFilteringSecurityProfileResources(v)...) + g.Resources = append(g.Resources, g.createDOSProtectionProfileResources(v)...) + g.Resources = append(g.Resources, g.createDynamicUserGroupResources(v)...) + g.Resources = append(g.Resources, g.createFileBlockingSecurityProfileResources(v)...) + g.Resources = append(g.Resources, g.createURLFilteringSecurityProfileResources(v)...) + g.Resources = append(g.Resources, g.createVulnerabilitySecurityProfileResources(v)...) + g.Resources = append(g.Resources, g.createWildfireAnalysisSecurityProfileResources(v)...) + } + + return nil +} + +func (g *PanoramaObjectsGenerator) PostConvertHook() error { + mapAddressObjectIDs := map[string]string{} + mapApplicationObjectIDs := map[string]string{} + mapServiceObjectIDs := map[string]string{} + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_address_object" { + mapAddressObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_application_object" { + mapApplicationObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + + if r.InstanceInfo.Type == "panos_panorama_service_object" { + mapServiceObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + } + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_panorama_address_group" { + if _, ok := r.Item["static_addresses"]; ok { + staticAddresses := make([]string, len(r.Item["static_addresses"].([]interface{}))) + for k, staticAddress := range r.Item["static_addresses"].([]interface{}) { + staticAddresses[k] = mapAddressObjectIDs[staticAddress.(string)] + } + + r.Item["static_addresses"] = staticAddresses + } + } + + if r.InstanceInfo.Type == "panos_panorama_application_group" { + if _, ok := r.Item["applications"]; ok { + applications := make([]string, len(r.Item["applications"].([]interface{}))) + for k, application := range r.Item["applications"].([]interface{}) { + if _, ok := mapApplicationObjectIDs[application.(string)]; ok { + applications[k] = mapApplicationObjectIDs[application.(string)] + continue + } + applications[k] = application.(string) + } + + r.Item["applications"] = applications + } + } + + if r.InstanceInfo.Type == "panos_panorama_service_group" { + services := make([]string, len(r.Item["services"].([]interface{}))) + for k, service := range r.Item["services"].([]interface{}) { + services[k] = mapServiceObjectIDs[service.(string)] + } + + r.Item["services"] = services + } + } + + return nil +} diff --git a/providers/panos/panorama_plugins.go b/providers/panos/panorama_plugins.go new file mode 100644 index 0000000000..0b8a694dd3 --- /dev/null +++ b/providers/panos/panorama_plugins.go @@ -0,0 +1,113 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" +) + +type PanoramaPluginsGenerator struct { + PanosService +} + +func (g *PanoramaPluginsGenerator) createGCPAccountResources() (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Panorama.GcpAccount.GetList() + if err != nil || len(l) == 0 { + return resources + } + + for _, r := range l { + resources = append(resources, terraformutils.NewSimpleResource( + r, + normalizeResourceName(r), + "panos_panorama_gcp_account", + "panos", + []string{}, + )) + } + + return resources +} + +func (g *PanoramaPluginsGenerator) createGKEClusterResources(group string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Panorama.GkeCluster.GetList(group) + if err != nil || len(l) == 0 { + return resources + } + + for _, r := range l { + id := group + ":" + r + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(id), + "panos_panorama_gke_cluster", + "panos", + []string{}, + )) + } + + return resources +} + +func (g *PanoramaPluginsGenerator) createGKEClusterGroupResources() (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Panorama.GkeClusterGroup.GetList() + if err != nil || len(l) == 0 { + return resources + } + + for _, r := range l { + resources = append(resources, terraformutils.NewSimpleResource( + r, + normalizeResourceName(r), + "panos_panorama_gke_cluster_group", + "panos", + []string{}, + )) + + resources = append(resources, g.createGKEClusterResources(r)...) + } + + return resources +} + +func (g *PanoramaPluginsGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + g.Resources = append(g.Resources, g.createGCPAccountResources()...) + g.Resources = append(g.Resources, g.createGKEClusterGroupResources()...) + + return nil +} + +func (g *PanoramaPluginsGenerator) PostConvertHook() error { + mapGKEClusterGroupNames := map[string]string{} + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_panorama_gke_cluster_group" { + mapGKEClusterGroupNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } + } + + for _, r := range g.Resources { + if r.InstanceInfo.Type == "panos_panorama_gke_cluster" { + r.Item["gke_cluster_group"] = mapGKEClusterGroupNames[r.Item["gke_cluster_group"].(string)] + } + } + + return nil +} diff --git a/providers/panos/panorama_policy.go b/providers/panos/panorama_policy.go new file mode 100644 index 0000000000..9af122be60 --- /dev/null +++ b/providers/panos/panorama_policy.go @@ -0,0 +1,192 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package panos + +import ( + "encoding/base64" + "strconv" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/PaloAltoNetworks/pango" + "github.com/PaloAltoNetworks/pango/util" +) + +type PanoramaPolicyGenerator struct { + PanosService +} + +func (g *PanoramaPolicyGenerator) createResourcesFromList(o getGeneric, terraformResourceName string) (resources []terraformutils.Resource) { + l, err := o.i.(getListWithTwoArgs).GetList(o.params[0], o.params[1]) + if err != nil || len(l) == 0 { + return []terraformutils.Resource{} + } + + var positionReference string + id := o.params[0] + ":" + o.params[1] + ":" + strconv.Itoa(util.MoveTop) + "::" + + for k, r := range l { + if k > 0 { + id = o.params[0] + ":" + o.params[1] + ":" + strconv.Itoa(util.MoveAfter) + ":" + positionReference + ":" + } + + id += base64.StdEncoding.EncodeToString([]byte(r)) + positionReference = r + + resources = append(resources, terraformutils.NewSimpleResource( + id, + normalizeResourceName(o.params[0]+":"+o.params[1]+":"+r), + terraformResourceName, + "panos", + []string{}, + )) + } + + return resources +} + +func (g *PanoramaPolicyGenerator) createNATRuleGroupResources(dg string) (resources []terraformutils.Resource) { + resources = append(resources, g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Policies.Nat, []string{dg, util.PreRulebase}}, + "panos_panorama_nat_rule_group")..., + ) + + resources = append(resources, g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Policies.Nat, []string{dg, util.Rulebase}}, + "panos_panorama_nat_rule_group")..., + ) + + resources = append(resources, g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Policies.Nat, []string{dg, util.PostRulebase}}, + "panos_panorama_nat_rule_group")..., + ) + + return resources +} + +func (g *PanoramaPolicyGenerator) createPBFRuleGroupResources(dg string) (resources []terraformutils.Resource) { + resources = append(resources, g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Policies.PolicyBasedForwarding, []string{dg, util.PreRulebase}}, + "panos_panorama_pbf_rule_group")..., + ) + + resources = append(resources, g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Policies.PolicyBasedForwarding, []string{dg, util.Rulebase}}, + "panos_panorama_pbf_rule_group")..., + ) + + resources = append(resources, g.createResourcesFromList( + getGeneric{g.client.(*pango.Panorama).Policies.PolicyBasedForwarding, []string{dg, util.PostRulebase}}, + "panos_panorama_pbf_rule_group")..., + ) + + return resources +} + +func (g *PanoramaPolicyGenerator) createSecurityRuleGroupRulebaseResources(dg, rulebase string) (resources []terraformutils.Resource) { + l, err := g.client.(*pango.Panorama).Policies.Security.GetList(dg, rulebase) + if err != nil || len(l) == 0 { + return []terraformutils.Resource{} + } + + var positionReference string + id := dg + ":" + rulebase + ":" + strconv.Itoa(util.MoveTop) + "::" + + for k, r := range l { + if k > 0 { + id = dg + ":" + rulebase + ":" + strconv.Itoa(util.MoveAfter) + ":" + positionReference + ":" + } + + id += base64.StdEncoding.EncodeToString([]byte(r)) + positionReference = r + + resources = append(resources, terraformutils.NewResource( + id, + normalizeResourceName(dg+":"+rulebase+":"+r), + "panos_panorama_security_rule_group", + "panos", + map[string]string{ + "device_group": dg, + "rulebase": rulebase, + "rule.#": "1", // Add just enough attributes to make the refresh work... + "rule.0.name": r, // Add just enough attributes to make the refresh work... + "rule.0.target.#": "0", // Add just enough attributes to make the refresh work... + }, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} + +func (g *PanoramaPolicyGenerator) createSecurityRuleGroupResources(dg string) (resources []terraformutils.Resource) { + resources = append(resources, g.createSecurityRuleGroupRulebaseResources(dg, util.PreRulebase)...) + resources = append(resources, g.createSecurityRuleGroupRulebaseResources(dg, util.Rulebase)...) + resources = append(resources, g.createSecurityRuleGroupRulebaseResources(dg, util.PostRulebase)...) + + return resources +} + +func (g *PanoramaPolicyGenerator) InitResources() error { + if err := g.Initialize(); err != nil { + return err + } + + dg, err := g.client.(*pango.Panorama).Panorama.DeviceGroup.GetList() + if err != nil { + return err + } + + for _, v := range dg { + g.Resources = append(g.Resources, g.createNATRuleGroupResources(v)...) + g.Resources = append(g.Resources, g.createPBFRuleGroupResources(v)...) + g.Resources = append(g.Resources, g.createSecurityRuleGroupResources(v)...) + } + + return nil +} + +func (g *PanoramaPolicyGenerator) PostConvertHook() error { + for _, res := range g.Resources { + if res.InstanceInfo.Type == "panos_panorama_nat_rule_group" { + for _, rule := range res.Item["rule"].([]interface{}) { + if _, ok := rule.(map[string]interface{})["translated_packet"]; ok { + a := rule.(map[string]interface{})["translated_packet"].([]interface{}) + for _, b := range a { + if _, okb := b.(map[string]interface{})["source"]; !okb { + b.(map[string]interface{})["source"] = make(map[string]interface{}) + } + } + + for _, b := range a { + if _, okb := b.(map[string]interface{})["destination"]; !okb { + b.(map[string]interface{})["destination"] = make(map[string]interface{}) + } + } + } + } + } + + if res.InstanceInfo.Type == "panos_panorama_security_rule_group" { + for _, rule := range res.Item["rule"].([]interface{}) { + if _, ok := rule.(map[string]interface{})["hip_profiles"]; !ok { + rule.(map[string]interface{})["hip_profiles"] = []string{"any"} + } + } + } + } + + return nil +} diff --git a/providers/panos/panos_provider.go b/providers/panos/panos_provider.go index 7d91de8f69..3aa0b7ef66 100644 --- a/providers/panos/panos_provider.go +++ b/providers/panos/panos_provider.go @@ -68,10 +68,15 @@ func (p *PanosProvider) InitService(serviceName string, verbose bool) error { func (p *PanosProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "device_config": &DeviceConfigGenerator{}, - "firewall_networking": &FirewallNetworkingGenerator{}, - "firewall_objects": &FirewallObjectsGenerator{}, - "firewall_policy": &FirewallPolicyGenerator{}, + "firewall_device_config": &FirewallDeviceConfigGenerator{}, + "firewall_networking": &FirewallNetworkingGenerator{}, + "firewall_objects": &FirewallObjectsGenerator{}, + "firewall_policy": &FirewallPolicyGenerator{}, + "panorama_device_config": &PanoramaDeviceConfigGenerator{}, + "panorama_networking": &PanoramaNetworkingGenerator{}, + "panorama_objects": &PanoramaObjectsGenerator{}, + "panorama_plugins": &PanoramaPluginsGenerator{}, + "panorama_policy": &PanoramaPolicyGenerator{}, } } diff --git a/providers/panos/panos_service.go b/providers/panos/panos_service.go index cef572f8df..fa2bd3a81e 100644 --- a/providers/panos/panos_service.go +++ b/providers/panos/panos_service.go @@ -16,12 +16,11 @@ package panos import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/PaloAltoNetworks/pango" ) type PanosService struct { //nolint terraformutils.Service - client *pango.Firewall + client interface{} vsys string } From 18c01cdd93c641720fc9869475a2c06a9569c35d Mon Sep 17 00:00:00 2001 From: Noi Narisak Date: Sat, 14 Aug 2021 16:06:41 -0500 Subject: [PATCH 214/276] Add more okta resource (#1007) * Add more okta resource * Add okta_network_zone * Add okta_factor * Fix golangci-lint issues * Clean up uncommented code --- docs/okta.md | 23 +++++---- providers/okta/factor.go | 82 ++++++++++++++++++++++++++++++ providers/okta/network_zone.go | 89 +++++++++++++++++++++++++++++++++ providers/okta/okta_provider.go | 2 + 4 files changed, 186 insertions(+), 10 deletions(-) create mode 100644 providers/okta/factor.go create mode 100644 providers/okta/network_zone.go diff --git a/docs/okta.md b/docs/okta.md index 25b697e13e..3a5cce3c13 100644 --- a/docs/okta.md +++ b/docs/okta.md @@ -6,35 +6,38 @@ Example: $ export OKTA_ORG_NAME= $ export OKTA_BASE_URL= $ export OKTA_API_TOKEN= -$ terraformer import okta --resources=user,group +$ terraformer import okta --resources=okta_user,okta_group ``` List of supported Okta services: * `user` * `okta_user` -* `user_type` +* `user_type` + * `okta_user_type` * `group` * `okta_group` * `policy` * `okta_policy_password` * `okta_policy_rule_password` * `okta_policy_mfa` - * `okta_policy_rule_mfa` + * `okta_policy_rule_mfa` * `okta_policy_signon` - * `okta_policy_rule_signon` + * `okta_policy_rule_signon` * `authorization_server` * `okta_auth_server` * `okta_auth_server_scope` * `okta_auth_server_claim` * `okta_auth_server_policy` * `event_hook` +* * `okta_event_hook` +* `factor` + * `okta_factor` * `inline_hook` +* * `okta_inline_hook` +* `network_zone` + * `okta_network_zone` * `template_sms` + * `okta_template_sms` * `trusted_origin` - - - - - - + * `okta_trusted_orgin` diff --git a/providers/okta/factor.go b/providers/okta/factor.go new file mode 100644 index 0000000000..5aad0e42b8 --- /dev/null +++ b/providers/okta/factor.go @@ -0,0 +1,82 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + + "github.com/okta/terraform-provider-okta/sdk" +) + +type FactorGenerator struct { + OktaService +} + +func (g FactorGenerator) createResources(factorList []*sdk.Factor) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, factor := range factorList { + if factor.Status == "ACTIVE" { + resources = append(resources, terraformutils.NewResource( + factor.Id, + factor.Id, + "okta_factor", + "okta", + map[string]string{ + "provider_id": factor.Id, + }, + []string{}, + map[string]interface{}{}, + )) + + } + } + return resources +} + +func (g *FactorGenerator) InitResources() error { + var factors = []*sdk.Factor{} + + ctx, client, err := g.APISupplementClient() + if err != nil { + return err + } + + output, _, err := getListFactors(ctx, client) + if err != nil { + return err + } + factors = append(factors, output...) + + g.Resources = g.createResources(factors) + return nil +} + +func getListFactors(ctx context.Context, m *sdk.ApiSupplement) ([]*sdk.Factor, *okta.Response, error) { + //NOTE: Okta SDK does not support general ListFactors method so we got to manually implement the REST calls. + url := "/api/v1/org/factors" + req, err := m.RequestExecutor.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + var factors []*sdk.Factor + resp, err := m.RequestExecutor.Do(ctx, req, &factors) + if err != nil { + return nil, resp, err + } + return factors, resp, nil +} diff --git a/providers/okta/network_zone.go b/providers/okta/network_zone.go new file mode 100644 index 0000000000..72b7429e62 --- /dev/null +++ b/providers/okta/network_zone.go @@ -0,0 +1,89 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + + "github.com/okta/terraform-provider-okta/sdk" +) + +type NetworkZoneGenerator struct { + OktaService +} + +func (g NetworkZoneGenerator) createResources(networkZoneList []*sdk.NetworkZone) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, networkZone := range networkZoneList { + + resources = append(resources, terraformutils.NewResource( + networkZone.ID, + networkZone.Name, + "okta_network_zone", + "okta", + map[string]string{ + "name": networkZone.Name, + "type": networkZone.Type, + }, + []string{}, + attributesNetworkZone(networkZone), + )) + } + return resources +} + +func (g *NetworkZoneGenerator) InitResources() error { + ctx, client, err := g.APISupplementClient() + if err != nil { + return err + } + + output, resp, err := client.ListNetworkZones(ctx) + if err != nil { + return err + } + + for resp.HasNextPage() { + var networkZoneSet []*sdk.NetworkZone + resp, _ = resp.Next(ctx, &networkZoneSet) + output = append(output, networkZoneSet...) + } + + g.Resources = g.createResources(output) + return nil +} + +func attributesNetworkZone(networkZone *sdk.NetworkZone) map[string]interface{} { + attributes := map[string]interface{}{} + attributes["usage"] = networkZone.Usage + + if networkZone.Type == "DYNAMIC" { + if networkZone.Locations != nil { + attributes["dynamic_locations"] = networkZone.Locations + } + } else if networkZone.Type == "IP" { + switch { + case networkZone.Proxies != nil && networkZone.Gateways != nil: + attributes["proxies"] = networkZone.Proxies + attributes["gateways"] = networkZone.Gateways + case networkZone.Proxies != nil && networkZone.Gateways == nil: + attributes["proxies"] = networkZone.Proxies + case networkZone.Proxies == nil && networkZone.Gateways != nil: + attributes["gateways"] = networkZone.Gateways + } + } + + return attributes +} diff --git a/providers/okta/okta_provider.go b/providers/okta/okta_provider.go index 269bd1c798..dbcba32046 100644 --- a/providers/okta/okta_provider.go +++ b/providers/okta/okta_provider.go @@ -90,6 +90,8 @@ func (p *OktaProvider) InitService(serviceName string, verbose bool) error { func (p *OktaProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ + "okta_factor": &FactorGenerator{}, + "okta_network_zone": &NetworkZoneGenerator{}, "okta_trusted_origin": &TrustedOriginGenerator{}, "okta_user": &UserGenerator{}, "okta_template_sms": &SMSTemplateGenerator{}, From 8e7044ab59caa83e79bcc2332003ecdfd4a005b2 Mon Sep 17 00:00:00 2001 From: rui Date: Tue, 17 Aug 2021 06:54:49 -0400 Subject: [PATCH 215/276] build: bump to use go1.17 (#1014) Signed-off-by: Rui Chen --- .github/workflows/release.yaml | 4 +- .github/workflows/test.yml | 2 +- go.mod | 150 ++++++++++++++++++++++++++++++++- 3 files changed, 152 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1bf4669159..21c8e28ae1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,5 @@ name: "tagged-release" -on: +on: workflow_dispatch: inputs: version: @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Test run: go build -v && go test ./... - name: Build for linux diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e637f55edd..6fa5a0298f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,6 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Test run: go build -v && go test ./... diff --git a/go.mod b/go.mod index b6e13f743a..06704b534c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/terraformer -go 1.16 +go 1.17 require ( cloud.google.com/go v0.77.0 @@ -166,4 +166,152 @@ require ( k8s.io/client-go v0.21.0 ) +require ( + github.com/Azure/azure-pipeline-go v0.2.2 // indirect + github.com/Azure/go-autorest v14.2.0+incompatible // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.5 // indirect + github.com/Azure/go-autorest/autorest/azure/cli v0.2.0 // indirect + github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect + github.com/Azure/go-autorest/logger v0.2.0 // indirect + github.com/Azure/go-autorest/tracing v0.6.0 // indirect + github.com/BurntSushi/toml v0.3.1 // indirect + github.com/Masterminds/goutils v1.1.0 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Masterminds/sprig v2.22.0+incompatible // indirect + github.com/agext/levenshtein v1.2.2 // indirect + github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 // indirect + github.com/apparentlymart/go-cidr v1.1.0 // indirect + github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc // indirect + github.com/armon/go-radix v1.0.0 // indirect + github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect + github.com/aws/aws-sdk-go v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 // indirect + github.com/aws/smithy-go v1.4.0 // indirect + github.com/beevik/etree v1.1.0 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/blang/semver v3.5.1+incompatible // indirect + github.com/bmatcuk/doublestar v1.1.5 // indirect + github.com/cenkalti/backoff/v4 v4.1.1 // indirect + github.com/crewjam/saml v0.4.5 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dghubble/sling v1.1.0 // indirect + github.com/dimchansky/utfbom v1.1.0 // indirect + github.com/docker/go-units v0.4.0 // indirect + github.com/fatih/color v1.7.0 // indirect + github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/go-logr/logr v0.4.0 // indirect + github.com/go-openapi/errors v0.19.8 // indirect + github.com/go-openapi/strfmt v0.20.0 // indirect + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect + github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 // indirect + github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.5.0 // indirect + github.com/golang/snappy v0.0.3 // indirect + github.com/google/go-cmp v0.5.6 // indirect + github.com/google/go-querystring v1.0.0 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/google/jsonapi v0.0.0-20201022225600-f822737867f6 // indirect + github.com/google/uuid v1.2.0 // indirect + github.com/googleapis/gax-go/v2 v2.0.5 // indirect + github.com/googleapis/gnostic v0.4.1 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-getter v1.5.3 // indirect + github.com/hashicorp/go-multierror v1.0.0 // indirect + github.com/hashicorp/go-retryablehttp v0.7.0 // indirect + github.com/hashicorp/go-rootcerts v1.0.0 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-sockaddr v1.0.0 // indirect + github.com/hashicorp/go-uuid v1.0.1 // indirect + github.com/hashicorp/go-version v1.3.0 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/hcl/v2 v2.8.2 // indirect + github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 // indirect + github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/huandu/xstrings v1.3.2 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jonboulle/clockwork v0.2.1 // indirect + github.com/json-iterator/go v1.1.10 // indirect + github.com/jstemmer/go-junit-report v0.9.1 // indirect + github.com/kelseyhightower/envconfig v1.4.0 // indirect + github.com/klauspost/compress v1.11.2 // indirect + github.com/leodido/go-urn v1.2.0 // indirect + github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e // indirect + github.com/mattn/go-colorable v0.1.4 // indirect + github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d // indirect + github.com/mattn/go-isatty v0.0.10 // indirect + github.com/mitchellh/cli v1.1.2 // indirect + github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-testing-interface v1.0.4 // indirect + github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/mitchellh/hashstructure v1.0.0 // indirect + github.com/mitchellh/mapstructure v1.3.3 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/mozillazg/go-httpheader v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 // indirect + github.com/pborman/uuid v1.2.0 // indirect + github.com/pelletier/go-toml v1.7.0 // indirect + github.com/posener/complete v1.2.1 // indirect + github.com/russellhaering/goxmldsig v1.1.0 // indirect + github.com/satori/go.uuid v1.2.0 // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect + github.com/ulikunitz/xz v0.5.8 // indirect + github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect + github.com/vmihailenco/tagparser v0.1.1 // indirect + github.com/zclconf/go-cty-yaml v1.0.2 // indirect + go.mongodb.org/mongo-driver v1.4.3 // indirect + go.opencensus.io v0.22.5 // indirect + golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect + golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect + golang.org/x/mod v0.4.1 // indirect + golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect + golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect + golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect + golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect + golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect + golang.org/x/tools v0.1.0 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/grpc v1.35.0 // indirect + google.golang.org/protobuf v1.26.0 // indirect + gopkg.in/go-playground/assert.v1 v1.2.1 // indirect + gopkg.in/go-playground/validator.v9 v9.31.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/square/go-jose.v2 v2.5.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + k8s.io/api v0.21.0 // indirect + k8s.io/klog/v2 v2.8.0 // indirect + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.1.0 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect +) + replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5 From 4998446bec111fe56ec3de1324a11f9eb75b11a8 Mon Sep 17 00:00:00 2001 From: umarali-nagoor <55839118+umarali-nagoor@users.noreply.github.com> Date: Tue, 17 Aug 2021 18:41:04 +0530 Subject: [PATCH 216/276] Terraformer support for IAM serviceID, servicePolicy, AuthPolicy and CustomRole (#997) --- go.mod | 2 + go.sum | 16 ++++ providers/ibm/iam.go | 162 ++++++++++++++++++++++++++++++++++++++++- providers/ibm/utils.go | 14 ++++ 4 files changed, 193 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 06704b534c..006e7c211f 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/IBM/ibm-cos-sdk-go v1.5.0 github.com/IBM/keyprotect-go-client v0.6.0 github.com/IBM/networking-go-sdk v0.13.0 + github.com/IBM/platform-services-go-sdk v0.19.1 github.com/IBM/vpc-go-sdk v0.4.1 github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/OctopusDeploy/go-octopusdeploy v1.6.0 @@ -151,6 +152,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible github.com/tencentyun/cos-go-sdk-v5 v0.7.19 github.com/vultr/govultr v0.5.0 + github.com/xdg-go/scram v1.0.2 // indirect github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 github.com/zclconf/go-cty v1.8.4 diff --git a/go.sum b/go.sum index c213e26f6e..8695db7ede 100644 --- a/go.sum +++ b/go.sum @@ -105,12 +105,16 @@ github.com/IBM/go-sdk-core/v3 v3.3.1/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QC github.com/IBM/go-sdk-core/v4 v4.5.1/go.mod h1:lTUXbqIX6/aAbSCkP6q59+dyFsTwZAc0ewRS2vJWVbg= github.com/IBM/go-sdk-core/v4 v4.9.0 h1:OkSg5kaEfVoNuBA4IsIOz8Ur5rbGHbWxmWCZ7nK/oc0= github.com/IBM/go-sdk-core/v4 v4.9.0/go.mod h1:DbQ+3pFoIjxGGTEiA9zQ2V0cemMNmFMkLBBnR729HKg= +github.com/IBM/go-sdk-core/v5 v5.5.1 h1:Hb4xB1BL8L6uCnskIqSCxF9wLfOmj4+sVzM5vFtuhs4= +github.com/IBM/go-sdk-core/v5 v5.5.1/go.mod h1:Sn+z+qTDREQvCr+UFa22TqqfXNxx3o723y8GsfLV8e0= github.com/IBM/ibm-cos-sdk-go v1.5.0 h1:YCmAgsdtp/irQep5g+62OvjLNj35tMXLqTC5jQ+YjWo= github.com/IBM/ibm-cos-sdk-go v1.5.0/go.mod h1:4mqv/ejW1PKW+Ij6ytU+W8j1UZeLmSEsR5K+flBaWMY= github.com/IBM/keyprotect-go-client v0.6.0 h1:jZExoYSaoQ5TrfEzPOmBLc1vJ0VWA0RfKC+Bx39IeGo= github.com/IBM/keyprotect-go-client v0.6.0/go.mod h1:SVr2ylV/fhSQPDiUjWirN9fsyWFCNNbt8GIT8hPJVjE= github.com/IBM/networking-go-sdk v0.13.0 h1:MKDL0c5Gnc6BT10lCS1S1pZVz71UmX4mJC4eXQqWwHE= github.com/IBM/networking-go-sdk v0.13.0/go.mod h1:3/QnBTwCXAWoz98dw3z37UUfpkIwAwi8qDGntNt6F6A= +github.com/IBM/platform-services-go-sdk v0.19.1 h1:RDxIHiqmxQWSYrJGm4oGSvvbKg4TXY1ox53ORsX6zvE= +github.com/IBM/platform-services-go-sdk v0.19.1/go.mod h1:2pH+yjJTvL4l5Plp+uig5+U0QGwQfbBnAqu6XGPblMQ= github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/Jeffail/gabs/v2 v2.1.0 h1:6dV9GGOjoQgzWTQEltZPXlJdFloxvIq7DwqgxMCbq30= @@ -531,6 +535,8 @@ github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= +github.com/go-openapi/strfmt v0.20.1 h1:1VgxvehFne1mbChGeCmZ5pc0LxUf6yaACVSIYAR91Xc= +github.com/go-openapi/strfmt v0.20.1/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= @@ -1020,6 +1026,7 @@ github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/okta/okta-sdk-golang/v2 v2.3.1-0.20210617075430-6c6c25f48f92/go.mod h1:G4GCqqnZJCt91zMqYhDMLhg2INVbjiiFKkQ2mnia1J0= github.com/okta/okta-sdk-golang/v2 v2.3.1 h1:p50F8BuTyKH0yRIR58UU8a7AQ9rm7D1flqbyb+9msrk= @@ -1205,6 +1212,12 @@ github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -1215,6 +1228,7 @@ github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 h1:ujojfQ github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 h1:llDpCOEwliajLr8eXtLPIVW0hzat4ETTakiCI+z/c6k= github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13/go.mod h1:LEdAMqa1v/7KYe4b13ALLkonuDxLph57ibUb50ctvJk= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1238,6 +1252,8 @@ go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= +go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= diff --git a/providers/ibm/iam.go b/providers/ibm/iam.go index f6a849521f..c9f0525246 100644 --- a/providers/ibm/iam.go +++ b/providers/ibm/iam.go @@ -25,6 +25,9 @@ import ( "github.com/IBM-Cloud/bluemix-go/api/iamuum/iamuumv2" "github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2" "github.com/IBM-Cloud/bluemix-go/session" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/platform-services-go-sdk/iamidentityv1" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" ) type IAMGenerator struct { @@ -51,6 +54,50 @@ func (g IAMGenerator) loadAccessGroups(grpID string) terraformutils.Resource { return resources } +func (g IAMGenerator) loadServiceIDs(serviceID string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + serviceID, + serviceID, + "ibm_iam_service_id", + "ibm", + []string{}) + return resources +} + +func (g IAMGenerator) loadAuthPolicies(policyID string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + policyID, + policyID, + "ibm_iam_authorization_policy", + "ibm", + []string{}) + return resources +} + +func (g IAMGenerator) loadCustomRoles(roleID string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + roleID, + roleID, + "ibm_iam_custom_role", + "ibm", + []string{}) + return resources +} + +func (g IAMGenerator) loadServicePolicies(serviceID, policyID string, dependsOn []string) terraformutils.Resource { + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", serviceID, policyID), + policyID, + "ibm_iam_service_policy", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + func (g IAMGenerator) loadAccessGroupMembers(grpID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, grpID), @@ -131,6 +178,7 @@ func (g *IAMGenerator) InitResources() error { } for _, u := range users.Resources { + // User policies policies, err := iampap.V1Policy().List(iampapv1.SearchParams{ AccountID: accountID, IAMID: u.IamID, @@ -142,7 +190,6 @@ func (g *IAMGenerator) InitResources() error { for _, p := range policies { g.Resources = append(g.Resources, g.loadUserPolicies(p.ID, u.Email)) } - } iamuumClient, err := iamuumv2.New(sess) @@ -182,5 +229,118 @@ func (g *IAMGenerator) InitResources() error { } } + // service id and service policy + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + return fmt.Errorf("no API key set") + } + + iamIDurl := "https://iam.cloud.ibm.com" + iamOptions := &iamidentityv1.IamIdentityV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamIDurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + + iamPolicyOptions := &iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamIDurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + + iamIDClient, err := iamidentityv1.NewIamIdentityV1(iamOptions) + if err != nil { + return err + } + + iamPolicyClient, err := iampolicymanagementv1.NewIamPolicyManagementV1(iamPolicyOptions) + if err != nil { + return err + } + + start := "" + allrecs := []iamidentityv1.ServiceID{} + var pg int64 = 100 + + for { + listServiceIDOptions := iamidentityv1.ListServiceIdsOptions{ + AccountID: &accountID, + Pagesize: &pg, + } + if start != "" { + listServiceIDOptions.Pagetoken = &start + } + + serviceIDs, resp, err := iamIDClient.ListServiceIds(&listServiceIDOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error listing Service Ids %s %s", err, resp) + } + start = GetNextIAM(serviceIDs.Next) + allrecs = append(allrecs, serviceIDs.Serviceids...) + if start == "" { + break + } + } + + // loop through all service IDs and fetch policies correspponds to each service ID + for _, service := range allrecs { + g.Resources = append(g.Resources, g.loadServiceIDs(*service.ID)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_iam_service_id."+terraformutils.TfSanitize(*service.ID)) + + listServicePolicyOptions := iampolicymanagementv1.ListPoliciesOptions{ + AccountID: core.StringPtr(accountID), + IamID: core.StringPtr(*service.IamID), + Type: core.StringPtr("access"), + } + + policyList, _, err := iamPolicyClient.ListPolicies(&listServicePolicyOptions) + policies := policyList.Policies + + if err != nil { + return fmt.Errorf("error retrieving service policy: %s", err) + } + + for _, p := range policies { + g.Resources = append(g.Resources, g.loadServicePolicies(*service.ID, *p.ID, dependsOn)) + } + } + + // Authorization policy + listAuthPolicyOptions := iampolicymanagementv1.ListPoliciesOptions{ + AccountID: core.StringPtr(accountID), + Type: core.StringPtr("authorization"), + } + + authPolicyList, _, err := iamPolicyClient.ListPolicies(&listAuthPolicyOptions) + authPolicies := authPolicyList.Policies + + if err != nil { + return fmt.Errorf("error retrieving authorization policy: %s", err) + } + + for _, ap := range authPolicies { + g.Resources = append(g.Resources, g.loadAuthPolicies(*ap.ID)) + } + + // Custom role + listCustomRoleOptions := iampolicymanagementv1.ListRolesOptions{ + AccountID: core.StringPtr(accountID), + } + + rolesList, _, err := iamPolicyClient.ListRoles(&listCustomRoleOptions) + customRoles := rolesList.CustomRoles + + if err != nil { + return fmt.Errorf("error retrieving custom roles: %s", err) + } + + for _, r := range customRoles { + g.Resources = append(g.Resources, g.loadCustomRoles(*r.ID)) + } + return nil } diff --git a/providers/ibm/utils.go b/providers/ibm/utils.go index ebb2caa3d9..795e664f6a 100644 --- a/providers/ibm/utils.go +++ b/providers/ibm/utils.go @@ -123,3 +123,17 @@ func GetNext(next interface{}) string { q := u.Query() return q.Get("start") } + +// GetNextIAM ... +func GetNextIAM(next interface{}) string { + if reflect.ValueOf(next).IsNil() { + return "" + } + + u, err := url.Parse(reflect.ValueOf(next).Elem().String()) + if err != nil { + return "" + } + q := u.Query() + return q.Get("pagetoken") +} From f0635e1d33d99d561523d1115a31d5a9410a2187 Mon Sep 17 00:00:00 2001 From: Noi Narisak Date: Tue, 17 Aug 2021 19:29:20 -0500 Subject: [PATCH 217/276] Bump okta-sdk-golang to v2.6.1 (#1016) * Bump okta-sdk-golang to v2.6.1 * Update go.mod * Fix new reference releted ListAuthorizationServerPolicies() function * Fix unit test related dependencies --- go.mod | 11 ++++++----- go.sum | 13 +++++-------- providers/okta/authorization_server_policy.go | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 006e7c211f..3fb8ec7639 100644 --- a/go.mod +++ b/go.mod @@ -138,7 +138,7 @@ require ( github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/nicksnyder/go-i18n v1.10.1 // indirect github.com/ns1/ns1-go v2.4.0+incompatible - github.com/okta/okta-sdk-golang/v2 v2.3.1 + github.com/okta/okta-sdk-golang/v2 v2.6.1 github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9 github.com/opencontainers/image-spec v1.0.1 // indirect github.com/opencontainers/runc v1.0.1 // indirect @@ -152,7 +152,6 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible github.com/tencentyun/cos-go-sdk-v5 v0.7.19 github.com/vultr/govultr v0.5.0 - github.com/xdg-go/scram v1.0.2 // indirect github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 github.com/zclconf/go-cty v1.8.4 @@ -179,6 +178,7 @@ require ( github.com/Azure/go-autorest/logger v0.2.0 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/BurntSushi/toml v0.3.1 // indirect + github.com/IBM/go-sdk-core/v5 v5.5.1 // indirect github.com/Masterminds/goutils v1.1.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/sprig v2.22.0+incompatible // indirect @@ -213,7 +213,7 @@ require ( github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/logr v0.4.0 // indirect github.com/go-openapi/errors v0.19.8 // indirect - github.com/go-openapi/strfmt v0.20.0 // indirect + github.com/go-openapi/strfmt v0.20.1 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 // indirect @@ -272,6 +272,7 @@ require ( github.com/modern-go/reflect2 v1.0.1 // indirect github.com/mozillazg/go-httpheader v0.2.1 // indirect github.com/oklog/run v1.0.0 // indirect + github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 // indirect github.com/pborman/uuid v1.2.0 // indirect @@ -287,9 +288,9 @@ require ( github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect github.com/zclconf/go-cty-yaml v1.0.2 // indirect - go.mongodb.org/mongo-driver v1.4.3 // indirect + go.mongodb.org/mongo-driver v1.5.1 // indirect go.opencensus.io v0.22.5 // indirect - golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect + golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/mod v0.4.1 // indirect golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect diff --git a/go.sum b/go.sum index 8695db7ede..20efad0e14 100644 --- a/go.sum +++ b/go.sum @@ -533,7 +533,6 @@ github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8 github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= -github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/strfmt v0.20.1 h1:1VgxvehFne1mbChGeCmZ5pc0LxUf6yaACVSIYAR91Xc= github.com/go-openapi/strfmt v0.20.1/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= @@ -1029,8 +1028,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/okta/okta-sdk-golang/v2 v2.3.1-0.20210617075430-6c6c25f48f92/go.mod h1:G4GCqqnZJCt91zMqYhDMLhg2INVbjiiFKkQ2mnia1J0= -github.com/okta/okta-sdk-golang/v2 v2.3.1 h1:p50F8BuTyKH0yRIR58UU8a7AQ9rm7D1flqbyb+9msrk= -github.com/okta/okta-sdk-golang/v2 v2.3.1/go.mod h1:G4GCqqnZJCt91zMqYhDMLhg2INVbjiiFKkQ2mnia1J0= +github.com/okta/okta-sdk-golang/v2 v2.6.1 h1:r0C6Z+WXuBIUv3/lq6wDGqoZBAcrNNCSoixB/BhLONo= +github.com/okta/okta-sdk-golang/v2 v2.6.1/go.mod h1:0y8stgdplWMjaEbMr4mVtw0R+BdktpGZRw2sWKZWsMs= github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9 h1:gC6OakV7GUVaTKm3KMpqVe9LOQfflzePtFsVDUbCPgo= github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9/go.mod h1:G6kMVF+QIjldN0X6s1U8MAcHNOWwdwJiMWmeCyotCJc= github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M= @@ -1212,11 +1211,8 @@ github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= @@ -1250,7 +1246,6 @@ github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= @@ -1292,8 +1287,9 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1477,6 +1473,7 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= diff --git a/providers/okta/authorization_server_policy.go b/providers/okta/authorization_server_policy.go index 62077674f6..9586b1dd47 100644 --- a/providers/okta/authorization_server_policy.go +++ b/providers/okta/authorization_server_policy.go @@ -23,7 +23,7 @@ type AuthorizationServerPolicyGenerator struct { OktaService } -func (g AuthorizationServerPolicyGenerator) createResources(authorizationServerPolicyList []*okta.Policy, authorizationServerID string, authorizationServerName string) []terraformutils.Resource { +func (g AuthorizationServerPolicyGenerator) createResources(authorizationServerPolicyList []*okta.AuthorizationServerPolicy, authorizationServerID string, authorizationServerName string) []terraformutils.Resource { var resources []terraformutils.Resource for _, authorizationServerPolicy := range authorizationServerPolicyList { From e8190b7ba270922514fc4271064a123cff981d07 Mon Sep 17 00:00:00 2001 From: Noi Narisak Date: Mon, 23 Aug 2021 17:09:03 -0500 Subject: [PATCH 218/276] Add okta idp resources (#1017) * Add okta_idp_oidc * Add okta_idp_saml * Add okta_idp_social --- docs/okta.md | 4 ++ providers/okta/idp_oidc.go | 72 +++++++++++++++++++++++++++++ providers/okta/idp_saml.go | 75 +++++++++++++++++++++++++++++++ providers/okta/idp_social.go | 80 +++++++++++++++++++++++++++++++++ providers/okta/okta_provider.go | 3 ++ 5 files changed, 234 insertions(+) create mode 100644 providers/okta/idp_oidc.go create mode 100644 providers/okta/idp_saml.go create mode 100644 providers/okta/idp_social.go diff --git a/docs/okta.md b/docs/okta.md index 3a5cce3c13..4a63d4d473 100644 --- a/docs/okta.md +++ b/docs/okta.md @@ -35,6 +35,10 @@ List of supported Okta services: * `okta_factor` * `inline_hook` * * `okta_inline_hook` +* `idp` + * `okta_idp_oidc` + * `okta_idp_saml` + * `okta_idp_social` * `network_zone` * `okta_network_zone` * `template_sms` diff --git a/providers/okta/idp_oidc.go b/providers/okta/idp_oidc.go new file mode 100644 index 0000000000..45e9f9e2c0 --- /dev/null +++ b/providers/okta/idp_oidc.go @@ -0,0 +1,72 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/okta-sdk-golang/v2/okta/query" +) + +type IdpOIDCGenerator struct { + OktaService +} + +func (g IdpOIDCGenerator) createResources(idpOIDCList []*okta.IdentityProvider) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, idp := range idpOIDCList { + resources = append(resources, terraformutils.NewSimpleResource( + idp.Id, + "idp_"+normalizeResourceName(idp.Type+"_"+idp.Name), + "okta_idp_oidc", + "okta", + []string{})) + + } + return resources +} + +func (g *IdpOIDCGenerator) InitResources() error { + ctx, client, err := g.Client() + if err != nil { + return err + } + + identityProviders, err := getIdpOIDC(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(identityProviders) + return nil +} + +func getIdpOIDC(ctx context.Context, client *okta.Client) ([]*okta.IdentityProvider, error) { + qp := &query.Params{Type: "OIDC", Limit: 1} + output, resp, err := client.IdentityProvider.ListIdentityProviders(ctx, qp) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextIdpOIDCSet []*okta.IdentityProvider + resp, _ = resp.Next(ctx, &nextIdpOIDCSet) + output = append(output, nextIdpOIDCSet...) + } + + return output, nil +} diff --git a/providers/okta/idp_saml.go b/providers/okta/idp_saml.go new file mode 100644 index 0000000000..c344c08ebc --- /dev/null +++ b/providers/okta/idp_saml.go @@ -0,0 +1,75 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/okta-sdk-golang/v2/okta/query" +) + +type IdpSAMLGenerator struct { + OktaService +} + +func (g IdpSAMLGenerator) createResources(idpSAMLList []*okta.IdentityProvider) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, idp := range idpSAMLList { + resources = append(resources, terraformutils.NewSimpleResource( + idp.Id, + "idp_"+normalizeResourceName(idp.Type+"_"+idp.Name), + "okta_idp_saml", + "okta", + []string{})) + + } + return resources +} + +func (g *IdpSAMLGenerator) InitResources() error { + ctx, client, err := g.Client() + if err != nil { + return err + } + + identityProviders, err := getIdpSAML(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(identityProviders) + return nil +} + +func getIdpSAML(ctx context.Context, client *okta.Client) ([]*okta.IdentityProvider, error) { + qp := &query.Params{Type: "SAML2", Limit: 1} + output, resp, err := client.IdentityProvider.ListIdentityProviders(ctx, qp) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextIdpSAMLSet []*okta.IdentityProvider + resp, err = resp.Next(ctx, &nextIdpSAMLSet) + if err != nil { + return nil, err + } + output = append(output, nextIdpSAMLSet...) + } + + return output, nil +} diff --git a/providers/okta/idp_social.go b/providers/okta/idp_social.go new file mode 100644 index 0000000000..13b5d827ad --- /dev/null +++ b/providers/okta/idp_social.go @@ -0,0 +1,80 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" + "github.com/okta/okta-sdk-golang/v2/okta/query" +) + +type IdpSocialGenerator struct { + OktaService +} + +func (g IdpSocialGenerator) createResources(idpSocialList []*okta.IdentityProvider) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, idp := range idpSocialList { + resources = append(resources, terraformutils.NewSimpleResource( + idp.Id, + "idp_"+normalizeResourceName(idp.Type+"_"+idp.Name), + "okta_idp_social", + "okta", + []string{})) + + } + return resources +} + +// Generate Terraform Resources from Okta API, +func (g *IdpSocialGenerator) InitResources() error { + ctx, client, err := g.Client() + if err != nil { + return err + } + + identityProviders, err := getIdpSocials(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(identityProviders) + return nil +} + +func getIdpSocials(ctx context.Context, client *okta.Client) ([]*okta.IdentityProvider, error) { + idpSocialTypes := []string{"APPLE", "FACEBOOK", "GOOGLE", "LINKEDIN", "MICROSOFT"} + var allIDPSocials []*okta.IdentityProvider + + for _, idpSocialType := range idpSocialTypes { + qp := &query.Params{Type: idpSocialType, Limit: 1} + output, resp, err := client.IdentityProvider.ListIdentityProviders(ctx, qp) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextIdpSocialSet []*okta.IdentityProvider + resp, _ = resp.Next(ctx, &nextIdpSocialSet) + output = append(output, nextIdpSocialSet...) + } + + allIDPSocials = append(allIDPSocials, output...) + } + + return allIDPSocials, nil +} diff --git a/providers/okta/okta_provider.go b/providers/okta/okta_provider.go index dbcba32046..dbc3005c07 100644 --- a/providers/okta/okta_provider.go +++ b/providers/okta/okta_provider.go @@ -90,6 +90,9 @@ func (p *OktaProvider) InitService(serviceName string, verbose bool) error { func (p *OktaProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ + "okta_idp_oidc": &IdpOIDCGenerator{}, + "okta_idp_saml": &IdpSAMLGenerator{}, + "okta_idp_social": &IdpSocialGenerator{}, "okta_factor": &FactorGenerator{}, "okta_network_zone": &NetworkZoneGenerator{}, "okta_trusted_origin": &TrustedOriginGenerator{}, From 27e08aadbe67ebffea502e40690f7c921150dd42 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Thu, 26 Aug 2021 11:13:02 +0300 Subject: [PATCH 219/276] Update version.go (#1026) --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index a7c7e0023c..41fd486476 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.15" +const version = "v0.8.16" var versionCmd = &cobra.Command{ Use: "version", From cd8a7a3f9bc62a16b7d9ade02fa82539709798b9 Mon Sep 17 00:00:00 2001 From: Le Duc Duy Date: Fri, 27 Aug 2021 18:11:49 +0700 Subject: [PATCH 220/276] Add gitlab provider (#1006) * Add import gitlab_project * Heredoc for project variable and ignore `mirror` fields in projects * Be more specific in the IgnoreKeys * Disable heredoc * Add project's BranchProtections TagProtections ProjectMembership * Add group's GroupVariables GroupMembership * Add docs * Update docs * Remove invalid test * Fix golangci-lint * Fix golangci-lint --- README.md | 1 + cmd/provider_cmd_gitlab.go | 58 ++++++++ cmd/root.go | 2 + docs/gitlab.md | 20 +++ go.mod | 1 + go.sum | 5 + providers/gitlab/gitlab_provider.go | 103 +++++++++++++ providers/gitlab/gitlab_service.go | 41 ++++++ providers/gitlab/group.go | 138 ++++++++++++++++++ providers/gitlab/project.go | 218 ++++++++++++++++++++++++++++ 10 files changed, 587 insertions(+) create mode 100644 cmd/provider_cmd_gitlab.go create mode 100644 docs/gitlab.md create mode 100644 providers/gitlab/gitlab_provider.go create mode 100644 providers/gitlab/gitlab_service.go create mode 100644 providers/gitlab/group.go create mode 100644 providers/gitlab/project.go diff --git a/README.md b/README.md index 9dfca5b5c5..49cac8fecb 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [PAN-OS](/docs/panos.md) * VCS * [GitHub](/docs/github.md) + * [Gitlab](/docs/gitlab.md) * Monitoring & System Management * [Datadog](/docs/datadog.md) * [New Relic](/docs/relic.md) diff --git a/cmd/provider_cmd_gitlab.go b/cmd/provider_cmd_gitlab.go new file mode 100644 index 0000000000..bbd3a1895d --- /dev/null +++ b/cmd/provider_cmd_gitlab.go @@ -0,0 +1,58 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + "log" + "strings" + + gitLab_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/gitlab" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdGitLabImporter(options ImportOptions) *cobra.Command { + token := "" + baseURL := "" + groups := []string{} + cmd := &cobra.Command{ + Use: "gitlab", + Short: "Import current state to Terraform configuration from GitLab", + Long: "Import current state to Terraform configuration from GitLab", + RunE: func(cmd *cobra.Command, args []string) error { + originalPathPattern := options.PathPattern + for _, group := range groups { + provider := newGitLabProvider() + options.PathPattern = originalPathPattern + options.PathPattern = strings.ReplaceAll(options.PathPattern, "{provider}", "{provider}/"+group) + log.Println(provider.GetName() + " importing group " + group) + err := Import(provider, options, []string{group, token, baseURL}) + if err != nil { + return err + } + } + return nil + }, + } + cmd.AddCommand(listCmd(newGitLabProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "repository", "repository=id1:id2:id4") + cmd.PersistentFlags().StringVarP(&token, "token", "t", "", "YOUR_GITLAB_TOKEN or env param GITLAB_TOKEN") + cmd.PersistentFlags().StringSliceVarP(&groups, "group", "", []string{}, "paths to groups") + cmd.PersistentFlags().StringVarP(&baseURL, "base-url", "", "", "") + return cmd +} + +func newGitLabProvider() terraformutils.ProviderGenerator { + return &gitLab_terraforming.GitLabProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index 5fe804f2de..2565246901 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -64,6 +64,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdPanosImporter, // VCS newCmdGithubImporter, + newCmdGitLabImporter, // Monitoring & System Management newCmdDatadogImporter, newCmdNewRelicImporter, @@ -108,6 +109,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { newCloudflareProvider, // VCS newGitHubProvider, + newGitLabProvider, // Monitoring & System Management newDataDogProvider, newNewRelicProvider, diff --git a/docs/gitlab.md b/docs/gitlab.md new file mode 100644 index 0000000000..fabbe4ab4c --- /dev/null +++ b/docs/gitlab.md @@ -0,0 +1,20 @@ +### Use with GitLab + +Example: + +```shell +./terraformer import gitlab --group=GROUP_TO_IMPORT --resources=projects --token=YOUR_TOKEN # or GITLAB_TOKEN in env +./terraformer import gitlab --group=GROUP_TO_IMPORT --resources=groups --base-url=https://your-self-hosted-gitlab-domain/api/v4 +``` + +List of supported resources: + +* `projects` + * `gitlab_project` + * `gitlab_project_value` + * `gitlab_project_membership` + * `gitlab_tag_protection` + * `gitlab_branch_protection` +* `groups` + * `gitlab_group_membership` + * `gitlab_group_variable` diff --git a/go.mod b/go.mod index 3fb8ec7639..4b0a397f57 100644 --- a/go.mod +++ b/go.mod @@ -152,6 +152,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible github.com/tencentyun/cos-go-sdk-v5 v0.7.19 github.com/vultr/govultr v0.5.0 + github.com/xanzy/go-gitlab v0.50.2 github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 github.com/zclconf/go-cty v1.8.4 diff --git a/go.sum b/go.sum index 20efad0e14..177f218e7d 100644 --- a/go.sum +++ b/go.sum @@ -753,6 +753,7 @@ github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= @@ -1209,6 +1210,8 @@ github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37w github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vultr/govultr v0.5.0 h1:iQzYhzbokmpDARbvIkvTkoyS7WMH82zVTKAL1PZ4JOA= github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5TV3ss= +github.com/xanzy/go-gitlab v0.50.2 h1:Qm/um2Jryuqusc6VmN7iZYVTQVzNynzSiuMJDnCU1wE= +github.com/xanzy/go-gitlab v0.50.2/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -1384,6 +1387,7 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1597,6 +1601,7 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0 h1:uWrpz12dpVPn7cojP82mk02XDgTJLDPc2KbVTxrWb4A= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= diff --git a/providers/gitlab/gitlab_provider.go b/providers/gitlab/gitlab_provider.go new file mode 100644 index 0000000000..02720dc0cb --- /dev/null +++ b/providers/gitlab/gitlab_provider.go @@ -0,0 +1,103 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gitlab + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/pkg/errors" + "github.com/zclconf/go-cty/cty" +) + +type GitLabProvider struct { //nolint + terraformutils.Provider + group string + token string + baseURL string +} + +func (p GitLabProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} + +func (p GitLabProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{ + "provider": map[string]interface{}{ + "gitlab": map[string]interface{}{ + // TODO: Should I add some default config here? + // "token": p.token, + // "base_url": p.baseURL, + }, + }, + } +} + +func (p *GitLabProvider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "token": cty.StringVal(p.token), + // NOTE: Real provider doesn't support empty/null base_url, only set when there's value + "base_url": cty.StringVal(p.baseURL), + }) +} + +// Init GitLabProvider with group +func (p *GitLabProvider) Init(args []string) error { + p.group = args[0] + p.baseURL = gitLabDefaultURL + if len(args) < 2 { + if os.Getenv("GITLAB_TOKEN") == "" { + return errors.New("token requirement") + } + p.token = os.Getenv("GITLAB_TOKEN") + } else { + p.token = args[1] + } + if len(args) > 2 { + if args[2] != "" { + p.baseURL = args[2] + } + } + return nil +} + +func (p *GitLabProvider) GetName() string { + return "gitlab" +} + +func (p *GitLabProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New(p.GetName() + ": " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "group": p.group, + "token": p.token, + "base_url": p.baseURL, + }) + return nil +} + +// GetSupportedService return map of support service for gitlab +func (p *GitLabProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "projects": &ProjectGenerator{}, + "groups": &GroupGenerator{}, + } +} diff --git a/providers/gitlab/gitlab_service.go b/providers/gitlab/gitlab_service.go new file mode 100644 index 0000000000..2bbcdf8af5 --- /dev/null +++ b/providers/gitlab/gitlab_service.go @@ -0,0 +1,41 @@ +// Copyright 2018 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gitlab + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/xanzy/go-gitlab" +) + +const gitLabDefaultURL = "https://gitlab.com/api/v4/" + +type GitLabService struct { //nolint + terraformutils.Service +} + +func (g *GitLabService) createClient() (*gitlab.Client, error) { + if g.GetArgs()["base_url"].(string) == gitLabDefaultURL { + return g.createRegularClient() + } + return g.createEnterpriseClient() +} + +func (g *GitLabService) createRegularClient() (*gitlab.Client, error) { + return gitlab.NewClient(g.Args["token"].(string)) +} + +func (g *GitLabService) createEnterpriseClient() (*gitlab.Client, error) { + return gitlab.NewClient(g.Args["token"].(string), gitlab.WithBaseURL(g.GetArgs()["base_url"].(string))) +} diff --git a/providers/gitlab/group.go b/providers/gitlab/group.go new file mode 100644 index 0000000000..f3625ad556 --- /dev/null +++ b/providers/gitlab/group.go @@ -0,0 +1,138 @@ +// Copyright 2020 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gitlab + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/xanzy/go-gitlab" +) + +type GroupGenerator struct { + GitLabService +} + +// Generate TerraformResources from gitlab API, +func (g *GroupGenerator) InitResources() error { + ctx := context.Background() + client, err := g.createClient() + if err != nil { + return err + } + + group := g.Args["group"].(string) + g.Resources = append(g.Resources, createGroups(ctx, client, group)...) + + return nil +} + +func createGroups(ctx context.Context, client *gitlab.Client, groupID string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + group, _, err := client.Groups.GetGroup(groupID, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + resource := terraformutils.NewSimpleResource( + strconv.FormatInt(int64(group.ID), 10), + getGroupResourceName(group), + "gitlab_group", + "gitlab", + []string{}, + ) + + // NOTE: mirror fields from API doesn't match with the ones from terraform provider + resource.IgnoreKeys = []string{"mirror_trigger_builds", "only_mirror_protected_branches", "mirror", "mirror_overwrites_diverged_branches"} + + resource.SlowQueryRequired = true + resources = append(resources, resource) + resources = append(resources, createGroupVariables(ctx, client, group)...) + resources = append(resources, createGroupMembership(ctx, client, group)...) + + return resources +} +func createGroupVariables(ctx context.Context, client *gitlab.Client, group *gitlab.Group) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &gitlab.ListGroupVariablesOptions{} + + for { + groupVariables, resp, err := client.GroupVariables.ListVariables(group.ID, opt, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + for _, groupVariable := range groupVariables { + + resource := terraformutils.NewSimpleResource( + fmt.Sprintf("%d:%s:%s", group.ID, groupVariable.Key, groupVariable.EnvironmentScope), + fmt.Sprintf("%s___%s___%s", getGroupResourceName(group), groupVariable.Key, groupVariable.EnvironmentScope), + "gitlab_group_variable", + "gitlab", + []string{}, + ) + resource.SlowQueryRequired = true + resources = append(resources, resource) + } + + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + return resources +} + +func createGroupMembership(ctx context.Context, client *gitlab.Client, group *gitlab.Group) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &gitlab.ListGroupMembersOptions{} + + for { + groupMembers, resp, err := client.Groups.ListGroupMembers(group.ID, opt, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + for _, groupMember := range groupMembers { + + resource := terraformutils.NewSimpleResource( + fmt.Sprintf("%d:%d", group.ID, groupMember.ID), + fmt.Sprintf("%s___%s", getGroupResourceName(group), groupMember.Username), + "gitlab_group_membership", + "gitlab", + []string{}, + ) + resource.SlowQueryRequired = true + resources = append(resources, resource) + } + + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + return resources +} + +func getGroupResourceName(group *gitlab.Group) string { + return fmt.Sprintf("%d___%s", group.ID, strings.ReplaceAll(group.FullPath, "/", "__")) +} diff --git a/providers/gitlab/project.go b/providers/gitlab/project.go new file mode 100644 index 0000000000..2c5d04f48b --- /dev/null +++ b/providers/gitlab/project.go @@ -0,0 +1,218 @@ +// Copyright 2020 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gitlab + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/xanzy/go-gitlab" +) + +type ProjectGenerator struct { + GitLabService +} + +// Generate TerraformResources from gitlab API, +func (g *ProjectGenerator) InitResources() error { + ctx := context.Background() + client, err := g.createClient() + if err != nil { + return err + } + + group := g.Args["group"].(string) + g.Resources = append(g.Resources, createProjects(ctx, client, group)...) + + return nil +} + +func createProjects(ctx context.Context, client *gitlab.Client, group string) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &gitlab.ListGroupProjectsOptions{ + ListOptions: gitlab.ListOptions{ + PerPage: 100, + }, + } + + for { + projects, resp, err := client.Groups.ListGroupProjects(group, opt, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + for _, project := range projects { + resource := terraformutils.NewSimpleResource( + strconv.FormatInt(int64(project.ID), 10), + getProjectResourceName(project), + "gitlab_project", + "gitlab", + []string{}, + ) + + // NOTE: mirror fields from API doesn't match with the ones from terraform provider + resource.IgnoreKeys = []string{"mirror_trigger_builds", "only_mirror_protected_branches", "mirror", "mirror_overwrites_diverged_branches"} + + resource.SlowQueryRequired = true + resources = append(resources, resource) + resources = append(resources, createProjectVariables(ctx, client, project)...) + resources = append(resources, createBranchProtections(ctx, client, project)...) + resources = append(resources, createTagProtections(ctx, client, project)...) + resources = append(resources, createProjectMembership(ctx, client, project)...) + } + + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + return resources +} +func createProjectVariables(ctx context.Context, client *gitlab.Client, project *gitlab.Project) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &gitlab.ListProjectVariablesOptions{} + + for { + projectVariables, resp, err := client.ProjectVariables.ListVariables(project.ID, opt, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + for _, projectVariable := range projectVariables { + + resource := terraformutils.NewSimpleResource( + fmt.Sprintf("%d:%s:%s", project.ID, projectVariable.Key, projectVariable.EnvironmentScope), + fmt.Sprintf("%s___%s___%s", getProjectResourceName(project), projectVariable.Key, projectVariable.EnvironmentScope), + "gitlab_project_variable", + "gitlab", + []string{}, + ) + resource.SlowQueryRequired = true + resources = append(resources, resource) + } + + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + return resources +} + +func createBranchProtections(ctx context.Context, client *gitlab.Client, project *gitlab.Project) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &gitlab.ListProtectedBranchesOptions{} + + for { + protectedBranches, resp, err := client.ProtectedBranches.ListProtectedBranches(project.ID, opt, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + for _, protectedBranch := range protectedBranches { + + resource := terraformutils.NewSimpleResource( + fmt.Sprintf("%d:%s", project.ID, protectedBranch.Name), + fmt.Sprintf("%s___%s", getProjectResourceName(project), protectedBranch.Name), + "gitlab_branch_protection", + "gitlab", + []string{}, + ) + resource.SlowQueryRequired = true + resources = append(resources, resource) + } + + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + return resources +} + +func createTagProtections(ctx context.Context, client *gitlab.Client, project *gitlab.Project) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &gitlab.ListProtectedTagsOptions{} + + for { + protectedTags, resp, err := client.ProtectedTags.ListProtectedTags(project.ID, opt, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + for _, protectedTag := range protectedTags { + + resource := terraformutils.NewSimpleResource( + fmt.Sprintf("%d:%s", project.ID, protectedTag.Name), + fmt.Sprintf("%s___%s", getProjectResourceName(project), protectedTag.Name), + "gitlab_tag_protection", + "gitlab", + []string{}, + ) + resource.SlowQueryRequired = true + resources = append(resources, resource) + } + + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + return resources +} + +func createProjectMembership(ctx context.Context, client *gitlab.Client, project *gitlab.Project) []terraformutils.Resource { + resources := []terraformutils.Resource{} + opt := &gitlab.ListProjectMembersOptions{} + + for { + projectMembers, resp, err := client.ProjectMembers.ListProjectMembers(project.ID, opt, gitlab.WithContext(ctx)) + if err != nil { + log.Println(err) + return nil + } + + for _, projectMember := range projectMembers { + + resource := terraformutils.NewSimpleResource( + fmt.Sprintf("%d:%d", project.ID, projectMember.ID), + fmt.Sprintf("%s___%s", getProjectResourceName(project), projectMember.Username), + "gitlab_project_membership", + "gitlab", + []string{}, + ) + resource.SlowQueryRequired = true + resources = append(resources, resource) + } + + if resp.NextPage == 0 { + break + } + opt.Page = resp.NextPage + } + return resources +} + +func getProjectResourceName(project *gitlab.Project) string { + return fmt.Sprintf("%d___%s", project.ID, strings.ReplaceAll(project.PathWithNamespace, "/", "__")) +} From 5d6b2b3ce6e189c673eb17c5fef01ca1b915f05a Mon Sep 17 00:00:00 2001 From: anilkumarnagaraj Date: Sun, 29 Aug 2021 21:32:19 +0530 Subject: [PATCH 221/276] Add certificate manager support (#979) --- cmd/provider_cmd_ibm.go | 4 +- providers/ibm/ibm_certificate_manager.go | 174 +++++++++++++++++++++++ providers/ibm/ibm_provider.go | 4 + 3 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 providers/ibm/ibm_certificate_manager.go diff --git a/cmd/provider_cmd_ibm.go b/cmd/provider_cmd_ibm.go index fd9e6c6f99..099aa3ccba 100644 --- a/cmd/provider_cmd_ibm.go +++ b/cmd/provider_cmd_ibm.go @@ -23,13 +23,14 @@ import ( func newCmdIbmImporter(options ImportOptions) *cobra.Command { var resourceGroup string var region string + var cis string cmd := &cobra.Command{ Use: "ibm", Short: "Import current state to Terraform configuration from ibm", Long: "Import current state to Terraform configuration from ibm", RunE: func(cmd *cobra.Command, args []string) error { provider := newIbmProvider() - err := Import(provider, options, []string{resourceGroup, region}) + err := Import(provider, options, []string{resourceGroup, region, cis}) if err != nil { return err } @@ -41,6 +42,7 @@ func newCmdIbmImporter(options ImportOptions) *cobra.Command { baseProviderFlags(cmd.PersistentFlags(), &options, "server", "ibm_server=name1:name2:name3") cmd.PersistentFlags().StringVarP(&resourceGroup, "resource_group", "", "", "resource_group=default") cmd.PersistentFlags().StringVarP(®ion, "region", "R", "", "region=us-south") + cmd.PersistentFlags().StringVarP(&cis, "cis", "", "", "cis=TestCIS") return cmd } diff --git a/providers/ibm/ibm_certificate_manager.go b/providers/ibm/ibm_certificate_manager.go new file mode 100644 index 0000000000..4e496b884d --- /dev/null +++ b/providers/ibm/ibm_certificate_manager.go @@ -0,0 +1,174 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/certificatemanager" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/session" +) + +type CMGenerator struct { + IBMService +} + +func (g CMGenerator) loadCM(cmID, cmGuID string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + cmID, + cmGuID, + "ibm_resource_instance", + "ibm", + []string{}) + return resources +} + +func (g CMGenerator) loadImportedCM(cmID, certificateID, cisInstance string, dependsOn []string) terraformutils.Resource { + resources := terraformutils.NewResource( + cmID, + certificateID, + "ibm_certificate_manager_import", + "ibm", + map[string]string{ + "dns_provider_instance_crn": cisInstance, + }, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g CMGenerator) loadOrderedCM(cmID, certificateID, cisInstance string, dependsOn []string) terraformutils.Resource { + resources := terraformutils.NewResource( + cmID, + certificateID, + "ibm_certificate_manager_order", + "ibm", + map[string]string{ + "dns_provider_instance_crn": cisInstance, + }, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g *CMGenerator) InitResources() error { + + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + var cisInstance string + var cisID string + cis := g.Args["cis"] + if cis != nil { + cisInstance = cis.(string) + } + + // Client creation + catalogClient, err := catalog.New(sess) + if err != nil { + return err + } + + controllerClient, err := controllerv2.New(sess) + if err != nil { + return err + } + + certManagementClient, err := certificatemanager.New(sess) + if err != nil { + return err + } + + // Get ServiceID of certificate manager service + serviceID, err := catalogClient.ResourceCatalog().FindByName("cloudcerts", true) + if err != nil { + return err + } + + serviceID2, err := catalogClient.ResourceCatalog().FindByName("internet-svcs", true) + if err != nil { + return err + } + + query := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID[0].ID, + } + + query2 := controllerv2.ServiceInstanceQuery{ + ServiceID: serviceID2[0].ID, + } + + // Get all Certificate manager instances + cmInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query) + if err != nil { + return err + } + + // Get all CIS instances + cisInstances, err := controllerClient.ResourceServiceInstanceV2().ListInstances(query2) + if err != nil { + return err + } + for _, cis := range cisInstances { + if cisInstance == cis.Name { + cisID = cis.Guid + } + } + + // Get all certificates associated with a certificate manager instance + for _, cmInstance := range cmInstances { + + g.Resources = append(g.Resources, g.loadCM(cmInstance.ID, cmInstance.Guid)) + + // For each instance get associated certificates + certificateList, err := certManagementClient.Certificate().ListCertificates(cmInstance.ID) + if err != nil { + return err + } + + for _, cert := range certificateList { + // Get certificate info + certificatedata, err := certManagementClient.Certificate().GetCertData(cert.ID) + if err != nil { + return err + } + + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_resource_instance."+terraformutils.TfSanitize(cmInstance.Guid)) + + if certificatedata.Imported { + g.Resources = append(g.Resources, g.loadImportedCM(cert.ID, cert.ID, cisID, dependsOn)) + } else { + g.Resources = append(g.Resources, g.loadOrderedCM(cert.ID, cert.ID, cisID, dependsOn)) + } + } + } + + return nil +} diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index eff48c4757..ee53171e26 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -24,11 +24,13 @@ type IBMProvider struct { //nolint terraformutils.Provider ResourceGroup string Region string + CIS string } func (p *IBMProvider) Init(args []string) error { p.ResourceGroup = args[0] p.Region = args[1] + p.CIS = args[2] return nil } @@ -82,6 +84,7 @@ func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGen "ibm_is_instance_template": &InstanceTemplateGenerator{}, "ibm_function": &CloudFunctionGenerator{}, "ibm_private_dns": &privateDNSTemplateGenerator{}, + "ibm_certificate_manager": &CMGenerator{}, } } @@ -98,6 +101,7 @@ func (p *IBMProvider) InitService(serviceName string, verbose bool) error { p.Service.SetArgs(map[string]interface{}{ "resource_group": p.ResourceGroup, "region": p.Region, + "cis": p.CIS, }) return nil } From a36ef0287c1cd2aab890f7a30d04282054ee59e5 Mon Sep 17 00:00:00 2001 From: anilkumarnagaraj Date: Sun, 29 Aug 2021 21:32:57 +0530 Subject: [PATCH 222/276] Add cis resource (#1029) --- go.mod | 2 +- go.sum | 3 + providers/ibm/cis.go | 552 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 482 insertions(+), 75 deletions(-) diff --git a/go.mod b/go.mod index 4b0a397f57..b2ea88c8f3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/IBM/go-sdk-core/v4 v4.9.0 github.com/IBM/ibm-cos-sdk-go v1.5.0 github.com/IBM/keyprotect-go-client v0.6.0 - github.com/IBM/networking-go-sdk v0.13.0 + github.com/IBM/networking-go-sdk v0.19.0 github.com/IBM/platform-services-go-sdk v0.19.1 github.com/IBM/vpc-go-sdk v0.4.1 github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect diff --git a/go.sum b/go.sum index 177f218e7d..0befd2ea51 100644 --- a/go.sum +++ b/go.sum @@ -105,6 +105,7 @@ github.com/IBM/go-sdk-core/v3 v3.3.1/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QC github.com/IBM/go-sdk-core/v4 v4.5.1/go.mod h1:lTUXbqIX6/aAbSCkP6q59+dyFsTwZAc0ewRS2vJWVbg= github.com/IBM/go-sdk-core/v4 v4.9.0 h1:OkSg5kaEfVoNuBA4IsIOz8Ur5rbGHbWxmWCZ7nK/oc0= github.com/IBM/go-sdk-core/v4 v4.9.0/go.mod h1:DbQ+3pFoIjxGGTEiA9zQ2V0cemMNmFMkLBBnR729HKg= +github.com/IBM/go-sdk-core/v5 v5.4.5/go.mod h1:Sn+z+qTDREQvCr+UFa22TqqfXNxx3o723y8GsfLV8e0= github.com/IBM/go-sdk-core/v5 v5.5.1 h1:Hb4xB1BL8L6uCnskIqSCxF9wLfOmj4+sVzM5vFtuhs4= github.com/IBM/go-sdk-core/v5 v5.5.1/go.mod h1:Sn+z+qTDREQvCr+UFa22TqqfXNxx3o723y8GsfLV8e0= github.com/IBM/ibm-cos-sdk-go v1.5.0 h1:YCmAgsdtp/irQep5g+62OvjLNj35tMXLqTC5jQ+YjWo= @@ -113,6 +114,8 @@ github.com/IBM/keyprotect-go-client v0.6.0 h1:jZExoYSaoQ5TrfEzPOmBLc1vJ0VWA0RfKC github.com/IBM/keyprotect-go-client v0.6.0/go.mod h1:SVr2ylV/fhSQPDiUjWirN9fsyWFCNNbt8GIT8hPJVjE= github.com/IBM/networking-go-sdk v0.13.0 h1:MKDL0c5Gnc6BT10lCS1S1pZVz71UmX4mJC4eXQqWwHE= github.com/IBM/networking-go-sdk v0.13.0/go.mod h1:3/QnBTwCXAWoz98dw3z37UUfpkIwAwi8qDGntNt6F6A= +github.com/IBM/networking-go-sdk v0.19.0 h1:oXmRZPLnL28OE7bVRJLvKB6vGYjCG58pLWAeTjVBajs= +github.com/IBM/networking-go-sdk v0.19.0/go.mod h1:nViqUm1Bv+ke8dyOhjQ6e+2U1XeqZX2y4bQbR8Od3Hc= github.com/IBM/platform-services-go-sdk v0.19.1 h1:RDxIHiqmxQWSYrJGm4oGSvvbKg4TXY1ox53ORsX6zvE= github.com/IBM/platform-services-go-sdk v0.19.1/go.mod h1:2pH+yjJTvL4l5Plp+uig5+U0QGwQfbBnAqu6XGPblMQ= github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= diff --git a/providers/ibm/cis.go b/providers/ibm/cis.go index 93e3a621de..64a47c9f0f 100644 --- a/providers/ibm/cis.go +++ b/providers/ibm/cis.go @@ -17,19 +17,30 @@ package ibm import ( "fmt" "os" + "strconv" "strings" "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/IBM-Cloud/bluemix-go" + bluemix "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/session" "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/networking-go-sdk/custompagesv1" "github.com/IBM/networking-go-sdk/dnsrecordsv1" "github.com/IBM/networking-go-sdk/edgefunctionsapiv1" + "github.com/IBM/networking-go-sdk/filtersv1" "github.com/IBM/networking-go-sdk/globalloadbalancermonitorv1" + "github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0" "github.com/IBM/networking-go-sdk/globalloadbalancerv1" "github.com/IBM/networking-go-sdk/pageruleapiv1" + "github.com/IBM/networking-go-sdk/rangeapplicationsv1" + "github.com/IBM/networking-go-sdk/routingv1" + "github.com/IBM/networking-go-sdk/sslcertificateapiv1" + "github.com/IBM/networking-go-sdk/useragentblockingrulesv1" + "github.com/IBM/networking-go-sdk/wafrulegroupsapiv1" + "github.com/IBM/networking-go-sdk/wafrulepackagesapiv1" + "github.com/IBM/networking-go-sdk/zonefirewallaccessrulesv1" "github.com/IBM/networking-go-sdk/zonelockdownv1" "github.com/IBM/networking-go-sdk/zoneratelimitsv1" "github.com/IBM/networking-go-sdk/zonesv1" @@ -41,7 +52,7 @@ type CISGenerator struct { } func (g CISGenerator) loadInstances(crn, name, resGrpID string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( crn, name, "ibm_cis", @@ -51,11 +62,11 @@ func (g CISGenerator) loadInstances(crn, name, resGrpID string) terraformutils.R }, []string{}, map[string]interface{}{}) - return resources + return resource } func (g CISGenerator) loadDomains(crn, domainID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", domainID, crn), domainID, "ibm_cis_domain", @@ -65,7 +76,7 @@ func (g CISGenerator) loadDomains(crn, domainID string, dependsOn []string) terr map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string, dependsOn []string) terraformutils.Resource { @@ -82,10 +93,10 @@ func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string, dependsO return resources } -func (g CISGenerator) loadFirewallLockdown(resourceName, crn, domainID, fID, fType string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( +func (g CISGenerator) loadFirewall(crn, domainID, fID, fType string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s:%s", fType, fID, domainID, crn), - resourceName, + fID, "ibm_cis_firewall", "ibm", map[string]string{}, @@ -93,11 +104,11 @@ func (g CISGenerator) loadFirewallLockdown(resourceName, crn, domainID, fID, fTy map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } func (g CISGenerator) loadDomainSettings(crn, dID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", dID, crn), dID, "ibm_cis_domain_settings", @@ -107,11 +118,11 @@ func (g CISGenerator) loadDomainSettings(crn, dID string, dependsOn []string) te map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", gID, dID, crn), fmt.Sprintf("%s:%s:%s", gID, dID, crn), "ibm_cis_global_load_balancer", @@ -121,27 +132,48 @@ func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string, dependsOn []strin map[string]interface{}{ "depends_on": dependsOn, }) - return resources + + // Conflicts with proxied attribute + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^ttl$", + ) + return resource } -func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( +func (g CISGenerator) loadGlobalBalancerPool(crn, pID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s", pID, crn), + fmt.Sprintf("%s:%s", pID, crn), + "ibm_cis_origin_pool", + g.ProviderName, + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID, port string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", gblmID, crn), gblmID, "ibm_cis_healthcheck", "ibm", - map[string]string{}, + map[string]string{ + "port": port, + }, []string{}, map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } -func (g CISGenerator) loadRateLimit(resourceName, crn, dID, rID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( +func (g CISGenerator) loadRateLimit(crn, dID, rID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", rID, dID, crn), - resourceName, + rID, "ibm_cis_rate_limit", "ibm", map[string]string{}, @@ -149,11 +181,11 @@ func (g CISGenerator) loadRateLimit(resourceName, crn, dID, rID string, dependsO map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } func (g CISGenerator) loadEdgeFunctionAction(crn, dID, actionID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", actionID, dID, crn), actionID, "ibm_cis_edge_functions_action", @@ -163,11 +195,11 @@ func (g CISGenerator) loadEdgeFunctionAction(crn, dID, actionID string, dependsO map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } func (g CISGenerator) loadEdgeFunctionTrigger(crn, dID, triggerID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", triggerID, dID, crn), triggerID, "ibm_cis_edge_functions_trigger", @@ -177,19 +209,152 @@ func (g CISGenerator) loadEdgeFunctionTrigger(crn, dID, triggerID string, depend map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } -func (g CISGenerator) loadPageRule(crn, dID, ruleID string) terraformutils.Resource { - resources := terraformutils.NewResource( +func (g CISGenerator) loadWafRulePackage(crn, dID, pkgID, actionMode, sensitivity string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", pkgID, dID, crn), + fmt.Sprintf("%s:%s", pkgID, dID), + "ibm_cis_waf_package", + "ibm", + map[string]string{ + "action_mode": actionMode, + "sensitivity": sensitivity, + }, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadWafGroups(crn, dID, pkgID, grpID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s:%s", grpID, pkgID, dID, crn), + fmt.Sprintf("%s:%s:%s", grpID, pkgID, dID), + "ibm_cis_waf_group", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadPageRule(crn, dID, ruleID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", ruleID, dID, crn), fmt.Sprintf("%s:%s:%s", ruleID, dID, crn), - ruleID, "ibm_cis_page_rule", "ibm", map[string]string{}, []string{}, - map[string]interface{}{}) - return resources + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadCustomPage(crn, dID, cpID, url string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", cpID, dID, crn), + fmt.Sprintf("%s:%s:%s", cpID, dID, crn), + "ibm_cis_custom_page", + "ibm", + map[string]string{ + "url": url, + }, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadRangeApp(crn, dID, appID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", appID, dID, crn), + fmt.Sprintf("%s:%s", appID, dID), + "ibm_cis_range_app", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadSSLCertificates(crn, dID, cID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", cID, dID, crn), + cID, + "ibm_cis_certificate_order", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadCISRouting(crn, dID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s", dID, crn), + fmt.Sprintf("%s:%s", dID, crn), + "ibm_cis_routing", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadCacheSettings(crn, dID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s", dID, crn), + fmt.Sprintf("%s:%s", dID, crn), + "ibm_cis_cache_settings", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadTLSSettings(crn, dID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s", dID, crn), + fmt.Sprintf("%s:%s", dID, crn), + "ibm_cis_tls_settings", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource +} + +func (g CISGenerator) loadFilters(crn, dID, fID string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s:%s:%s", fID, dID, crn), + fmt.Sprintf("%s:%s:%s", fID, dID, crn), + "ibm_cis_filter", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource } // InitResources .. @@ -231,6 +396,7 @@ func (g *CISGenerator) InitResources() error { if err != nil { return err } + query := controllerv2.ServiceInstanceQuery{ ServiceID: serviceID[0].ID, } @@ -262,12 +428,38 @@ func (g *CISGenerator) InitResources() error { return err } - domainOpts := &zonesv1.ListZonesOptions{} + domainOpts := zService.NewListZonesOptions() + domainOpts.SetPage(1) // list all zones in one page + domainOpts.SetPerPage(1000) // maximum allowed limit is 1000 per page + zoneList, _, err := zService.ListZones(domainOpts) if err != nil { return err } + // Origin pool + gblOpts := &globalloadbalancerpoolsv0.GlobalLoadBalancerPoolsV0Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{BearerToken: bluemixToken}, + Crn: &crn, + } + + gblService, err := globalloadbalancerpoolsv0.NewGlobalLoadBalancerPoolsV0(gblOpts) + if err != nil { + return err + } + + gblPoolList, _, err := gblService.ListAllLoadBalancerPools(&globalloadbalancerpoolsv0.ListAllLoadBalancerPoolsOptions{}) + if err != nil { + return err + } + + for _, gbl := range gblPoolList.Result { + if gbl.ID != nil { + g.Resources = append(g.Resources, g.loadGlobalBalancerPool(crn, *gbl.ID, cisDependsOn)) + } + } + // Health Monitor gblmOpts := &globalloadbalancermonitorv1.GlobalLoadBalancerMonitorV1Options{ URL: DefaultCisURL, @@ -275,14 +467,20 @@ func (g *CISGenerator) InitResources() error { Crn: &crn, } - gblmService, _ := globalloadbalancermonitorv1.NewGlobalLoadBalancerMonitorV1(gblmOpts) - gblmList, _, err := gblmService.ListAllLoadBalancerMonitors(&globalloadbalancermonitorv1.ListAllLoadBalancerMonitorsOptions{}) + gblmService, err := globalloadbalancermonitorv1.NewGlobalLoadBalancerMonitorV1(gblmOpts) if err != nil { return err } + gblmList, _, err := gblmService.ListAllLoadBalancerMonitors(&globalloadbalancermonitorv1.ListAllLoadBalancerMonitorsOptions{}) + if err != nil { + return err + } for _, gblm := range gblmList.Result { - g.Resources = append(g.Resources, g.loadGlobalBalancerMonitor(crn, *gblm.ID, cisDependsOn)) + if gblm.Port != nil { + port := strconv.FormatInt(*gblm.Port, 10) + g.Resources = append(g.Resources, g.loadGlobalBalancerMonitor(crn, *gblm.ID, port, cisDependsOn)) + } } for _, z := range zoneList.Result { @@ -308,6 +506,7 @@ func (g *CISGenerator) InitResources() error { // Domain Setting g.Resources = append(g.Resources, g.loadDomainSettings(crn, *z.ID, domainDependsOn)) + // DNS Records dnsService, err := dnsrecordsv1.NewDnsRecordsV1(dnsOpts) if err != nil { return err @@ -320,27 +519,7 @@ func (g *CISGenerator) InitResources() error { } // IBM Network CIS WAF Package - // cisWAFPackageOpt := &wafrulepackagesapiv1.WafRulePackagesApiV1Options{ - // URL: DefaultCisURL, - // Authenticator: &core.BearerTokenAuthenticator{ - // BearerToken: bluemixToken, - // }, - // Crn: &crn, - // ZoneID: &zoneID, - // } - // cisWAFPackageClient, _ := wafrulepackagesapiv1.NewWafRulePackagesApiV1(cisWAFPackageOpt) - // wasPkgList, _, err := cisWAFPackageClient.ListWafPackages(&wafrulepackagesapiv1.ListWafPackagesOptions{}) - // if err != nil { - // return err - // } - - // for _, wafPkg := range wasPkgList.Result { - // fmt.Println("*wfpackge.ID ::", *wafPkg.Name) - // //g.Resources = append(g.Resources, g.loadWafRulePackage(crn, *z.ID, *wafPkg.ID, domainDependsOn)) - // } - - // IBM Network CIS Page Rules - cisPageRuleOpt := &pageruleapiv1.PageRuleApiV1Options{ + cisWAFPackagesOpt := &wafrulepackagesapiv1.WafRulePackagesApiV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ BearerToken: bluemixToken, @@ -348,14 +527,44 @@ func (g *CISGenerator) InitResources() error { Crn: &crn, ZoneID: &zoneID, } - cisPageRuleClient, _ := pageruleapiv1.NewPageRuleApiV1(cisPageRuleOpt) - cisPgList, _, err := cisPageRuleClient.ListPageRules(&pageruleapiv1.ListPageRulesOptions{}) + cisWAFPackageClient, _ := wafrulepackagesapiv1.NewWafRulePackagesApiV1(cisWAFPackagesOpt) + wasPkgList, _, err := cisWAFPackageClient.ListWafPackages(&wafrulepackagesapiv1.ListWafPackagesOptions{}) if err != nil { return err } - for _, pg := range cisPgList.Result { - g.Resources = append(g.Resources, g.loadPageRule(crn, *z.ID, *pg.ID)) + for _, wafPkg := range wasPkgList.Result { + cisWAFPackageOpt := &wafrulepackagesapiv1.GetWafPackageOptions{ + PackageID: wafPkg.ID, + } + wafPkg, _, err := cisWAFPackageClient.GetWafPackage(cisWAFPackageOpt) + if err != nil { + return err + } + + if wafPkg.Result != nil && wafPkg.Result.ActionMode != nil { + g.Resources = append(g.Resources, g.loadWafRulePackage(crn, *z.ID, *wafPkg.Result.ID, *wafPkg.Result.ActionMode, *wafPkg.Result.Sensitivity, domainDependsOn)) + + // CIS waf-groups + cisWAFGroupOpt := &wafrulegroupsapiv1.WafRuleGroupsApiV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneID: &zoneID, + } + cisWAFGroupClient, _ := wafrulegroupsapiv1.NewWafRuleGroupsApiV1(cisWAFGroupOpt) + wasGrpList, _, err := cisWAFGroupClient.ListWafRuleGroups(&wafrulegroupsapiv1.ListWafRuleGroupsOptions{ + PkgID: wafPkg.Result.ID, + }) + if err != nil { + return err + } + for _, wafGrp := range wasGrpList.Result { + g.Resources = append(g.Resources, g.loadWafGroups(crn, *z.ID, *wafPkg.Result.ID, *wafGrp.ID, domainDependsOn)) + } + } } // Rate Limit @@ -373,11 +582,10 @@ func (g *CISGenerator) InitResources() error { } for _, rl := range rateLimitList.Result { - resourceName := fmt.Sprintf("%s:%s", "ibm_cis_rate_limit", *z.ID) - g.Resources = append(g.Resources, g.loadRateLimit(resourceName, crn, *z.ID, *rl.ID, domainDependsOn)) + g.Resources = append(g.Resources, g.loadRateLimit(crn, *z.ID, *rl.ID, domainDependsOn)) } - // Firewall Lockdown + // Firewall - Lockdown firewallOpts := &zonelockdownv1.ZoneLockdownV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ @@ -397,7 +605,63 @@ func (g *CISGenerator) InitResources() error { return err } - // IBM Network CIS Edge Function Triggers + for _, f := range firewallList.Result { + g.Resources = append(g.Resources, g.loadFirewall(crn, *z.ID, *f.ID, "lockdowns", domainDependsOn)) + } + + // Firewall - AccessRules + firewallAccessOpts := &zonefirewallaccessrulesv1.ZoneFirewallAccessRulesV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + fAccessService, err := zonefirewallaccessrulesv1.NewZoneFirewallAccessRulesV1(firewallAccessOpts) + if err != nil { + return err + } + + firewalAccesslList, _, err := fAccessService.ListAllZoneAccessRules(&zonefirewallaccessrulesv1.ListAllZoneAccessRulesOptions{}) + if err != nil { + return err + } + + for _, f := range firewalAccesslList.Result { + if f.Configuration.Target != nil { + g.Resources = append(g.Resources, g.loadFirewall(crn, *z.ID, *f.ID, "access_rules", domainDependsOn)) + } + } + + // Useragent blocking rules + firewallUAOpts := &useragentblockingrulesv1.UserAgentBlockingRulesV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + fUAService, err := useragentblockingrulesv1.NewUserAgentBlockingRulesV1(firewallUAOpts) + if err != nil { + return err + } + + firewalUAlList, _, err := fUAService.ListAllZoneUserAgentRules(&useragentblockingrulesv1.ListAllZoneUserAgentRulesOptions{}) + if err != nil { + return err + } + + for _, f := range firewalUAlList.Result { + if f.Configuration.Target != nil { + g.Resources = append(g.Resources, g.loadFirewall(crn, *z.ID, *f.ID, "ua_rules", domainDependsOn)) + } + } + + // IBM Network CIS Edge Function Action & Triggers cisEdgeFunctionOpt := &edgefunctionsapiv1.EdgeFunctionsApiV1Options{ URL: DefaultCisURL, Authenticator: &core.BearerTokenAuthenticator{ @@ -408,28 +672,164 @@ func (g *CISGenerator) InitResources() error { } cisEdgeFunctionClient, _ := edgefunctionsapiv1.NewEdgeFunctionsApiV1(cisEdgeFunctionOpt) - edgeTriggerList, _, err := cisEdgeFunctionClient.ListEdgeFunctionsTriggers(&edgefunctionsapiv1.ListEdgeFunctionsTriggersOptions{}) + edgeActionResonse, _, err := cisEdgeFunctionClient.ListEdgeFunctionsActions(&edgefunctionsapiv1.ListEdgeFunctionsActionsOptions{}) if err != nil { return err } - actionName := "" - for _, el := range edgeTriggerList.Result { - actionName = *el.Script - g.Resources = append(g.Resources, g.loadEdgeFunctionTrigger(crn, *z.ID, *el.ID, domainDependsOn)) + for _, el := range edgeActionResonse.Result { + if el.Routes != nil { + for _, elT := range el.Routes { + edgeFunctionActionDependsOn := makeDependsOn(domainDependsOn, + "ibm_cis_edge_functions_action."+terraformutils.TfSanitize(*elT.Script)) + + g.Resources = append(g.Resources, g.loadEdgeFunctionAction(crn, *z.ID, *elT.Script, domainDependsOn)) + g.Resources = append(g.Resources, g.loadEdgeFunctionTrigger(crn, *z.ID, *elT.ID, edgeFunctionActionDependsOn)) + } + } } - if actionName != "" { - g.Resources = append(g.Resources, g.loadEdgeFunctionAction(crn, *z.ID, actionName, domainDependsOn)) + // Range app + rangeAppOpt := &rangeapplicationsv1.RangeApplicationsV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, } - for _, f := range firewallList.Result { - resourceName := fmt.Sprintf("%s:%s", "ibm_cis_firewall", *f.ID) - g.Resources = append(g.Resources, g.loadFirewallLockdown(resourceName, crn, *z.ID, *f.ID, "lockdowns", domainDependsOn)) + rangeAppClient, _ := rangeapplicationsv1.NewRangeApplicationsV1(rangeAppOpt) + ranegAppList, _, err := rangeAppClient.ListRangeApps(&rangeapplicationsv1.ListRangeAppsOptions{}) + if err != nil { + return err } + for _, r := range ranegAppList.Result { + g.Resources = append(g.Resources, g.loadRangeApp(crn, *z.ID, *r.ID, domainDependsOn)) + } + + // Page Rules + pageRueleOpt := &pageruleapiv1.PageRuleApiV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneID: &zoneID, + } + + pageRuleClient, _ := pageruleapiv1.NewPageRuleApiV1(pageRueleOpt) + pageRuleList, _, err := pageRuleClient.ListPageRules(&pageruleapiv1.ListPageRulesOptions{}) + if err != nil { + return err + } + + for _, p := range pageRuleList.Result { + g.Resources = append(g.Resources, g.loadPageRule(crn, *z.ID, *p.ID, domainDependsOn)) + } + + // Custom Page + customPageOpt := &custompagesv1.CustomPagesV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + customPageClient, _ := custompagesv1.NewCustomPagesV1(customPageOpt) + customPageList, _, err := customPageClient.ListInstanceCustomPages(&custompagesv1.ListInstanceCustomPagesOptions{}) + if err != nil { + return err + } + + for _, cp := range customPageList.Result { + if cp.URL != nil { + g.Resources = append(g.Resources, g.loadCustomPage(crn, *z.ID, *cp.ID, *cp.URL, domainDependsOn)) + } + } + + // SSL Certificate - order + sslOpt := &sslcertificateapiv1.SslCertificateApiV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + sslClient, err := sslcertificateapiv1.NewSslCertificateApiV1(sslOpt) + if err != nil { + return err + } + sslList, _, err := sslClient.ListCertificates(&sslcertificateapiv1.ListCertificatesOptions{}) + if err != nil { + return err + } + for _, cert := range sslList.Result { + g.Resources = append(g.Resources, g.loadSSLCertificates(crn, *z.ID, *cert.ID, domainDependsOn)) + } + + // routingv1 + routingOpt := &routingv1.RoutingV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + Crn: &crn, + ZoneIdentifier: &zoneID, + } + + routingClient, err := routingv1.NewRoutingV1(routingOpt) + if err != nil { + return err + } + routingList, _, err := routingClient.GetSmartRouting(&routingv1.GetSmartRoutingOptions{}) + if err != nil { + return err + } + if routingList != nil { + g.Resources = append(g.Resources, g.loadCISRouting(crn, *z.ID, domainDependsOn)) + } + + // Filters + filterOpts := &filtersv1.FiltersV1Options{ + URL: DefaultCisURL, + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + } + + filterClient, err := filtersv1.NewFiltersV1(filterOpts) + if err != nil { + return err + } + + filterList, _, err := filterClient.ListAllFilters(&filtersv1.ListAllFiltersOptions{ + Crn: &crn, + ZoneIdentifier: &zoneID, + XAuthUserToken: &bluemixToken, + }) + if err != nil { + return err + } + + if filterList != nil { + for _, f := range filterList.Result { + g.Resources = append(g.Resources, g.loadFilters(crn, *z.ID, *f.ID, domainDependsOn)) + } + } + + // Cache Settings + g.Resources = append(g.Resources, g.loadCacheSettings(crn, *z.ID, domainDependsOn)) + + // TLS Settings + g.Resources = append(g.Resources, g.loadTLSSettings(crn, *z.ID, domainDependsOn)) + for _, d := range dnsList.Result { - dnsDependsOn := append(domainDependsOn, + dnsDependsOn := makeDependsOn(domainDependsOn, "ibm_cis_dns_record."+terraformutils.TfSanitize(*d.ID)) g.Resources = append(g.Resources, g.loadDNSRecords(crn, *z.ID, *d.ID, domainDependsOn)) @@ -463,3 +863,7 @@ func (g *CISGenerator) InitResources() error { return nil } + +func makeDependsOn(dependsOn []string, resource string) []string { + return append(dependsOn, resource) +} From ae40ab73cc306b460b3a9d0c49b8b6a6261e0257 Mon Sep 17 00:00:00 2001 From: Noi Narisak Date: Tue, 31 Aug 2021 03:49:20 -0500 Subject: [PATCH 223/276] Add okta app resources (#1030) * Add okta_app_swa * Add okta_app_three_field * Add okta_app_auto_login * Add okta_app_basic_auth * Add okta_app_bookmark * Add okta_app_oauth * Add okta_app_saml * Add okta_app_secure_password_store --- docs/okta.md | 9 +++ providers/okta/app.go | 71 +++++++++++++++++++++ providers/okta/app_auto_login.go | 64 +++++++++++++++++++ providers/okta/app_basic_auth.go | 64 +++++++++++++++++++ providers/okta/app_bookmark.go | 64 +++++++++++++++++++ providers/okta/app_oauth.go | 64 +++++++++++++++++++ providers/okta/app_saml.go | 57 +++++++++++++++++ providers/okta/app_secure_password_store.go | 64 +++++++++++++++++++ providers/okta/app_swa.go | 71 +++++++++++++++++++++ providers/okta/app_three_field.go | 71 +++++++++++++++++++++ providers/okta/okta_provider.go | 54 +++++++++------- 11 files changed, 630 insertions(+), 23 deletions(-) create mode 100644 providers/okta/app.go create mode 100644 providers/okta/app_auto_login.go create mode 100644 providers/okta/app_basic_auth.go create mode 100644 providers/okta/app_bookmark.go create mode 100644 providers/okta/app_oauth.go create mode 100644 providers/okta/app_saml.go create mode 100644 providers/okta/app_secure_password_store.go create mode 100644 providers/okta/app_swa.go create mode 100644 providers/okta/app_three_field.go diff --git a/docs/okta.md b/docs/okta.md index 4a63d4d473..964532b96e 100644 --- a/docs/okta.md +++ b/docs/okta.md @@ -29,6 +29,15 @@ List of supported Okta services: * `okta_auth_server_scope` * `okta_auth_server_claim` * `okta_auth_server_policy` +* `app` + * `okta_app_auto_login` + * `okta_app_basic_auth` + * `okta_app_bookmark` + * `okta_app_oauth` + * `okta_app_saml` + * `okta_app_secure_password_store` + * `okta_app_swa` + * `okta_app_three_field` * `event_hook` * * `okta_event_hook` * `factor` diff --git a/providers/okta/app.go b/providers/okta/app.go new file mode 100644 index 0000000000..1dc08626f0 --- /dev/null +++ b/providers/okta/app.go @@ -0,0 +1,71 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/okta/okta-sdk-golang/v2/okta" +) + +//NOTE: Okta SDK v2.6.1 ListApplications() method does not support applications by type at this time. So +// we have to create the application filter by our self. + +func getApplications(ctx context.Context, client *okta.Client, signOnMode string) ([]*okta.Application, error) { + apps, resp, err := client.Application.ListApplications(ctx, nil) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextAppSet []okta.App + resp, err = resp.Next(ctx, &nextAppSet) + if err != nil { + return nil, err + } + apps = append(apps, nextAppSet...) + } + + resultingApps := make([]*okta.Application, len(apps)) + for i := range apps { + resultingApps[i] = apps[i].(*okta.Application) + } + + var supportedApps []*okta.Application + for _, app := range resultingApps { + //NOTE: Okta provider does not support the following app type/name + if app.Name == "template_wsfed" || + app.Name == "template_swa_two_page" || + app.Name == "okta_enduser" || + app.Name == "okta_browser_plugin" || + app.Name == "saasure" { + continue + } + supportedApps = append(supportedApps, app) + } + + oktaSupportApplications := map[*okta.Application]string{} + for _, app := range supportedApps { + oktaSupportApplications[app] = app.SignOnMode + } + + var filterApps []*okta.Application + for app, appSignOnNode := range oktaSupportApplications { + if appSignOnNode == signOnMode { + filterApps = append(filterApps, app) + } + } + return filterApps, nil +} diff --git a/providers/okta/app_auto_login.go b/providers/okta/app_auto_login.go new file mode 100644 index 0000000000..d031b7b178 --- /dev/null +++ b/providers/okta/app_auto_login.go @@ -0,0 +1,64 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppAutoLoginGenerator struct { + OktaService +} + +func (g AppAutoLoginGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_auto_login", + "okta", + []string{})) + } + return resources +} + +func (g *AppAutoLoginGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getAutoLoginApplications(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(apps) + return nil +} + +func getAutoLoginApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { + signOnMode := "AUTO_LOGIN" + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return nil, err + } + + return apps, nil +} diff --git a/providers/okta/app_basic_auth.go b/providers/okta/app_basic_auth.go new file mode 100644 index 0000000000..21eac34d26 --- /dev/null +++ b/providers/okta/app_basic_auth.go @@ -0,0 +1,64 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppBasicAuthGenerator struct { + OktaService +} + +func (g AppBasicAuthGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_basic_auth", + "okta", + []string{})) + } + return resources +} + +func (g *AppBasicAuthGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getBasicAuthApplications(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(apps) + return nil +} + +func getBasicAuthApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { + signOnMode := "BASIC_AUTH" + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return nil, err + } + + return apps, nil +} diff --git a/providers/okta/app_bookmark.go b/providers/okta/app_bookmark.go new file mode 100644 index 0000000000..f1a2aaa5fe --- /dev/null +++ b/providers/okta/app_bookmark.go @@ -0,0 +1,64 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppBookmarkGenerator struct { + OktaService +} + +func (g AppBookmarkGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_bookmark", + "okta", + []string{})) + } + return resources +} + +func (g *AppBookmarkGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getBookmarkApplications(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(apps) + return nil +} + +func getBookmarkApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { + signOnMode := "BOOKMARK" + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return nil, err + } + + return apps, nil +} diff --git a/providers/okta/app_oauth.go b/providers/okta/app_oauth.go new file mode 100644 index 0000000000..2031a30ef9 --- /dev/null +++ b/providers/okta/app_oauth.go @@ -0,0 +1,64 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppOAuthGenerator struct { + OktaService +} + +func (g AppOAuthGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_oauth", + "okta", + []string{})) + } + return resources +} + +// Generate Terraform Resources from Okta API, +func (g *AppOAuthGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getOAuthApplications(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(apps) + return nil +} + +func getOAuthApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { + signOnMode := "OPENID_CONNECT" + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return nil, err + } + return apps, nil +} diff --git a/providers/okta/app_saml.go b/providers/okta/app_saml.go new file mode 100644 index 0000000000..a7bdee20f5 --- /dev/null +++ b/providers/okta/app_saml.go @@ -0,0 +1,57 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppSamlGenerator struct { + OktaService +} + +func (g AppSamlGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_saml", + "okta", + []string{})) + } + return resources +} + +func (g *AppSamlGenerator) InitResources() error { + signOnMode := []string{"SAML_1_1", "SAML_2_0"} + allSamlApps := []*okta.Application{} + for _, signOnMode := range signOnMode { + ctx, client, err := g.Client() + if err != nil { + return err + } + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return err + } + + allSamlApps = append(allSamlApps, apps...) + } + + g.Resources = g.createResources(allSamlApps) + return nil +} diff --git a/providers/okta/app_secure_password_store.go b/providers/okta/app_secure_password_store.go new file mode 100644 index 0000000000..6b5f93dd15 --- /dev/null +++ b/providers/okta/app_secure_password_store.go @@ -0,0 +1,64 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppSecurePasswordStoreGenerator struct { + OktaService +} + +func (g AppSecurePasswordStoreGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_secure_password_store", + "okta", + []string{})) + } + return resources +} + +func (g *AppSecurePasswordStoreGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getSecurePasswordStoreApplications(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(apps) + return nil +} + +func getSecurePasswordStoreApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { + signOnMode := "SECURE_PASSWORD_STORE" + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return nil, err + } + + return apps, nil +} diff --git a/providers/okta/app_swa.go b/providers/okta/app_swa.go new file mode 100644 index 0000000000..a34fe36086 --- /dev/null +++ b/providers/okta/app_swa.go @@ -0,0 +1,71 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppSWAGenerator struct { + OktaService +} + +func (g AppSWAGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_swa", + "okta", + []string{})) + } + return resources +} + +func (g *AppSWAGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getSWAApplications(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(apps) + return nil +} + +func getSWAApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { + signOnMode := "BROWSER_PLUGIN" + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return nil, err + } + + swaApps := []*okta.Application{} + for _, app := range apps { + if app.Name == "template_swa" { + swaApps = append(swaApps, app) + } + } + + return swaApps, nil +} diff --git a/providers/okta/app_three_field.go b/providers/okta/app_three_field.go new file mode 100644 index 0000000000..742b03eaab --- /dev/null +++ b/providers/okta/app_three_field.go @@ -0,0 +1,71 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppThreeFieldGenerator struct { + OktaService +} + +func (g AppThreeFieldGenerator) createResources(appList []*okta.Application) []terraformutils.Resource { + var resources []terraformutils.Resource + for _, app := range appList { + resources = append(resources, terraformutils.NewSimpleResource( + app.Id, + normalizeResourceName(app.Id+"_"+app.Name), + "okta_app_three_field", + "okta", + []string{})) + } + return resources +} + +func (g *AppThreeFieldGenerator) InitResources() error { + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getThreeFieldApplications(ctx, client) + if err != nil { + return err + } + + g.Resources = g.createResources(apps) + return nil +} + +func getThreeFieldApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { + signOnMode := "BROWSER_PLUGIN" + apps, err := getApplications(ctx, client, signOnMode) + if err != nil { + return nil, err + } + + threeFieldApps := []*okta.Application{} + for _, app := range apps { + if app.Name == "template_swa3field" { + threeFieldApps = append(threeFieldApps, app) + } + } + + return threeFieldApps, nil +} diff --git a/providers/okta/okta_provider.go b/providers/okta/okta_provider.go index dbc3005c07..dfe0fe0b9f 100644 --- a/providers/okta/okta_provider.go +++ b/providers/okta/okta_provider.go @@ -90,28 +90,36 @@ func (p *OktaProvider) InitService(serviceName string, verbose bool) error { func (p *OktaProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "okta_idp_oidc": &IdpOIDCGenerator{}, - "okta_idp_saml": &IdpSAMLGenerator{}, - "okta_idp_social": &IdpSocialGenerator{}, - "okta_factor": &FactorGenerator{}, - "okta_network_zone": &NetworkZoneGenerator{}, - "okta_trusted_origin": &TrustedOriginGenerator{}, - "okta_user": &UserGenerator{}, - "okta_template_sms": &SMSTemplateGenerator{}, - "okta_user_type": &UserTypeGenerator{}, - "okta_group": &GroupGenerator{}, - "okta_group_rule": &GroupRuleGenerator{}, - "okta_event_hook": &EventHookGenerator{}, - "okta_inline_hook": &EventHookGenerator{}, - "okta_policy_password": &PasswordPolicyGenerator{}, - "okta_policy_rule_password": &PasswordPolicyRuleGenerator{}, - "okta_policy_signon": &SignOnPolicyGenerator{}, - "okta_policy_rule_signon": &SignOnPolicyRuleGenerator{}, - "okta_policy_mfa": &MFAPolicyGenerator{}, - "okta_policy_rule_mfa": &MFAPolicyRuleGenerator{}, - "okta_auth_server": &AuthorizationServerGenerator{}, - "okta_auth_server_scope": &AuthorizationServerScopeGenerator{}, - "okta_auth_server_claim": &AuthorizationServerClaimGenerator{}, - "okta_auth_server_policy": &AuthorizationServerPolicyGenerator{}, + "okta_app_three_field": &AppThreeFieldGenerator{}, + "okta_app_swa": &AppSWAGenerator{}, + "okta_app_secure_password_store": &AppSecurePasswordStoreGenerator{}, + "okta_app_basic_auth": &AppBasicAuthGenerator{}, + "okta_app_auto_login": &AppAutoLoginGenerator{}, + "okta_app_bookmark": &AppBookmarkGenerator{}, + "okta_app_saml": &AppSamlGenerator{}, + "okta_app_oauth": &AppOAuthGenerator{}, + "okta_idp_oidc": &IdpOIDCGenerator{}, + "okta_idp_saml": &IdpSAMLGenerator{}, + "okta_idp_social": &IdpSocialGenerator{}, + "okta_factor": &FactorGenerator{}, + "okta_network_zone": &NetworkZoneGenerator{}, + "okta_trusted_origin": &TrustedOriginGenerator{}, + "okta_user": &UserGenerator{}, + "okta_template_sms": &SMSTemplateGenerator{}, + "okta_user_type": &UserTypeGenerator{}, + "okta_group": &GroupGenerator{}, + "okta_group_rule": &GroupRuleGenerator{}, + "okta_event_hook": &EventHookGenerator{}, + "okta_inline_hook": &EventHookGenerator{}, + "okta_policy_password": &PasswordPolicyGenerator{}, + "okta_policy_rule_password": &PasswordPolicyRuleGenerator{}, + "okta_policy_signon": &SignOnPolicyGenerator{}, + "okta_policy_rule_signon": &SignOnPolicyRuleGenerator{}, + "okta_policy_mfa": &MFAPolicyGenerator{}, + "okta_policy_rule_mfa": &MFAPolicyRuleGenerator{}, + "okta_auth_server": &AuthorizationServerGenerator{}, + "okta_auth_server_scope": &AuthorizationServerScopeGenerator{}, + "okta_auth_server_claim": &AuthorizationServerClaimGenerator{}, + "okta_auth_server_policy": &AuthorizationServerPolicyGenerator{}, } } From c4616fa4d0dc717274119db6ee3b12a42ff91e6e Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Wed, 1 Sep 2021 16:19:01 -0400 Subject: [PATCH 224/276] add manage_status_definition.*.query to allowempty (#1037) --- providers/datadog/dashboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/datadog/dashboard.go b/providers/datadog/dashboard.go index 5bfb74d567..1bbdfed6c1 100644 --- a/providers/datadog/dashboard.go +++ b/providers/datadog/dashboard.go @@ -25,7 +25,7 @@ import ( var ( // DashboardAllowEmptyValues ... - DashboardAllowEmptyValues = []string{"tags."} + DashboardAllowEmptyValues = []string{"tags.", "manage_status_definition.*.query"} ) // DashboardGenerator ... From 72d2eab6fdd181e2517a9baf029cbe9abd921a0e Mon Sep 17 00:00:00 2001 From: Takumi Sato Date: Thu, 2 Sep 2021 05:20:19 +0900 Subject: [PATCH 225/276] fix to accept PAGERDUTY_TOKEN in env for PagerDuty (#1035) --- providers/pagerduty/pagerduty_provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/pagerduty/pagerduty_provider.go b/providers/pagerduty/pagerduty_provider.go index 96599ec1c1..7abd0ea64a 100644 --- a/providers/pagerduty/pagerduty_provider.go +++ b/providers/pagerduty/pagerduty_provider.go @@ -31,7 +31,7 @@ func (p *PagerDutyProvider) Init(args []string) error { if token := os.Getenv("PAGERDUTY_TOKEN"); token != "" { p.token = os.Getenv("PAGERDUTY_TOKEN") } - if len(args) > 0 { + if len(args) > 0 && args[0] != "" { p.token = args[0] } return nil From 9af5103fa66cee552b1fe0871eadf6c64a672cff Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Wed, 1 Sep 2021 16:21:18 -0400 Subject: [PATCH 226/276] Update DD client to latest and remove support for timeboard + screenboard resource (#1028) * remove timeboard+screenboard resource * go mod tidy and update alicloud resources --- go.mod | 4 +- go.sum | 8 ++-- providers/alicloud/dns.go | 8 ++-- providers/alicloud/pvtz.go | 4 +- providers/alicloud/ram.go | 12 ++--- providers/datadog/datadog_provider.go | 2 - providers/datadog/screenboard.go | 67 --------------------------- providers/datadog/timeboard.go | 67 --------------------------- 8 files changed, 18 insertions(+), 154 deletions(-) delete mode 100644 providers/datadog/screenboard.go delete mode 100644 providers/datadog/timeboard.go diff --git a/go.mod b/go.mod index b2ea88c8f3..cdbfdabdd1 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/PaloAltoNetworks/pango v0.6.0 github.com/SAP/go-hdb v0.105.2 // indirect github.com/SermoDigital/jose v0.9.1 // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 + github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 github.com/aws/aws-sdk-go-v2 v1.4.0 @@ -307,7 +307,7 @@ require ( gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/square/go-jose.v2 v2.5.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 0befd2ea51..d97499287d 100644 --- a/go.sum +++ b/go.sum @@ -164,8 +164,8 @@ github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/g github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= -github.com/aliyun/alibaba-cloud-sdk-go v1.60.295 h1:oUQYOKpPm4h7shYEdPJ0T8EzVpu7Zz34qTof9XaMDxY= -github.com/aliyun/alibaba-cloud-sdk-go v1.60.295/go.mod h1:mNZkuqaeM5UCiAdkV4r+lrheu8Q5fe/487bRFrGYZ8A= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247 h1:2RSX5oi4GuhZnOpuW5EA6618G8mvP1X88o/4rleB5/A= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247/go.mod h1:9CMdKNL3ynIGPpfTcdwTvIm8SGuAZYYC4jFVSSvE1YQ= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= @@ -1137,7 +1137,6 @@ github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1713,8 +1712,9 @@ gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdOD gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= diff --git a/providers/alicloud/dns.go b/providers/alicloud/dns.go index e434475b35..37f0f73550 100644 --- a/providers/alicloud/dns.go +++ b/providers/alicloud/dns.go @@ -26,7 +26,7 @@ type DNSGenerator struct { AliCloudService } -func resourceFromDomain(domain alidns.Domain) terraformutils.Resource { +func resourceFromDomain(domain alidns.DomainInDescribeDomains) terraformutils.Resource { return terraformutils.NewResource( domain.DomainName, // id domain.DomainId+"__"+domain.DomainName, // nolint @@ -50,12 +50,12 @@ func resourceFromDomainRecord(record alidns.Record) terraformutils.Resource { ) } -func initDomains(client *connectivity.AliyunClient) ([]alidns.Domain, error) { +func initDomains(client *connectivity.AliyunClient) ([]alidns.DomainInDescribeDomains, error) { remaining := 1 pageNumber := 1 pageSize := 10 - allDomains := make([]alidns.Domain, 0) + allDomains := make([]alidns.DomainInDescribeDomains, 0) for remaining > 0 { raw, err := client.WithDNSClient(func(alidnsClient *alidns.Client) (interface{}, error) { @@ -78,7 +78,7 @@ func initDomains(client *connectivity.AliyunClient) ([]alidns.Domain, error) { return allDomains, nil } -func initDomainRecords(client *connectivity.AliyunClient, allDomains []alidns.Domain) ([]alidns.Record, error) { +func initDomainRecords(client *connectivity.AliyunClient, allDomains []alidns.DomainInDescribeDomains) ([]alidns.Record, error) { allDomainRecords := make([]alidns.Record, 0) for _, domain := range allDomains { diff --git a/providers/alicloud/pvtz.go b/providers/alicloud/pvtz.go index adcc653229..6a57fcd566 100644 --- a/providers/alicloud/pvtz.go +++ b/providers/alicloud/pvtz.go @@ -54,8 +54,8 @@ func resourceFromZoneAttachmentResponse(zone pvtz.Zone) terraformutils.Resource func resourceFromZoneRecordResponse(record pvtz.Record, zoneID string) terraformutils.Resource { return terraformutils.NewResource( - strconv.Itoa(record.RecordId)+":"+zoneID, // id - strconv.Itoa(record.RecordId)+"__"+record.Rr, // name + strconv.FormatInt(record.RecordId, 10)+":"+zoneID, // id + strconv.FormatInt(record.RecordId, 10)+"__"+record.Rr, // name "alicloud_pvtz_zone_record", "alicloud", map[string]string{}, diff --git a/providers/alicloud/ram.go b/providers/alicloud/ram.go index be275c236c..73768220ff 100644 --- a/providers/alicloud/ram.go +++ b/providers/alicloud/ram.go @@ -27,7 +27,7 @@ type RAMGenerator struct { AliCloudService } -func resourceFromRAMRole(role ram.Role) terraformutils.Resource { +func resourceFromRAMRole(role ram.RoleInListRoles) terraformutils.Resource { return terraformutils.NewResource( role.RoleName, // id role.RoleId+"__"+role.RoleName, // name @@ -39,7 +39,7 @@ func resourceFromRAMRole(role ram.Role) terraformutils.Resource { ) } -func resourceFromRAMPolicy(policy ram.Policy, roleName string) terraformutils.Resource { +func resourceFromRAMPolicy(policy ram.PolicyInListPoliciesForRole, roleName string) terraformutils.Resource { // https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/alicloud/resource_alicloud_ram_role_policy_attachment.go#L93 id := strings.Join([]string{"role", policy.PolicyName, policy.PolicyType, roleName}, ":") @@ -54,8 +54,8 @@ func resourceFromRAMPolicy(policy ram.Policy, roleName string) terraformutils.Re ) } -func initRoles(client *connectivity.AliyunClient) ([]ram.Role, error) { - allRoles := make([]ram.Role, 0) +func initRoles(client *connectivity.AliyunClient) ([]ram.RoleInListRoles, error) { + allRoles := make([]ram.RoleInListRoles, 0) raw, err := client.WithRAMClient(func(ramClient *ram.Client) (interface{}, error) { request := ram.CreateListRolesRequest() @@ -72,8 +72,8 @@ func initRoles(client *connectivity.AliyunClient) ([]ram.Role, error) { return allRoles, nil } -func initRAMPolicyAttachment(client *connectivity.AliyunClient, allRoles []ram.Role) ([]ram.Policy, []string, error) { - allRAMPolicies := make([]ram.Policy, 0) +func initRAMPolicyAttachment(client *connectivity.AliyunClient, allRoles []ram.RoleInListRoles) ([]ram.PolicyInListPoliciesForRole, []string, error) { + allRAMPolicies := make([]ram.PolicyInListPoliciesForRole, 0) roleNames := make([]string, 0) for _, role := range allRoles { diff --git a/providers/datadog/datadog_provider.go b/providers/datadog/datadog_provider.go index 212b56d2f5..79a556f11e 100644 --- a/providers/datadog/datadog_provider.go +++ b/providers/datadog/datadog_provider.go @@ -217,14 +217,12 @@ func (p *DatadogProvider) GetSupportedService() map[string]terraformutils.Servic "integration_slack_channel": &IntegrationSlackChannelGenerator{}, "metric_metadata": &MetricMetadataGenerator{}, "monitor": &MonitorGenerator{}, - "screenboard": &ScreenboardGenerator{}, "security_monitoring_default_rule": &SecurityMonitoringDefaultRuleGenerator{}, "security_monitoring_rule": &SecurityMonitoringRuleGenerator{}, "service_level_objective": &ServiceLevelObjectiveGenerator{}, "synthetics_test": &SyntheticsTestGenerator{}, "synthetics_global_variable": &SyntheticsGlobalVariableGenerator{}, "synthetics_private_location": &SyntheticsPrivateLocationGenerator{}, - "timeboard": &TimeboardGenerator{}, "user": &UserGenerator{}, "role": &RoleGenerator{}, } diff --git a/providers/datadog/screenboard.go b/providers/datadog/screenboard.go deleted file mode 100644 index 73e468e86c..0000000000 --- a/providers/datadog/screenboard.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2018 The Terraformer Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package datadog - -import ( - "fmt" - "strconv" - - datadog "github.com/zorkian/go-datadog-api" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" -) - -var ( - // ScreenboardAllowEmptyValues ... - ScreenboardAllowEmptyValues = []string{"tags."} -) - -// ScreenboardGenerator ... -type ScreenboardGenerator struct { - DatadogService -} - -func (ScreenboardGenerator) createResources(screenboards []*datadog.ScreenboardLite) []terraformutils.Resource { - resources := []terraformutils.Resource{} - for _, screenboard := range screenboards { - resourceName := strconv.Itoa(screenboard.GetId()) - resources = append(resources, terraformutils.NewSimpleResource( - resourceName, - fmt.Sprintf("screenboard_%s", resourceName), - "datadog_screenboard", - "datadog", - ScreenboardAllowEmptyValues, - )) - } - - return resources -} - -// InitResources Generate TerraformResources from Datadog API, -// from each screenboard create 1 TerraformResource. -// Need Screenboard ID as ID for terraform resource -func (g *ScreenboardGenerator) InitResources() error { - client := datadog.NewClient(g.Args["api-key"].(string), g.Args["app-key"].(string)) - _, err := client.Validate() - if err != nil { - return err - } - screenboards, err := client.GetScreenboards() - if err != nil { - return err - } - g.Resources = g.createResources(screenboards) - return nil -} diff --git a/providers/datadog/timeboard.go b/providers/datadog/timeboard.go deleted file mode 100644 index 1b1414415b..0000000000 --- a/providers/datadog/timeboard.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2018 The Terraformer Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package datadog - -import ( - "fmt" - "strconv" - - datadog "github.com/zorkian/go-datadog-api" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" -) - -var ( - // TimeboardAllowEmptyValues ... - TimeboardAllowEmptyValues = []string{"tags."} -) - -// TimeboardGenerator ... -type TimeboardGenerator struct { - DatadogService -} - -func (TimeboardGenerator) createResources(timeboards []datadog.DashboardLite) []terraformutils.Resource { - resources := []terraformutils.Resource{} - for _, timeboard := range timeboards { - resourceName := strconv.Itoa(timeboard.GetId()) - resources = append(resources, terraformutils.NewSimpleResource( - resourceName, - fmt.Sprintf("timeboard_%s", resourceName), - "datadog_timeboard", - "datadog", - TimeboardAllowEmptyValues, - )) - } - - return resources -} - -// InitResources Generate TerraformResources from Datadog API, -// from each timeboard create 1 TerraformResource. -// Need Timeboard ID as ID for terraform resource -func (g *TimeboardGenerator) InitResources() error { - client := datadog.NewClient(g.Args["api-key"].(string), g.Args["app-key"].(string)) - _, err := client.Validate() - if err != nil { - return err - } - timeboards, err := client.GetDashboards() - if err != nil { - return err - } - g.Resources = g.createResources(timeboards) - return nil -} From 659a93cbd4c03d5d23a166e80e95c0aeeec3e1c9 Mon Sep 17 00:00:00 2001 From: Cristobal Silva Date: Wed, 1 Sep 2021 15:47:02 -0500 Subject: [PATCH 227/276] Fix aws codebuild pagination (#1036) --- providers/aws/codebuild.go | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/providers/aws/codebuild.go b/providers/aws/codebuild.go index 74a2087a9d..8887566ea2 100644 --- a/providers/aws/codebuild.go +++ b/providers/aws/codebuild.go @@ -27,19 +27,6 @@ type CodeBuildGenerator struct { AWSService } -func (g *CodeBuildGenerator) createResources(projectList []string) []terraformutils.Resource { - var resources []terraformutils.Resource - for _, project := range projectList { - resources = append(resources, terraformutils.NewSimpleResource( - project, - project, - "aws_codebuild_project", - "aws", - codebuildAllowEmptyValues)) - } - return resources -} - func (g *CodeBuildGenerator) InitResources() error { config, e := g.generateConfig() if e != nil { @@ -52,7 +39,14 @@ func (g *CodeBuildGenerator) InitResources() error { if e != nil { return e } - g.Resources = g.createResources(page.Projects) + for _, project := range page.Projects { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + project, + project, + "aws_codebuild_project", + "aws", + codebuildAllowEmptyValues)) + } } return nil } From d0755e2934d69efb39ab728ca921d140b34feef7 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Thu, 2 Sep 2021 22:55:42 -0300 Subject: [PATCH 228/276] azurerm add databricks support (#1038) * azurerm: added databricks as 2.74.0 * azurerm: refactored some shared helpers * azurerm: added resources for data_factory --- providers/azure/azure_provider.go | 4 ++ providers/azure/data_factory.go | 76 +++++++++++++++++-------------- providers/azure/databricks.go | 72 +++++++++++++++++++++++++++++ providers/azure/helper.go | 25 ++++++++++ 4 files changed, 143 insertions(+), 34 deletions(-) create mode 100644 providers/azure/databricks.go diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index f031a5b56c..85355c990a 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -157,6 +157,9 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "database": { "resource_group": []string{"resource_group_name", "name"}, }, + "databricks": { + "resource_group": []string{"resource_group_name", "name"}, + }, "data_factory": { "resource_group": []string{"resource_group_name", "name"}, }, @@ -216,6 +219,7 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG "cosmosdb": &CosmosDBGenerator{}, "container": &ContainerGenerator{}, "database": &DatabasesGenerator{}, + "databricks": &DatabricksGenerator{}, "data_factory": &DataFactoryGenerator{}, "disk": &DiskGenerator{}, "dns": &DNSGenerator{}, diff --git a/providers/azure/data_factory.go b/providers/azure/data_factory.go index 15684a7a75..81fdaeb7fb 100644 --- a/providers/azure/data_factory.go +++ b/providers/azure/data_factory.go @@ -5,10 +5,6 @@ import ( "fmt" "log" "reflect" - "strings" - - "github.com/Azure/go-autorest/autorest" - "github.com/hashicorp/go-azure-helpers/authentication" "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -20,16 +16,17 @@ type DataFactoryGenerator struct { // Maps item.Properties.Type -> terraform.ResoruceType // Information extracted from -// SupportedResources -// @ github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory/registration.go -// PossibleTypeBasicDatasetValues, PossibleTypeBasicIntegrationRuntimeValues, PossibleTypeBasicLinkedServiceValues +// SupportedResources are in: // @ github.com/azure/azure-sdk-for-go@v42.3.0+incompatible/services/datafactory/mgmt/2018-06-01/datafactory/models.go +// PossibleTypeBasicDatasetValues, PossibleTypeBasicIntegrationRuntimeValues, PossibleTypeBasicLinkedServiceValues, PossibleTypeBasicTriggerValues +// TypeBasicDataset,TypeBasicIntegrationRuntime, TypeBasicLinkedService, TypeBasicTrigger, TypeBasicDataFlow var ( SupportedResources = map[string]string{ - "ScheduleTrigger": "azurerm_data_factory_trigger_schedule", "AzureBlob": "azurerm_data_factory_dataset_azure_blob", + "Binary": "azurerm_data_factory_dataset_binary", "CosmosDbSqlApiCollection": "azurerm_data_factory_dataset_cosmosdb_sqlapi", + "CustomDataset": "azurerm_data_factory_custom_dataset", "DelimitedText": "azurerm_data_factory_dataset_delimited_text", "HttpFile": "azurerm_data_factory_dataset_http", "Json": "azurerm_data_factory_dataset_json", @@ -49,6 +46,7 @@ var ( "AzureSqlDatabase": "azurerm_data_factory_linked_service_azure_sql_database", "AzureTableStorage": "azurerm_data_factory_linked_service_azure_table_storage", "CosmosDb": "azurerm_data_factory_linked_service_cosmosdb", + "CustomDataSource": "azurerm_data_factory_linked_custom_service", "AzureBlobFS": "azurerm_data_factory_linked_service_data_lake_storage_gen2", "AzureKeyVault": "azurerm_data_factory_linked_service_key_vault", "AzureDataExplore": "azurerm_data_factory_linked_service_kusto", @@ -60,6 +58,9 @@ var ( "SqlServer": "azurerm_data_factory_linked_service_sql_server", "AzureSqlDW": "azurerm_data_factory_linked_service_synapse", "Web": "azurerm_data_factory_linked_service_web", + "BlobEventsTrigger": "azurerm_data_factory_trigger_blob_event", + "ScheduleTrigger": "azurerm_data_factory_trigger_schedule", + "TumblingWindowTrigger": "azurerm_data_factory_trigger_tumbling_window", } ) @@ -95,27 +96,12 @@ func (g *DataFactoryGenerator) appendResourceFrom(resources []terraformutils.Res msg := fmt.Sprintf(`azurerm_data_factory: resource "%s" id: %s type: %s not handled yet by terraform or terraformer`, name, id, azureType) log.Println(msg) } else { - resources = g.appendResourceAs(resources, id, name, resourceType) + resources = g.appendResourceAs(resources, id, name, resourceType, "adf") } } return resources } -func (g *DataFactoryGenerator) appendResourceAs(resources []terraformutils.Resource, itemID string, itemName string, resourceType string) []terraformutils.Resource { - prefix := strings.ReplaceAll(resourceType, "azurerm_data_factory", "adf") - suffix := strings.ReplaceAll(itemName, "-", "_") - resourceName := prefix + "_" + suffix - res := terraformutils.NewSimpleResource(itemID, resourceName, resourceType, g.ProviderName, []string{}) - resources = append(resources, res) - return resources -} - -func (g *DataFactoryGenerator) getArgsProperties() (subscriptionID string, authorizer autorest.Authorizer) { - subs := g.Args["config"].(authentication.Config).SubscriptionID - auth := g.Args["authorizer"].(autorest.Authorizer) - return subs, auth -} - func (g *DataFactoryGenerator) listFactories() ([]datafactory.Factory, error) { subscriptionID, authorizer := g.getArgsProperties() client := datafactory.NewFactoriesClient(subscriptionID) @@ -148,7 +134,7 @@ func (g *DataFactoryGenerator) listFactories() ([]datafactory.Factory, error) { func (g *DataFactoryGenerator) createDataFactoryResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { var resources []terraformutils.Resource for _, item := range dataFactories { - resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory") + resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory", "adf") } return resources, nil } @@ -187,7 +173,7 @@ func (g *DataFactoryGenerator) createIntegrationRuntimesResources(dataFactories for iterator.NotDone() { item := iterator.Value() resourceType := getIntegrationRuntimeType(item.Properties) - resources = g.appendResourceAs(resources, *item.ID, *item.Name, resourceType) + resources = g.appendResourceAs(resources, *item.ID, *item.Name, resourceType, "adf") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -241,7 +227,7 @@ func (g *DataFactoryGenerator) createPipelineResources(dataFactories []datafacto } for iterator.NotDone() { item := iterator.Value() - resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_pipeline") + resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_pipeline", "adf") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -268,7 +254,34 @@ func (g *DataFactoryGenerator) createPipelineTriggerScheduleResources(dataFactor } for iterator.NotDone() { item := iterator.Value() - resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_trigger_schedule") + resources = g.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + } + return resources, nil +} + +func (g *DataFactoryGenerator) createDataFlowResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, authorizer := g.getArgsProperties() + client := datafactory.NewDataFlowsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + var resources []terraformutils.Resource + for _, factory := range dataFactories { + id, err := ParseAzureResourceID(*factory.ID) + if err != nil { + return nil, err + } + iterator, err := client.ListByFactoryComplete(ctx, id.ResourceGroup, *factory.Name) + if err != nil { + return nil, err + } + for iterator.NotDone() { + item := iterator.Value() + resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_data_flow", "adf") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -319,6 +332,7 @@ func (g *DataFactoryGenerator) InitResources() error { g.createPipelineResources, g.createPipelineTriggerScheduleResources, g.createPipelineDatasetResources, + g.createDataFlowResources, } for _, f := range factoriesFunctions { @@ -331,12 +345,6 @@ func (g *DataFactoryGenerator) InitResources() error { return nil } -func asHereDoc(json string) string { - return fmt.Sprintf(`< Date: Tue, 7 Sep 2021 03:25:14 -0400 Subject: [PATCH 229/276] build: bump go-fastly to 3.9.3 (#1039) Signed-off-by: Rui Chen --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index cdbfdabdd1..f3c6d38e37 100644 --- a/go.mod +++ b/go.mod @@ -112,7 +112,7 @@ require ( github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/duosecurity/duo_api_golang v0.0.0-20201112143038-0e07e9f869e3 // indirect github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect - github.com/fastly/go-fastly/v3 v3.6.0 + github.com/fastly/go-fastly/v3 v3.9.3 github.com/fatih/structs v1.1.0 // indirect github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d // indirect github.com/google/go-github/v35 v35.1.0 diff --git a/go.sum b/go.sum index d97499287d..d551a735af 100644 --- a/go.sum +++ b/go.sum @@ -112,8 +112,6 @@ github.com/IBM/ibm-cos-sdk-go v1.5.0 h1:YCmAgsdtp/irQep5g+62OvjLNj35tMXLqTC5jQ+Y github.com/IBM/ibm-cos-sdk-go v1.5.0/go.mod h1:4mqv/ejW1PKW+Ij6ytU+W8j1UZeLmSEsR5K+flBaWMY= github.com/IBM/keyprotect-go-client v0.6.0 h1:jZExoYSaoQ5TrfEzPOmBLc1vJ0VWA0RfKC+Bx39IeGo= github.com/IBM/keyprotect-go-client v0.6.0/go.mod h1:SVr2ylV/fhSQPDiUjWirN9fsyWFCNNbt8GIT8hPJVjE= -github.com/IBM/networking-go-sdk v0.13.0 h1:MKDL0c5Gnc6BT10lCS1S1pZVz71UmX4mJC4eXQqWwHE= -github.com/IBM/networking-go-sdk v0.13.0/go.mod h1:3/QnBTwCXAWoz98dw3z37UUfpkIwAwi8qDGntNt6F6A= github.com/IBM/networking-go-sdk v0.19.0 h1:oXmRZPLnL28OE7bVRJLvKB6vGYjCG58pLWAeTjVBajs= github.com/IBM/networking-go-sdk v0.19.0/go.mod h1:nViqUm1Bv+ke8dyOhjQ6e+2U1XeqZX2y4bQbR8Od3Hc= github.com/IBM/platform-services-go-sdk v0.19.1 h1:RDxIHiqmxQWSYrJGm4oGSvvbKg4TXY1ox53ORsX6zvE= @@ -487,8 +485,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y 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/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fastly/go-fastly/v3 v3.6.0 h1:sRnI+MhyMkgZbQWaUnhr70gHk39kfpG9JpMUlSoIsCg= -github.com/fastly/go-fastly/v3 v3.6.0/go.mod h1:KOaCWsmkIKSASPzADl8PT/bTQIghOw/eEaxlHOu3jMA= +github.com/fastly/go-fastly/v3 v3.9.3 h1:/uwbNqS3zU9QaAXeSlZ3zXjF1fBw7CdoPj6RQLQm/bg= +github.com/fastly/go-fastly/v3 v3.9.3/go.mod h1:KOaCWsmkIKSASPzADl8PT/bTQIghOw/eEaxlHOu3jMA= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= From 3903c187b94d9928d8a71649c82c850f6c119904 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Wed, 8 Sep 2021 10:07:41 -0300 Subject: [PATCH 230/276] azurerm: added synapse eventhub purview (#1040) * azurerm: updated datafactory docs * : azurerm: upgraded azure-sdk-for-go to v55.8.0 * upgraded azure-sdk-for-go from v42.3.0 to v55.8.0 * fixed changes in cosmosdb api * upgrade required for azure synapse * azurerm: added synapse * azurerm: refactor helpers * azurerm: upgraded to v57.1.0 * required for purview * azurerm: added purview * azurerm: added eventhub * azurerm: fix ci warnings --- docs/azure.md | 37 +++++- go.mod | 10 +- go.sum | 14 +- providers/azure/azure_provider.go | 28 ++++ providers/azure/cosmosdb.go | 16 +-- providers/azure/data_factory.go | 90 +++++++------ providers/azure/databricks.go | 35 ++--- providers/azure/eventhub.go | 135 ++++++++++++++++++++ providers/azure/helper.go | 19 --- providers/azure/purview.go | 57 +++++++++ providers/azure/synapse.go | 205 ++++++++++++++++++++++++++++++ 11 files changed, 532 insertions(+), 114 deletions(-) create mode 100644 providers/azure/eventhub.go create mode 100644 providers/azure/purview.go create mode 100644 providers/azure/synapse.go diff --git a/docs/azure.md b/docs/azure.md index 3f67679625..d1a5460e4e 100644 --- a/docs/azure.md +++ b/docs/azure.md @@ -1,9 +1,10 @@ -### Use with Azure -Support [Azure CLI](https://www.terraform.io/docs/providers/azurerm/guides/azure_cli.html), [Service Principal with Client Certificate](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_certificate.html) & [Service Principal with Client Secret](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_secret.html) +# Use with Azure -Example: +Supports [Azure CLI](https://www.terraform.io/docs/providers/azurerm/guides/azure_cli.html), [Service Principal with Client Certificate](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_certificate.html), and [Service Principal with Client Secret](https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_secret.html). -``` +## Example + +``` sh # Using Azure CLI (az login) export ARM_SUBSCRIPTION_ID=[SUBSCRIPTION_ID] @@ -24,7 +25,7 @@ export ARM_TENANT_ID=[TENANT_ID] ./terraformer import azure -R my_resource_group -r virtual_network,resource_group ``` -List of supported Azure resources: +## List of supported Azure resources * `analysis` * `azurerm_analysis_services_server` @@ -62,12 +63,16 @@ List of supported Azure resources: * `azurerm_sql_firewall_rule` * `azurerm_sql_server` * `azurerm_sql_virtual_network_rule` +* `databricks` + * `azurerm_databricks_workspace` * `data_factory` * `azurerm_data_factory` * `azurerm_data_factory_pipeline` - * `azurerm_data_factory_trigger_schedule` + * `azurerm_data_factory_data_flow` * `azurerm_data_factory_dataset_azure_blob` + * `azurerm_data_factory_dataset_binary` * `azurerm_data_factory_dataset_cosmosdb_sqlapi` + * `azurerm_data_factory_custom_dataset` * `azurerm_data_factory_dataset_delimited_text` * `azurerm_data_factory_dataset_http` * `azurerm_data_factory_dataset_json` @@ -88,6 +93,7 @@ List of supported Azure resources: * `azurerm_data_factory_linked_service_azure_sql_database` * `azurerm_data_factory_linked_service_azure_table_storage` * `azurerm_data_factory_linked_service_cosmosdb` + * `azurerm_data_factory_linked_custom_service` * `azurerm_data_factory_linked_service_data_lake_storage_gen2` * `azurerm_data_factory_linked_service_key_vault` * `azurerm_data_factory_linked_service_kusto` @@ -99,6 +105,9 @@ List of supported Azure resources: * `azurerm_data_factory_linked_service_sql_server` * `azurerm_data_factory_linked_service_synapse` * `azurerm_data_factory_linked_service_web` + * `azurerm_data_factory_trigger_blob_event` + * `azurerm_data_factory_trigger_schedule` + * `azurerm_data_factory_trigger_tumbling_window` * `disk` * `azurerm_managed_disk` * `dns` @@ -117,6 +126,11 @@ List of supported Azure resources: * `azurerm_lb_backend_address_pool` * `azurerm_lb_nat_rule` * `azurerm_lb_probe` +* `eventhub` + * `azurerm_eventhub_namespace` + * `azurerm_eventhub` + * `azurerm_eventhub_consumer_group` + * `azurerm_eventhub_namespace_authorization_rule` * `network_interface` * `azurerm_network_interface` * `network_security_group` @@ -135,7 +149,9 @@ List of supported Azure resources: * `azurerm_public_ip` * `azurerm_public_ip_prefix` * `redis` - * `azurerm_redis_cache + * `azurerm_redis_cache` +* `purview` + * `azurerm_purview_account` * `resource_group` * `azurerm_resource_group` * `scaleset` @@ -147,6 +163,13 @@ List of supported Azure resources: * `azurerm_storage_account` * `azurerm_storage_blob` * `azurerm_storage_container` +* `synapse` + * `azurerm_synapse_workspace` + * `azurerm_synapse_sql_pool` + * `azurerm_synapse_spark_pool` + * `azurerm_synapse_firewall_rule` + * `azurerm_synapse_managed_private_endpoint` + * `azurerm_synapse_private_link_hub` * `virtual_machine` * `azurerm_virtual_machine` * `virtual_network` diff --git a/go.mod b/go.mod index f3c6d38e37..3ed139b43b 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,10 @@ require ( cloud.google.com/go v0.77.0 cloud.google.com/go/logging v1.1.2 cloud.google.com/go/storage v1.14.0 - github.com/Azure/azure-sdk-for-go v42.3.0+incompatible + github.com/Azure/azure-sdk-for-go v57.1.0+incompatible github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/Azure/go-autorest/autorest v0.11.12 + github.com/Azure/go-autorest/autorest v0.11.20 github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 github.com/IBM/go-sdk-core/v3 v3.3.1 @@ -171,12 +171,12 @@ require ( require ( github.com/Azure/azure-pipeline-go v0.2.2 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.5 // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect github.com/Azure/go-autorest/autorest/azure/cli v0.2.0 // indirect github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect - github.com/Azure/go-autorest/logger v0.2.0 // indirect + github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/BurntSushi/toml v0.3.1 // indirect github.com/IBM/go-sdk-core/v5 v5.5.1 // indirect @@ -220,6 +220,7 @@ require ( github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 // indirect github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730 // indirect github.com/go-stack/stack v1.8.0 // indirect + github.com/gofrs/uuid v3.2.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.5.0 // indirect @@ -280,7 +281,6 @@ require ( github.com/pelletier/go-toml v1.7.0 // indirect github.com/posener/complete v1.2.1 // indirect github.com/russellhaering/goxmldsig v1.1.0 // indirect - github.com/satori/go.uuid v1.2.0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 // indirect github.com/spf13/afero v1.2.2 // indirect diff --git a/go.sum b/go.sum index d551a735af..f060a142f2 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v36.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v42.3.0+incompatible h1:PAHkmPqd/vQV4LJcqzEUM1elCyTMWjbrO8oFMl0dvBE= -github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v57.1.0+incompatible h1:TKQ3ieyB0vVKkF6t9dsWbMjq56O1xU3eh3Ec09v6ajM= +github.com/Azure/azure-sdk-for-go v57.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.10.0 h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs= github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESNmQdijykocJ0YOxmMX8SE= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= @@ -58,13 +58,15 @@ github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.12 h1:gI8ytXbxMfI+IVbI9mP2JGCTXIuhHLgRlvQ9X4PsnHE= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest v0.11.20 h1:s8H1PbCZSqg/DH7JMlOz6YMig6htWLNPsjDdlLqCx3M= +github.com/Azure/go-autorest/autorest v0.11.20/go.mod h1:o3tqFY+QR40VOlk+pV4d77mORO64jOXSgEnPQgLK6JY= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/azure/cli v0.2.0 h1:pSwNMF0qotgehbQNllUWwJ4V3vnrLKOzHrwDLEZK904= github.com/Azure/go-autorest/autorest/azure/cli v0.2.0/go.mod h1:WWTbGPvkAg3I4ms2j2s+Zr5xCGwGqTQh+6M2ZqOczkE= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= @@ -81,8 +83,9 @@ github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsI github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= @@ -1114,7 +1117,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index 85355c990a..ffa3afa73f 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -169,6 +169,9 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "dns": { "resource_group": []string{"resource_group_name", "name"}, }, + "eventhub": { + "resource_group": []string{"resource_group_name", "name"}, + }, "keyvault": { "resource_group": []string{"resource_group_name", "name"}, }, @@ -187,6 +190,9 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "public_ip": { "resource_group": []string{"resource_group_name", "name"}, }, + "purview": { + "resource_group": []string{"resource_group_name", "name"}, + }, "redis": { "resource_group": []string{"resource_group_name", "name"}, }, @@ -203,6 +209,9 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "storage_container": { "storage_account": []string{"storage_account_name", "name"}, }, + "synapse": { + "resource_group": []string{"resource_group_name", "name"}, + }, "virtual_machine": { "resource_group": []string{"resource_group_name", "name"}, }, @@ -223,12 +232,14 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG "data_factory": &DataFactoryGenerator{}, "disk": &DiskGenerator{}, "dns": &DNSGenerator{}, + "eventhub": &EventHubGenerator{}, "keyvault": &KeyVaultGenerator{}, "load_balancer": &LoadBalancerGenerator{}, "network_interface": &NetworkInterfaceGenerator{}, "network_security_group": &NetworkSecurityGroupGenerator{}, "private_dns": &PrivateDNSGenerator{}, "public_ip": &PublicIPGenerator{}, + "purview": &PurviewGenerator{}, "redis": &RedisGenerator{}, "resource_group": &ResourceGroupGenerator{}, "scaleset": &ScaleSetGenerator{}, @@ -237,6 +248,7 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG "storage_account": &StorageAccountGenerator{}, "storage_blob": &StorageBlobGenerator{}, "storage_container": &StorageContainerGenerator{}, + "synapse": &SynapseGenerator{}, "virtual_machine": &VirtualMachineGenerator{}, "virtual_network": &VirtualNetworkGenerator{}, } @@ -258,3 +270,19 @@ func (p *AzureProvider) InitService(serviceName string, verbose bool) error { }) return nil } + +func (p *AzureService) getClientArgs() (subscriptionID string, resourceGroup string, authorizer autorest.Authorizer) { + subs := p.Args["config"].(authentication.Config).SubscriptionID + auth := p.Args["authorizer"].(autorest.Authorizer) + resg := p.Args["resource_group"].(string) + return subs, resg, auth +} + +func (p *AzureService) AppendSimpleResource(itemID string, itemName string, resourceType string, abbreviation string) { + resourceName := strings.ReplaceAll(itemName, "-", "_") + if abbreviation != "" { + resourceName = abbreviation + "_" + resourceName + } + newResource := terraformutils.NewSimpleResource(itemID, resourceName, resourceType, p.ProviderName, []string{}) + p.Resources = append(p.Resources, newResource) +} diff --git a/providers/azure/cosmosdb.go b/providers/azure/cosmosdb.go index 3b904b52dc..1ae576b139 100644 --- a/providers/azure/cosmosdb.go +++ b/providers/azure/cosmosdb.go @@ -18,7 +18,7 @@ import ( "context" "strings" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2020-03-01/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-06-15/documentdb" "github.com/Azure/go-autorest/autorest" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/hashicorp/go-azure-helpers/authentication" @@ -33,7 +33,7 @@ func (g *CosmosDBGenerator) listSQLDatabasesAndContainersBehind(resourceGroupNam var resourcesContainer []terraformutils.Resource ctx := context.Background() subscriptionID := g.Args["config"].(authentication.Config).SubscriptionID - SQLResourcesClient := documentdb.NewSQLResourcesClient(subscriptionID, subscriptionID) + SQLResourcesClient := documentdb.NewSQLResourcesClient(subscriptionID) SQLResourcesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) sqlDatabases, err := SQLResourcesClient.ListSQLDatabases(ctx, resourceGroupName, accountName) @@ -81,11 +81,7 @@ func (g *CosmosDBGenerator) listTables(resourceGroupName string, accountName str var resources []terraformutils.Resource ctx := context.Background() subscriptionID := g.Args["config"].(authentication.Config).SubscriptionID - // NOTE: - // there will be a parameter simplification for interface if we update the package - // https://github.com/Azure/azure-sdk-for-go/blob/v42.0.0/services/cosmos-db/mgmt/2020-03-01/documentdb/tableresources.go#L35 - // https://github.com/Azure/azure-sdk-for-go/blob/v44.0.0/services/cosmos-db/mgmt/2020-03-01/documentdb/tableresources.go#L35 - TableResourcesClient := documentdb.NewTableResourcesClient(subscriptionID, subscriptionID) + TableResourcesClient := documentdb.NewTableResourcesClient(subscriptionID) TableResourcesClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) tables, err := TableResourcesClient.ListTables(ctx, resourceGroupName, accountName) @@ -108,11 +104,7 @@ func (g *CosmosDBGenerator) listAndAddForDatabaseAccounts() ([]terraformutils.Re var resources []terraformutils.Resource ctx := context.Background() subscriptionID := g.Args["config"].(authentication.Config).SubscriptionID - // NOTE: - // there will be a parameter simplification for interface if we update the package - // https://github.com/Azure/azure-sdk-for-go/blob/v42.0.0/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccounts.go#L35 - // https://github.com/Azure/azure-sdk-for-go/blob/v44.0.0/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccounts.go#L35 - DatabaseAccountsClient := documentdb.NewDatabaseAccountsClient(subscriptionID, subscriptionID) + DatabaseAccountsClient := documentdb.NewDatabaseAccountsClient(subscriptionID) DatabaseAccountsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) var ( diff --git a/providers/azure/data_factory.go b/providers/azure/data_factory.go index 81fdaeb7fb..30f813b920 100644 --- a/providers/azure/data_factory.go +++ b/providers/azure/data_factory.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "reflect" + "strings" "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" "github.com/GoogleCloudPlatform/terraformer/terraformutils" @@ -88,7 +89,16 @@ func getFieldAsString(v interface{}, field string) string { return "" } -func (g *DataFactoryGenerator) appendResourceFrom(resources []terraformutils.Resource, id string, name string, properties interface{}) []terraformutils.Resource { +func (az *AzureService) appendResourceAs(resources []terraformutils.Resource, itemID string, itemName string, resourceType string, abbreviation string) []terraformutils.Resource { + prefix := strings.ReplaceAll(resourceType, resourceType, abbreviation) + suffix := strings.ReplaceAll(itemName, "-", "_") + resourceName := prefix + "_" + suffix + res := terraformutils.NewSimpleResource(itemID, resourceName, resourceType, az.ProviderName, []string{}) + resources = append(resources, res) + return resources +} + +func (az *DataFactoryGenerator) appendResourceFrom(resources []terraformutils.Resource, id string, name string, properties interface{}) []terraformutils.Resource { azureType := getFieldAsString(properties, "Type") if azureType != "" { resourceType := getResourceTypeFrom(azureType) @@ -96,14 +106,14 @@ func (g *DataFactoryGenerator) appendResourceFrom(resources []terraformutils.Res msg := fmt.Sprintf(`azurerm_data_factory: resource "%s" id: %s type: %s not handled yet by terraform or terraformer`, name, id, azureType) log.Println(msg) } else { - resources = g.appendResourceAs(resources, id, name, resourceType, "adf") + resources = az.appendResourceAs(resources, id, name, resourceType, "adf") } } return resources } -func (g *DataFactoryGenerator) listFactories() ([]datafactory.Factory, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DataFactoryGenerator) listFactories() ([]datafactory.Factory, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() client := datafactory.NewFactoriesClient(subscriptionID) client.Authorizer = authorizer var ( @@ -111,8 +121,8 @@ func (g *DataFactoryGenerator) listFactories() ([]datafactory.Factory, error) { err error ) ctx := context.Background() - if rg := g.Args["resource_group"].(string); rg != "" { - iterator, err = client.ListByResourceGroupComplete(ctx, rg) + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) } else { iterator, err = client.ListComplete(ctx) } @@ -131,10 +141,10 @@ func (g *DataFactoryGenerator) listFactories() ([]datafactory.Factory, error) { return resources, nil } -func (g *DataFactoryGenerator) createDataFactoryResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { +func (az *DataFactoryGenerator) createDataFactoryResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { var resources []terraformutils.Resource for _, item := range dataFactories { - resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory", "adf") + resources = az.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory", "adf") } return resources, nil } @@ -155,8 +165,8 @@ func getIntegrationRuntimeType(properties interface{}) string { return "azurerm_data_factory_integration_runtime_azure_ssis" } -func (g *DataFactoryGenerator) createIntegrationRuntimesResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DataFactoryGenerator) createIntegrationRuntimesResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, _, authorizer := az.getClientArgs() client := datafactory.NewIntegrationRuntimesClient(subscriptionID) client.Authorizer = authorizer ctx := context.Background() @@ -173,7 +183,7 @@ func (g *DataFactoryGenerator) createIntegrationRuntimesResources(dataFactories for iterator.NotDone() { item := iterator.Value() resourceType := getIntegrationRuntimeType(item.Properties) - resources = g.appendResourceAs(resources, *item.ID, *item.Name, resourceType, "adf") + resources = az.appendResourceAs(resources, *item.ID, *item.Name, resourceType, "adfr") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -183,8 +193,8 @@ func (g *DataFactoryGenerator) createIntegrationRuntimesResources(dataFactories return resources, nil } -func (g *DataFactoryGenerator) createLinkedServiceResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DataFactoryGenerator) createLinkedServiceResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, _, authorizer := az.getClientArgs() client := datafactory.NewLinkedServicesClient(subscriptionID) client.Authorizer = authorizer ctx := context.Background() @@ -200,7 +210,7 @@ func (g *DataFactoryGenerator) createLinkedServiceResources(dataFactories []data } for iterator.NotDone() { item := iterator.Value() - resources = g.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) + resources = az.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) if err = iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -210,8 +220,8 @@ func (g *DataFactoryGenerator) createLinkedServiceResources(dataFactories []data return resources, nil } -func (g *DataFactoryGenerator) createPipelineResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DataFactoryGenerator) createPipelineResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, _, authorizer := az.getClientArgs() client := datafactory.NewPipelinesClient(subscriptionID) client.Authorizer = authorizer ctx := context.Background() @@ -227,7 +237,7 @@ func (g *DataFactoryGenerator) createPipelineResources(dataFactories []datafacto } for iterator.NotDone() { item := iterator.Value() - resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_pipeline", "adf") + resources = az.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_pipeline", "adfp") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -237,8 +247,8 @@ func (g *DataFactoryGenerator) createPipelineResources(dataFactories []datafacto return resources, nil } -func (g *DataFactoryGenerator) createPipelineTriggerScheduleResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DataFactoryGenerator) createPipelineTriggerScheduleResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, _, authorizer := az.getClientArgs() client := datafactory.NewTriggersClient(subscriptionID) client.Authorizer = authorizer ctx := context.Background() @@ -254,7 +264,7 @@ func (g *DataFactoryGenerator) createPipelineTriggerScheduleResources(dataFactor } for iterator.NotDone() { item := iterator.Value() - resources = g.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) + resources = az.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -264,8 +274,8 @@ func (g *DataFactoryGenerator) createPipelineTriggerScheduleResources(dataFactor return resources, nil } -func (g *DataFactoryGenerator) createDataFlowResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DataFactoryGenerator) createDataFlowResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, _, authorizer := az.getClientArgs() client := datafactory.NewDataFlowsClient(subscriptionID) client.Authorizer = authorizer ctx := context.Background() @@ -281,7 +291,7 @@ func (g *DataFactoryGenerator) createDataFlowResources(dataFactories []datafacto } for iterator.NotDone() { item := iterator.Value() - resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_data_flow", "adf") + resources = az.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_data_factory_data_flow", "adfl") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -291,8 +301,8 @@ func (g *DataFactoryGenerator) createDataFlowResources(dataFactories []datafacto return resources, nil } -func (g *DataFactoryGenerator) createPipelineDatasetResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DataFactoryGenerator) createPipelineDatasetResources(dataFactories []datafactory.Factory) ([]terraformutils.Resource, error) { + subscriptionID, _, authorizer := az.getClientArgs() client := datafactory.NewDatasetsClient(subscriptionID) client.Authorizer = authorizer ctx := context.Background() @@ -308,7 +318,7 @@ func (g *DataFactoryGenerator) createPipelineDatasetResources(dataFactories []da } for iterator.NotDone() { item := iterator.Value() - resources = g.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) + resources = az.appendResourceFrom(resources, *item.ID, *item.Name, item.Properties) if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err @@ -318,21 +328,21 @@ func (g *DataFactoryGenerator) createPipelineDatasetResources(dataFactories []da return resources, nil } -func (g *DataFactoryGenerator) InitResources() error { +func (az *DataFactoryGenerator) InitResources() error { - dataFactories, err := g.listFactories() + dataFactories, err := az.listFactories() if err != nil { return err } factoriesFunctions := []func([]datafactory.Factory) ([]terraformutils.Resource, error){ - g.createDataFactoryResources, - g.createIntegrationRuntimesResources, - g.createLinkedServiceResources, - g.createPipelineResources, - g.createPipelineTriggerScheduleResources, - g.createPipelineDatasetResources, - g.createDataFlowResources, + az.createDataFactoryResources, + az.createIntegrationRuntimesResources, + az.createLinkedServiceResources, + az.createPipelineResources, + az.createPipelineTriggerScheduleResources, + az.createPipelineDatasetResources, + az.createDataFlowResources, } for _, f := range factoriesFunctions { @@ -340,22 +350,22 @@ func (g *DataFactoryGenerator) InitResources() error { if ero != nil { return ero } - g.Resources = append(g.Resources, resources...) + az.Resources = append(az.Resources, resources...) } return nil } // PostGenerateHook for formatting json properties as heredoc // - azurerm_data_factory_pipeline property activities_json -func (g *DataFactoryGenerator) PostConvertHook() error { - for i, resource := range g.Resources { +func (az *DataFactoryGenerator) PostConvertHook() error { + for i, resource := range az.Resources { if resource.InstanceInfo.Type == "azurerm_data_factory_pipeline" { - if val, ok := g.Resources[i].Item["activities_json"]; ok { + if val, ok := az.Resources[i].Item["activities_json"]; ok { if val != nil { json := val.(string) // json := asJson(val) hereDoc := asHereDoc(json) - g.Resources[i].Item["activities_json"] = hereDoc + az.Resources[i].Item["activities_json"] = hereDoc } } } diff --git a/providers/azure/databricks.go b/providers/azure/databricks.go index adc168abda..2cdf339de0 100644 --- a/providers/azure/databricks.go +++ b/providers/azure/databricks.go @@ -5,16 +5,14 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/services/databricks/mgmt/2018-04-01/databricks" - - "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) type DatabricksGenerator struct { AzureService } -func (g *DatabricksGenerator) listWorkspaces() ([]databricks.Workspace, error) { - subscriptionID, authorizer := g.getArgsProperties() +func (az *DatabricksGenerator) listWorkspaces() ([]databricks.Workspace, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() client := databricks.NewWorkspacesClient(subscriptionID) client.Authorizer = authorizer var ( @@ -22,8 +20,8 @@ func (g *DatabricksGenerator) listWorkspaces() ([]databricks.Workspace, error) { err error ) ctx := context.Background() - if rg := g.Args["resource_group"].(string); rg != "" { - iterator, err = client.ListByResourceGroupComplete(ctx, rg) + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) } else { iterator, err = client.ListBySubscriptionComplete(ctx) } @@ -42,31 +40,18 @@ func (g *DatabricksGenerator) listWorkspaces() ([]databricks.Workspace, error) { return resources, nil } -func (g *DatabricksGenerator) createDatabricksWorkspaces(workspaces []databricks.Workspace) ([]terraformutils.Resource, error) { - var resources []terraformutils.Resource - for _, item := range workspaces { - resources = g.appendResourceAs(resources, *item.ID, *item.Name, "azurerm_databricks_workspace", "dbw") - } - return resources, nil +func (az *DatabricksGenerator) AppendWorkspace(workspace *databricks.Workspace) { + az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_databricks_workspace", "dbw") } -func (g *DatabricksGenerator) InitResources() error { +func (az *DatabricksGenerator) InitResources() error { - workspaces, err := g.listWorkspaces() + workspaces, err := az.listWorkspaces() if err != nil { return err } - - workspacesFunctions := []func([]databricks.Workspace) ([]terraformutils.Resource, error){ - g.createDatabricksWorkspaces, - } - - for _, f := range workspacesFunctions { - resources, ero := f(workspaces) - if ero != nil { - return ero - } - g.Resources = append(g.Resources, resources...) + for _, workspace := range workspaces { + az.AppendWorkspace(&workspace) } return nil } diff --git a/providers/azure/eventhub.go b/providers/azure/eventhub.go new file mode 100644 index 0000000000..f79ace202b --- /dev/null +++ b/providers/azure/eventhub.go @@ -0,0 +1,135 @@ +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub" +) + +type EventHubGenerator struct { + AzureService +} + +func (az *EventHubGenerator) listNamespaces() ([]eventhub.EHNamespace, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := eventhub.NewNamespacesClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator eventhub.EHNamespaceListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []eventhub.EHNamespace + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *EventHubGenerator) AppendNamespace(namespace *eventhub.EHNamespace) { + az.AppendSimpleResource(*namespace.ID, *namespace.Name, "azurerm_eventhub_namespace", "evhn") +} + +func (az *EventHubGenerator) appendEventHubs(namespace *eventhub.EHNamespace, namespaceRg *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := eventhub.NewEventHubsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListByNamespaceComplete(ctx, namespaceRg.ResourceGroup, *namespace.Name, nil, nil) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub", "evh") + err = az.appendConsumerGroups(namespace, namespaceRg, *item.Name) + if err != nil { + return err + } + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *EventHubGenerator) appendConsumerGroups(namespace *eventhub.EHNamespace, namespaceRg *ResourceID, eventHubName string) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := eventhub.NewConsumerGroupsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListByEventHubComplete(ctx, namespaceRg.ResourceGroup, *namespace.Name, eventHubName, nil, nil) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub_consumer_group", "evhg") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *EventHubGenerator) appendAuthorizationRules(namespace *eventhub.EHNamespace, namespaceRg *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := eventhub.NewNamespacesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListAuthorizationRulesComplete(ctx, namespaceRg.ResourceGroup, *namespace.Name) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub_namespace_authorization_rule", "evar") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *EventHubGenerator) InitResources() error { + + namespaces, err := az.listNamespaces() + if err != nil { + return err + } + for _, namespace := range namespaces { + az.AppendNamespace(&namespace) + namespaceRg, err := ParseAzureResourceID(*namespace.ID) + if err != nil { + return err + } + err = az.appendEventHubs(&namespace, namespaceRg) + if err != nil { + return err + } + err = az.appendAuthorizationRules(&namespace, namespaceRg) + if err != nil { + return err + } + } + return nil +} diff --git a/providers/azure/helper.go b/providers/azure/helper.go index 47bdd2b874..161864e332 100644 --- a/providers/azure/helper.go +++ b/providers/azure/helper.go @@ -18,10 +18,6 @@ import ( "fmt" "net/url" "strings" - - "github.com/Azure/go-autorest/autorest" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/hashicorp/go-azure-helpers/authentication" ) // FROM https://github.com/terraform-providers/terraform-provider-azurerm/blob/6e006ff4e5d1fb200a6b37eb2743ff0ec8b11e0d/azurerm/helpers/azure/resourceid.go#L24 @@ -116,18 +112,3 @@ func asHereDoc(json string) string { %s JSON`, json) } - -func (g *AzureService) appendResourceAs(resources []terraformutils.Resource, itemID string, itemName string, resourceType string, abbreviation string) []terraformutils.Resource { - prefix := strings.ReplaceAll(resourceType, resourceType, abbreviation) - suffix := strings.ReplaceAll(itemName, "-", "_") - resourceName := prefix + "_" + suffix - res := terraformutils.NewSimpleResource(itemID, resourceName, resourceType, g.ProviderName, []string{}) - resources = append(resources, res) - return resources -} - -func (g *AzureService) getArgsProperties() (subscriptionID string, authorizer autorest.Authorizer) { - subs := g.Args["config"].(authentication.Config).SubscriptionID - auth := g.Args["authorizer"].(autorest.Authorizer) - return subs, auth -} diff --git a/providers/azure/purview.go b/providers/azure/purview.go new file mode 100644 index 0000000000..2afb7b5c17 --- /dev/null +++ b/providers/azure/purview.go @@ -0,0 +1,57 @@ +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/purview/mgmt/2021-07-01/purview" +) + +type PurviewGenerator struct { + AzureService +} + +func (az *PurviewGenerator) listAccounts() ([]purview.Account, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := purview.NewAccountsClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator purview.AccountListIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup, "") + } else { + iterator, err = client.ListBySubscriptionComplete(ctx, "") + } + if err != nil { + return nil, err + } + var resources []purview.Account + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *PurviewGenerator) AppendAccount(account *purview.Account) { + az.AppendSimpleResource(*account.ID, *account.Name, "azurerm_purview_account", "pur") +} + +func (az *PurviewGenerator) InitResources() error { + + accounts, err := az.listAccounts() + if err != nil { + return err + } + for _, account := range accounts { + az.AppendAccount(&account) + } + return nil +} diff --git a/providers/azure/synapse.go b/providers/azure/synapse.go new file mode 100644 index 0000000000..c2f711d58c --- /dev/null +++ b/providers/azure/synapse.go @@ -0,0 +1,205 @@ +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/preview/synapse/2019-06-01-preview/managedvirtualnetwork" + "github.com/Azure/azure-sdk-for-go/services/synapse/mgmt/2020-12-01/synapse" + // "github.com/Azure/azure-sdk-for-go/services/preview/synapse/2020-08-01-preview/accesscontrol" +) + +type SynapseGenerator struct { + AzureService +} + +func (az *SynapseGenerator) listWorkspaces() ([]synapse.Workspace, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := synapse.NewWorkspacesClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator synapse.WorkspaceInfoListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []synapse.Workspace + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *SynapseGenerator) appendWorkspace(workspace *synapse.Workspace) { + az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_synapse_workspace", "syn") +} + +func (az *SynapseGenerator) appendSQLPools(workspace *synapse.Workspace, workspaceRg *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := synapse.NewSQLPoolsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListByWorkspaceComplete(ctx, workspaceRg.ResourceGroup, *workspace.Name) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_sql_pool", "synp") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *SynapseGenerator) appendSparkPools(workspace *synapse.Workspace, workspaceRg *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := synapse.NewBigDataPoolsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListByWorkspaceComplete(ctx, workspaceRg.ResourceGroup, *workspace.Name) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_spark_pool", "synp") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *SynapseGenerator) appendFirewallRule(workspace *synapse.Workspace, workspaceRg *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := synapse.NewIPFirewallRulesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListByWorkspaceComplete(ctx, workspaceRg.ResourceGroup, *workspace.Name) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_firewall_rule", "synf") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *SynapseGenerator) appendManagedPrivateEndpoint(workspace *synapse.Workspace) error { + + if workspace.WorkspaceProperties == nil || workspace.WorkspaceProperties.ManagedVirtualNetwork == nil { + return nil + } + virtualNetworkName := *workspace.WorkspaceProperties.ManagedVirtualNetwork + subscriptionID, _, authorizer := az.getClientArgs() + client := managedvirtualnetwork.NewManagedPrivateEndpointsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListComplete(ctx, virtualNetworkName) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_managed_private_endpoint", "syne") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *SynapseGenerator) listPrivateLinkHubs() ([]synapse.PrivateLinkHub, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := synapse.NewPrivateLinkHubsClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator synapse.PrivateLinkHubInfoListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []synapse.PrivateLinkHub + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *SynapseGenerator) appendtPrivateLinkHubs(workspace *synapse.PrivateLinkHub) { + az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_synapse_private_link_hub", "synl") +} + +func (az *SynapseGenerator) InitResources() error { + + workspaces, err := az.listWorkspaces() + if err != nil { + return err + } + for _, workspace := range workspaces { + az.appendWorkspace(&workspace) + workspaceRg, err := ParseAzureResourceID(*workspace.ID) + if err != nil { + return err + } + err = az.appendSQLPools(&workspace, workspaceRg) + if err != nil { + return err + } + err = az.appendSparkPools(&workspace, workspaceRg) + if err != nil { + return err + } + err = az.appendFirewallRule(&workspace, workspaceRg) + if err != nil { + return err + } + err = az.appendManagedPrivateEndpoint(&workspace) + if err != nil { + return err + } + } + + hubs, err := az.listPrivateLinkHubs() + if err != nil { + return err + } + for _, hub := range hubs { + az.appendtPrivateLinkHubs(&hub) + } + return nil +} From 0861009274ca4c54d9a436460b0996696e4550fc Mon Sep 17 00:00:00 2001 From: stoXe <16467875+IAmStoxe@users.noreply.github.com> Date: Wed, 8 Sep 2021 13:17:55 -0700 Subject: [PATCH 231/276] Fix trailing _ on "panos_aggregate_interface" (#1033) * Fix trailing _ on "panos_aggregate_interface" * Create go.yml * Delete go.yml --- providers/panos/firewall_networking.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go index 48218a2a4e..dda1edff7e 100644 --- a/providers/panos/firewall_networking.go +++ b/providers/panos/firewall_networking.go @@ -94,7 +94,7 @@ func (g *FirewallNetworkingGenerator) createAggregateInterfaceResources() (resou resources = append(resources, terraformutils.NewSimpleResource( id, normalizeResourceName(aggregateInterface), - "panos_aggregate_interface_", + "panos_aggregate_interface", "panos", []string{}, )) From df486b0e593c96ac3e354320ef8be63e0efb000c Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Thu, 9 Sep 2021 20:31:25 -0300 Subject: [PATCH 232/276] azurerm: added private_endpoint (#1042) --- docs/azure.md | 3 + providers/azure/azure_provider.go | 5 ++ providers/azure/private_endpoint.go | 97 +++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 providers/azure/private_endpoint.go diff --git a/docs/azure.md b/docs/azure.md index d1a5460e4e..507f4a9ef7 100644 --- a/docs/azure.md +++ b/docs/azure.md @@ -145,6 +145,9 @@ export ARM_TENANT_ID=[TENANT_ID] * `azurerm_private_dns_txt_record` * `azurerm_private_dns_zone` * `azurerm_private_dns_zone_virtual_network_link` +* `private_endpoint` + * `azurerm_private_endpoint` + * `azurerm_private_link_service` * `public_ip` * `azurerm_public_ip` * `azurerm_public_ip_prefix` diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index ffa3afa73f..df2f1ad5e9 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -187,6 +187,10 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "private_dns": { "resource_group": []string{"resource_group_name", "name"}, }, + "private_endpoint": { + "resource_group": []string{"resource_group_name", "name"}, + "subnet": []string{"subnet_id", "ID"}, + }, "public_ip": { "resource_group": []string{"resource_group_name", "name"}, }, @@ -238,6 +242,7 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG "network_interface": &NetworkInterfaceGenerator{}, "network_security_group": &NetworkSecurityGroupGenerator{}, "private_dns": &PrivateDNSGenerator{}, + "private_endpoint": &PrivateEndpointGenerator{}, "public_ip": &PublicIPGenerator{}, "purview": &PurviewGenerator{}, "redis": &RedisGenerator{}, diff --git a/providers/azure/private_endpoint.go b/providers/azure/private_endpoint.go new file mode 100644 index 0000000000..0573c2709d --- /dev/null +++ b/providers/azure/private_endpoint.go @@ -0,0 +1,97 @@ +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" +) + +type PrivateEndpointGenerator struct { + AzureService +} + +func (az *PrivateEndpointGenerator) listServices() ([]network.PrivateLinkService, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := network.NewPrivateLinkServicesClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator network.PrivateLinkServiceListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListBySubscriptionComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []network.PrivateLinkService + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *PrivateEndpointGenerator) AppendServices(link *network.PrivateLinkService) { + az.AppendSimpleResource(*link.ID, *link.Name, "azurerm_private_link_service", "pls") +} + +func (az *PrivateEndpointGenerator) listEndpoints() ([]network.PrivateEndpoint, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := network.NewPrivateEndpointsClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator network.PrivateEndpointListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListBySubscriptionComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []network.PrivateEndpoint + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *PrivateEndpointGenerator) AppendEndpoint(link *network.PrivateEndpoint) { + az.AppendSimpleResource(*link.ID, *link.Name, "azurerm_private_endpoint", "pep") +} + +func (az *PrivateEndpointGenerator) InitResources() error { + + services, err := az.listServices() + if err != nil { + return err + } + for _, link := range services { + az.AppendServices(&link) + } + endpoints, err := az.listEndpoints() + if err != nil { + return err + } + for _, endpoint := range endpoints { + az.AppendEndpoint(&endpoint) + } + return nil +} From 542b42e05f66ec3688b879624627490118753e89 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Thu, 9 Sep 2021 20:32:07 -0300 Subject: [PATCH 233/276] azurerm: added subnet and related (#1041) * azurerm: added subnet and related Inpired by #585 * azurerm: fixed lint for subnet * azurerm: subnet support --- docs/azure.md | 12 +++ providers/azure/azure_provider.go | 22 +++- providers/azure/subnet.go | 165 +++++++++++++++++++++++++++++ providers/azure/virtual_network.go | 18 +++- 4 files changed, 214 insertions(+), 3 deletions(-) create mode 100644 providers/azure/subnet.go diff --git a/docs/azure.md b/docs/azure.md index 507f4a9ef7..9b6532f13b 100644 --- a/docs/azure.md +++ b/docs/azure.md @@ -177,3 +177,15 @@ export ARM_TENANT_ID=[TENANT_ID] * `azurerm_virtual_machine` * `virtual_network` * `azurerm_virtual_network` +* `subnet` + * `azurerm_subnet` + * `azurerm_subnet_service_endpoint_storage_policy` + * `azurerm_subnet_nat_gateway_association` + * `azurerm_subnet_route_table_association` + * `azurerm_subnet_network_security_group_association` + +## Notes + +### Virtual networks and subnets + +Terraformer will import `azurerm_virtual_network` config with inlined subnet information swipped, in order to avoid any potential circular dependencies. To import the subnet information, please also import `azurerm_subnet`. diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index df2f1ad5e9..4873cb64b0 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -216,6 +216,9 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "synapse": { "resource_group": []string{"resource_group_name", "name"}, }, + "subnet": { + "resource_group": []string{"resource_group_name", "name"}, + }, "virtual_machine": { "resource_group": []string{"resource_group_name", "name"}, }, @@ -254,6 +257,7 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG "storage_blob": &StorageBlobGenerator{}, "storage_container": &StorageContainerGenerator{}, "synapse": &SynapseGenerator{}, + "subnet": &SubnetGenerator{}, "virtual_machine": &VirtualMachineGenerator{}, "virtual_network": &VirtualNetworkGenerator{}, } @@ -283,11 +287,27 @@ func (p *AzureService) getClientArgs() (subscriptionID string, resourceGroup str return subs, resg, auth } -func (p *AzureService) AppendSimpleResource(itemID string, itemName string, resourceType string, abbreviation string) { +func sanitizeResourceName(itemName string, abbreviation string) string { resourceName := strings.ReplaceAll(itemName, "-", "_") + resourceName = strings.ReplaceAll(resourceName, "_002D_", "-") if abbreviation != "" { resourceName = abbreviation + "_" + resourceName } + return resourceName +} + +func (p *AzureService) AppendSimpleResource(itemID string, itemName string, resourceType string, abbreviation string) { + resourceName := sanitizeResourceName(itemName, abbreviation) newResource := terraformutils.NewSimpleResource(itemID, resourceName, resourceType, p.ProviderName, []string{}) p.Resources = append(p.Resources, newResource) } + +func (p *AzureService) appendSimpleAssociation(itemID string, itemName string, resourceType string, abbreviation string, attributes map[string]string) { + resourceName := sanitizeResourceName(itemName, abbreviation) + newResource := terraformutils.NewResource( + itemID, resourceName, resourceType, p.ProviderName, attributes, + []string{"name"}, + map[string]interface{}{}, + ) + p.Resources = append(p.Resources, newResource) +} diff --git a/providers/azure/subnet.go b/providers/azure/subnet.go new file mode 100644 index 0000000000..b1dc44e4e8 --- /dev/null +++ b/providers/azure/subnet.go @@ -0,0 +1,165 @@ +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" +) + +type SubnetGenerator struct { + AzureService +} + +func (az *SubnetGenerator) lisSubnets() ([]network.Subnet, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + subnetClient := network.NewSubnetsClient(subscriptionID) + subnetClient.Authorizer = authorizer + vnetClient := network.NewVirtualNetworksClient(subscriptionID) + vnetClient.Authorizer = authorizer + var ( + vnetIter network.VirtualNetworkListResultIterator + subnetIter network.SubnetListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + vnetIter, err = vnetClient.ListComplete(ctx, resourceGroup) + } else { + vnetIter, err = vnetClient.ListAllComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []network.Subnet + for vnetIter.NotDone() { + vnet := vnetIter.Value() + vnetID, err := ParseAzureResourceID(*vnet.ID) + if err != nil { + return nil, err + } + subnetIter, err = subnetClient.ListComplete(ctx, vnetID.ResourceGroup, *vnet.Name) + if err != nil { + return nil, err + } + for subnetIter.NotDone() { + item := subnetIter.Value() + resources = append(resources, item) + if err := subnetIter.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + if err := vnetIter.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *SubnetGenerator) AppendSubnet(subnet *network.Subnet) { + az.AppendSimpleResource(*subnet.ID, *subnet.Name, "azurerm_subnet", "snet") +} + +func (az *SubnetGenerator) appendRouteTable(subnet *network.Subnet) { + if props := subnet.SubnetPropertiesFormat; props != nil { + if prop := props.RouteTable; prop != nil { + named := *subnet.Name + "_RouteTable" + az.appendSimpleAssociation( + *subnet.ID, named, + "azurerm_subnet_route_table_association", "snetrt", + map[string]string{ + "subnet_id": *subnet.ID, + "route_table_id": *prop.ID, + }) + } + } +} + +func (az *SubnetGenerator) appendNetworkSecurityGroupAssociation(subnet *network.Subnet) { + if props := subnet.SubnetPropertiesFormat; props != nil { + if prop := props.NetworkSecurityGroup; prop != nil { + named := *subnet.Name + "_NetworkSecurityGroup" + az.appendSimpleAssociation( + *subnet.ID, named, + "azurerm_subnet_network_security_group_association", "snetsg", + map[string]string{ + "subnet_id": *subnet.ID, + "network_security_group_id": *prop.ID, + }) + } + } +} + +func (az *SubnetGenerator) appendNatGateway(subnet *network.Subnet) { + if props := subnet.SubnetPropertiesFormat; props != nil { + if prop := props.NatGateway; prop != nil { + named := *subnet.Name + "_NatGateway" + az.appendSimpleAssociation( + *subnet.ID, named, + "azurerm_subnet_nat_gateway_association", "snetnat", + map[string]string{ + "subnet_id": *subnet.ID, + "nat_gateway_id": *prop.ID, + }) + } + } +} + +func (az *SubnetGenerator) appendServiceEndpointPolicies() error { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := network.NewServiceEndpointPoliciesClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator network.ServiceEndpointPolicyListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListComplete(ctx) + } + if err != nil { + return err + } + + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_subnet_service_endpoint_storage_policy", "snetpol") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *SubnetGenerator) InitResources() error { + + subnets, err := az.lisSubnets() + if err != nil { + return err + } + for _, subnet := range subnets { + az.AppendSubnet(&subnet) + az.appendRouteTable(&subnet) + az.appendNetworkSecurityGroupAssociation(&subnet) + az.appendNatGateway(&subnet) + } + if err := az.appendServiceEndpointPolicies(); err != nil { + return err + } + return nil +} + +func (az *SubnetGenerator) PostConvertHook() error { + for _, resource := range az.Resources { + if resource.InstanceInfo.Type != "azurerm_subnet" { + continue + } + delete(resource.Item, "address_prefix") + } + return nil +} diff --git a/providers/azure/virtual_network.go b/providers/azure/virtual_network.go index 34c09ccc39..0d75fe2981 100644 --- a/providers/azure/virtual_network.go +++ b/providers/azure/virtual_network.go @@ -18,7 +18,7 @@ import ( "context" "log" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" "github.com/Azure/go-autorest/autorest" "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/hashicorp/go-azure-helpers/authentication" @@ -36,7 +36,7 @@ func (g VirtualNetworkGenerator) createResources(ctx context.Context, iterator n *virtualNetwork.ID, *virtualNetwork.Name, "azurerm_virtual_network", - "azurerm", + g.ProviderName, []string{})) if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) @@ -68,3 +68,17 @@ func (g *VirtualNetworkGenerator) InitResources() error { g.Resources, err = g.createResources(ctx, output) return err } + +// NOTE on Virtual Networks and Subnet's: +// Terraform currently provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network +// resource. At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. +// Doing so will cause a conflict of Subnet configurations and will overwrite Subnet's. +func (g *VirtualNetworkGenerator) PostConvertHook() error { + for _, resource := range g.Resources { + if resource.InstanceInfo.Type != "azurerm_virtual_network" { + continue + } + delete(resource.Item, "subnet") + } + return nil +} From 8cf4b8b4ded49ca9444ea626ad470851eb21df86 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 13 Sep 2021 02:40:48 -0300 Subject: [PATCH 234/276] azurerm: improve resource connections (#1044) * azurerm: improved resource connections * azurerm: fix resource names for connections * azurerm: fix some resource connections * azurerm: fix network_security_group connections --- providers/azure/azure_provider.go | 67 +++++++++++++++-------- providers/azure/databricks.go | 2 +- providers/azure/eventhub.go | 8 +-- providers/azure/network_security_group.go | 2 +- providers/azure/private_endpoint.go | 4 +- providers/azure/purview.go | 2 +- providers/azure/subnet.go | 19 +++---- providers/azure/synapse.go | 12 ++-- 8 files changed, 68 insertions(+), 48 deletions(-) diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index 4873cb64b0..42c4a3eca8 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -158,10 +158,21 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "resource_group": []string{"resource_group_name", "name"}, }, "databricks": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "managed_resource_group_name", "name", + }, + "storage_account": []string{"storage_account_name", "name"}, + "subnet": []string{ + "public_subnet_name", "name", + "private_subnet_name", "name", + }, + "virtual_network": []string{"virtual_network_id", "id"}, }, "data_factory": { "resource_group": []string{"resource_group_name", "name"}, + "data_factory": []string{"data_factory_name", "name"}, + "keyvault": []string{"keyvault_id", "id"}, }, "disk": { "resource_group": []string{"resource_group_name", "name"}, @@ -171,6 +182,10 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { }, "eventhub": { "resource_group": []string{"resource_group_name", "name"}, + "eventhub": []string{ + "eventhub_name", "name", + "namespace_name", "name", + }, }, "keyvault": { "resource_group": []string{"resource_group_name", "name"}, @@ -180,16 +195,18 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { }, "network_interface": { "resource_group": []string{"resource_group_name", "name"}, + "subnet": []string{"subnet_id", "id"}, }, "network_security_group": { "resource_group": []string{"resource_group_name", "name"}, }, "private_dns": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{"resource_group_name", "name"}, + "virtual_network": []string{"virtual_network_id", "id"}, }, "private_endpoint": { "resource_group": []string{"resource_group_name", "name"}, - "subnet": []string{"subnet_id", "ID"}, + "subnet": []string{"subnet_id", "id"}, }, "public_ip": { "resource_group": []string{"resource_group_name", "name"}, @@ -204,7 +221,8 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "resource_group": []string{"resource_group_name", "name"}, }, "storage_account": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{"resource_group_name", "name"}, + "virtual_network": []string{"virtual_network_subnet_ids", "id"}, }, "storage_blob": { "storage_account": []string{"storage_account_name", "name"}, @@ -214,13 +232,21 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "storage_account": []string{"storage_account_name", "name"}, }, "synapse": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "managed_resource_group_name", "name", + }, + "synapse": []string{"synapse_workspace_id", "id"}, }, "subnet": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{"resource_group_name", "name"}, + "virtual_network": []string{"virtual_network_name", "name"}, + "network_security_group": []string{"network_security_group_id", "id"}, + "subnet": []string{"subnet_id", "id"}, }, "virtual_machine": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{"resource_group_name", "name"}, + "network_interface": []string{"network_interface_ids", "id"}, }, "virtual_network": { "resource_group": []string{"resource_group_name", "name"}, @@ -287,25 +313,22 @@ func (p *AzureService) getClientArgs() (subscriptionID string, resourceGroup str return subs, resg, auth } -func sanitizeResourceName(itemName string, abbreviation string) string { - resourceName := strings.ReplaceAll(itemName, "-", "_") - resourceName = strings.ReplaceAll(resourceName, "_002D_", "-") - if abbreviation != "" { - resourceName = abbreviation + "_" + resourceName - } - return resourceName -} - -func (p *AzureService) AppendSimpleResource(itemID string, itemName string, resourceType string, abbreviation string) { - resourceName := sanitizeResourceName(itemName, abbreviation) - newResource := terraformutils.NewSimpleResource(itemID, resourceName, resourceType, p.ProviderName, []string{}) +func (p *AzureService) AppendSimpleResource(id string, resourceName string, resourceType string) { + newResource := terraformutils.NewSimpleResource(id, resourceName, resourceType, p.ProviderName, []string{}) p.Resources = append(p.Resources, newResource) } -func (p *AzureService) appendSimpleAssociation(itemID string, itemName string, resourceType string, abbreviation string, attributes map[string]string) { - resourceName := sanitizeResourceName(itemName, abbreviation) +func (p *AzureService) appendSimpleAssociation(id string, linkedResourceName string, resourceName *string, resourceType string, attributes map[string]string) { + var resourceName2 string + if resourceName != nil { + resourceName2 = *resourceName + } else { + resourceName0 := strings.ReplaceAll(resourceType, "azurerm_", "") + resourceName1 := resourceName0[strings.IndexByte(resourceName0, '_'):] + resourceName2 = linkedResourceName + resourceName1 + } newResource := terraformutils.NewResource( - itemID, resourceName, resourceType, p.ProviderName, attributes, + id, resourceName2, resourceType, p.ProviderName, attributes, []string{"name"}, map[string]interface{}{}, ) diff --git a/providers/azure/databricks.go b/providers/azure/databricks.go index 2cdf339de0..ad2749f948 100644 --- a/providers/azure/databricks.go +++ b/providers/azure/databricks.go @@ -41,7 +41,7 @@ func (az *DatabricksGenerator) listWorkspaces() ([]databricks.Workspace, error) } func (az *DatabricksGenerator) AppendWorkspace(workspace *databricks.Workspace) { - az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_databricks_workspace", "dbw") + az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_databricks_workspace") } func (az *DatabricksGenerator) InitResources() error { diff --git a/providers/azure/eventhub.go b/providers/azure/eventhub.go index f79ace202b..5b0c7ad6fa 100644 --- a/providers/azure/eventhub.go +++ b/providers/azure/eventhub.go @@ -41,7 +41,7 @@ func (az *EventHubGenerator) listNamespaces() ([]eventhub.EHNamespace, error) { } func (az *EventHubGenerator) AppendNamespace(namespace *eventhub.EHNamespace) { - az.AppendSimpleResource(*namespace.ID, *namespace.Name, "azurerm_eventhub_namespace", "evhn") + az.AppendSimpleResource(*namespace.ID, *namespace.Name, "azurerm_eventhub_namespace") } func (az *EventHubGenerator) appendEventHubs(namespace *eventhub.EHNamespace, namespaceRg *ResourceID) error { @@ -56,7 +56,7 @@ func (az *EventHubGenerator) appendEventHubs(namespace *eventhub.EHNamespace, na for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub", "evh") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub") err = az.appendConsumerGroups(namespace, namespaceRg, *item.Name) if err != nil { return err @@ -80,7 +80,7 @@ func (az *EventHubGenerator) appendConsumerGroups(namespace *eventhub.EHNamespac } for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub_consumer_group", "evhg") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub_consumer_group") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err @@ -101,7 +101,7 @@ func (az *EventHubGenerator) appendAuthorizationRules(namespace *eventhub.EHName for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub_namespace_authorization_rule", "evar") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_eventhub_namespace_authorization_rule") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err diff --git a/providers/azure/network_security_group.go b/providers/azure/network_security_group.go index 23351987c6..ecbd0e2b5f 100644 --- a/providers/azure/network_security_group.go +++ b/providers/azure/network_security_group.go @@ -34,7 +34,7 @@ func (g NetworkSecurityGroupGenerator) createResources(securityGroupListResult n nsg := securityGroupListResult.Value() resources = append(resources, terraformutils.NewSimpleResource( *nsg.ID, - *nsg.Name+"-"+*nsg.ID, + *nsg.Name, "azurerm_network_security_group", "azurerm", []string{})) diff --git a/providers/azure/private_endpoint.go b/providers/azure/private_endpoint.go index 0573c2709d..bea08893d2 100644 --- a/providers/azure/private_endpoint.go +++ b/providers/azure/private_endpoint.go @@ -41,7 +41,7 @@ func (az *PrivateEndpointGenerator) listServices() ([]network.PrivateLinkService } func (az *PrivateEndpointGenerator) AppendServices(link *network.PrivateLinkService) { - az.AppendSimpleResource(*link.ID, *link.Name, "azurerm_private_link_service", "pls") + az.AppendSimpleResource(*link.ID, *link.Name, "azurerm_private_link_service") } func (az *PrivateEndpointGenerator) listEndpoints() ([]network.PrivateEndpoint, error) { @@ -74,7 +74,7 @@ func (az *PrivateEndpointGenerator) listEndpoints() ([]network.PrivateEndpoint, } func (az *PrivateEndpointGenerator) AppendEndpoint(link *network.PrivateEndpoint) { - az.AppendSimpleResource(*link.ID, *link.Name, "azurerm_private_endpoint", "pep") + az.AppendSimpleResource(*link.ID, *link.Name, "azurerm_private_endpoint") } func (az *PrivateEndpointGenerator) InitResources() error { diff --git a/providers/azure/purview.go b/providers/azure/purview.go index 2afb7b5c17..43901bc135 100644 --- a/providers/azure/purview.go +++ b/providers/azure/purview.go @@ -41,7 +41,7 @@ func (az *PurviewGenerator) listAccounts() ([]purview.Account, error) { } func (az *PurviewGenerator) AppendAccount(account *purview.Account) { - az.AppendSimpleResource(*account.ID, *account.Name, "azurerm_purview_account", "pur") + az.AppendSimpleResource(*account.ID, *account.Name, "azurerm_purview_account") } func (az *PurviewGenerator) InitResources() error { diff --git a/providers/azure/subnet.go b/providers/azure/subnet.go index b1dc44e4e8..d017e52d84 100644 --- a/providers/azure/subnet.go +++ b/providers/azure/subnet.go @@ -59,16 +59,15 @@ func (az *SubnetGenerator) lisSubnets() ([]network.Subnet, error) { } func (az *SubnetGenerator) AppendSubnet(subnet *network.Subnet) { - az.AppendSimpleResource(*subnet.ID, *subnet.Name, "azurerm_subnet", "snet") + az.AppendSimpleResource(*subnet.ID, *subnet.Name, "azurerm_subnet") } func (az *SubnetGenerator) appendRouteTable(subnet *network.Subnet) { if props := subnet.SubnetPropertiesFormat; props != nil { if prop := props.RouteTable; prop != nil { - named := *subnet.Name + "_RouteTable" az.appendSimpleAssociation( - *subnet.ID, named, - "azurerm_subnet_route_table_association", "snetrt", + *subnet.ID, *subnet.Name, prop.Name, + "azurerm_subnet_route_table_association", map[string]string{ "subnet_id": *subnet.ID, "route_table_id": *prop.ID, @@ -80,10 +79,9 @@ func (az *SubnetGenerator) appendRouteTable(subnet *network.Subnet) { func (az *SubnetGenerator) appendNetworkSecurityGroupAssociation(subnet *network.Subnet) { if props := subnet.SubnetPropertiesFormat; props != nil { if prop := props.NetworkSecurityGroup; prop != nil { - named := *subnet.Name + "_NetworkSecurityGroup" az.appendSimpleAssociation( - *subnet.ID, named, - "azurerm_subnet_network_security_group_association", "snetsg", + *subnet.ID, *subnet.Name, prop.Name, + "azurerm_subnet_network_security_group_association", map[string]string{ "subnet_id": *subnet.ID, "network_security_group_id": *prop.ID, @@ -95,10 +93,9 @@ func (az *SubnetGenerator) appendNetworkSecurityGroupAssociation(subnet *network func (az *SubnetGenerator) appendNatGateway(subnet *network.Subnet) { if props := subnet.SubnetPropertiesFormat; props != nil { if prop := props.NatGateway; prop != nil { - named := *subnet.Name + "_NatGateway" az.appendSimpleAssociation( - *subnet.ID, named, - "azurerm_subnet_nat_gateway_association", "snetnat", + *subnet.ID, *subnet.Name, nil, + "azurerm_subnet_nat_gateway_association", map[string]string{ "subnet_id": *subnet.ID, "nat_gateway_id": *prop.ID, @@ -127,7 +124,7 @@ func (az *SubnetGenerator) appendServiceEndpointPolicies() error { for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_subnet_service_endpoint_storage_policy", "snetpol") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_subnet_service_endpoint_storage_policy") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err diff --git a/providers/azure/synapse.go b/providers/azure/synapse.go index c2f711d58c..aebe8add22 100644 --- a/providers/azure/synapse.go +++ b/providers/azure/synapse.go @@ -43,7 +43,7 @@ func (az *SynapseGenerator) listWorkspaces() ([]synapse.Workspace, error) { } func (az *SynapseGenerator) appendWorkspace(workspace *synapse.Workspace) { - az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_synapse_workspace", "syn") + az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_synapse_workspace") } func (az *SynapseGenerator) appendSQLPools(workspace *synapse.Workspace, workspaceRg *ResourceID) error { @@ -57,7 +57,7 @@ func (az *SynapseGenerator) appendSQLPools(workspace *synapse.Workspace, workspa } for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_sql_pool", "synp") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_sql_pool") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err @@ -77,7 +77,7 @@ func (az *SynapseGenerator) appendSparkPools(workspace *synapse.Workspace, works } for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_spark_pool", "synp") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_spark_pool") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err @@ -97,7 +97,7 @@ func (az *SynapseGenerator) appendFirewallRule(workspace *synapse.Workspace, wor } for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_firewall_rule", "synf") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_firewall_rule") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err @@ -122,7 +122,7 @@ func (az *SynapseGenerator) appendManagedPrivateEndpoint(workspace *synapse.Work } for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_managed_private_endpoint", "syne") + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_synapse_managed_private_endpoint") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err @@ -161,7 +161,7 @@ func (az *SynapseGenerator) listPrivateLinkHubs() ([]synapse.PrivateLinkHub, err } func (az *SynapseGenerator) appendtPrivateLinkHubs(workspace *synapse.PrivateLinkHub) { - az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_synapse_private_link_hub", "synl") + az.AppendSimpleResource(*workspace.ID, *workspace.Name, "azurerm_synapse_private_link_hub") } func (az *SynapseGenerator) InitResources() error { From f7bd3be3d1f9f3b7a19acedef944bda521e33170 Mon Sep 17 00:00:00 2001 From: anilkumarnagaraj Date: Tue, 14 Sep 2021 23:12:43 +0530 Subject: [PATCH 235/276] Added vpe resource support (#1046) --- docs/ibmcloud.md | 35 ++++- .../ibm/ibm_is_virtual_endpoint_gateway.go | 129 ++++++++++++++++++ providers/ibm/ibm_provider.go | 1 + 3 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 providers/ibm/ibm_is_virtual_endpoint_gateway.go diff --git a/docs/ibmcloud.md b/docs/ibmcloud.md index f409d03832..d7bbff54b4 100644 --- a/docs/ibmcloud.md +++ b/docs/ibmcloud.md @@ -34,6 +34,10 @@ List of supported IBM Cloud resources: * `ibm_iam_access_group_members` * `ibm_iam_access_group_policy` * `ibm_iam_access_group_dynamic_rule` + * `ibm_iam_service_id` + * `ibm_iam_authorization_policy` + * `ibm_iam_custom_role` + * `ibm_iam_service_policy` * `ibm_container_vpc_cluster` * `ibm_container_vpc_cluster` * `ibm_container_vpc_worker_pool` @@ -61,6 +65,18 @@ List of supported IBM Cloud resources: * `ibm_cis_edge_functions_trigger` * `ibm_cis_healthcheck` * `ibm_cis_rate_limit` + * `ibm_cis_domain` + * `ibm_cis_origin_pool` + * `ibm_cis_waf_package` + * `ibm_cis_waf_group` + * `ibm_cis_page_rule` + * `ibm_cis_custom_page` + * `ibm_cis_range_app` + * `ibm_cis_certificate_order` + * `ibm_cis_routing` + * `ibm_cis_cache_settings` + * `ibm_cis_tls_settings` + * `ibm_cis_filter` * `ibm_is_vpc` * `ibm_is_vpc` * `ibm_is_vpc_address_prefix` @@ -69,12 +85,14 @@ List of supported IBM Cloud resources: * `ibm_is_vpc_routing_table_route` * `ibm_is_subnet` * `ibm_is_instance` -* `ibm_is_security_group` +* `ibm_is_security_group` + * `ibm_is_security_group` * `ibm_is_security_group_rule` * `ibm_is_network_acl` * `ibm_is_public_gateway` * `ibm_is_volume` -* `ibm_is_vpn_gateway` +* `ibm_is_vpn_gateway` + * `ibm_is_vpn_gateway` * `ibm_is_vpn_gateway_connections` * `ibm_is_lb` * `ibm_is_lb_pool` @@ -102,4 +120,17 @@ List of supported IBM Cloud resources: * `ibm_dns_glb_monitor` * `ibm_dns_glb_pool` * `ibm_dns_glb` +* `ibm_container_cluster` + * `ibm_container_cluster` + * `ibm_container_worker_pool` + * `ibm_container_worker_pool_zone_attachment` +* `ibm_certificate_manager` + * `ibm_resource_instance` + * `ibm_certificate_manager_import` + * `ibm_certificate_manager_order` +* `ibm_vpe_gateway` + * `ibm_is_virtual_endpoint_gateway` + * `ibm_is_virtual_endpoint_gateway_ip` + + diff --git a/providers/ibm/ibm_is_virtual_endpoint_gateway.go b/providers/ibm/ibm_is_virtual_endpoint_gateway.go new file mode 100644 index 0000000000..bc3d8d2488 --- /dev/null +++ b/providers/ibm/ibm_is_virtual_endpoint_gateway.go @@ -0,0 +1,129 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +// VPEGenerator ... +type VPEGenerator struct { + IBMService +} + +func (g VPEGenerator) createVPEGatewayResources(gatewayID, gatewayName string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + gatewayID, + gatewayName, + "ibm_is_virtual_endpoint_gateway", + "ibm", + []string{}) + return resources +} + +func (g VPEGenerator) createVPEGatewayIPResources(gatewayID, gatewayIPID, gatewayIPName string, dependsOn []string) terraformutils.Resource { + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", gatewayID, gatewayIPID), + gatewayIPName, + "ibm_is_virtual_endpoint_gateway_ip", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// InitResources ... +func (g *VPEGenerator) InitResources() error { + var resoureGroup string + region := envFallBack([]string{"IC_REGION"}, "us-south") + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + return fmt.Errorf("No API key set") + } + + rg := g.Args["resource_group"] + if rg != nil { + resoureGroup = rg.(string) + } + + vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) + vpcoptions := &vpcv1.VpcV1Options{ + URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + vpcclient, err := vpcv1.NewVpcV1(vpcoptions) + if err != nil { + return err + } + + start := "" + allrecs := []vpcv1.EndpointGateway{} + for { + listEndpointGatewaysOptions := &vpcv1.ListEndpointGatewaysOptions{} + if start != "" { + listEndpointGatewaysOptions.Start = &start + } + if resoureGroup != "" { + listEndpointGatewaysOptions.ResourceGroupID = &resoureGroup + } + gateways, response, err := vpcclient.ListEndpointGateways(listEndpointGatewaysOptions) + if err != nil { + return fmt.Errorf("Error Fetching endpoint gateways %s\n%s", err, response) + } + start = GetNext(gateways.Next) + allrecs = append(allrecs, gateways.EndpointGateways...) + if start == "" { + break + } + } + + for _, gateway := range allrecs { + var dependsOn []string + start := "" + allrecs := []vpcv1.ReservedIP{} + dependsOn = append(dependsOn, + "ibm_is_virtual_endpoint_gateway."+terraformutils.TfSanitize(*gateway.Name)) + g.Resources = append(g.Resources, g.createVPEGatewayResources(*gateway.ID, *gateway.Name)) + listEndpointGatewayIpsOptions := &vpcv1.ListEndpointGatewayIpsOptions{ + EndpointGatewayID: gateway.ID, + } + if start != "" { + listEndpointGatewayIpsOptions.Start = &start + } + ips, response, err := vpcclient.ListEndpointGatewayIps(listEndpointGatewayIpsOptions) + if err != nil { + return fmt.Errorf("Error Fetching endpoint gateway ips %s\n%s", err, response) + } + start = GetNext(ips.Next) + allrecs = append(allrecs, ips.Ips...) + if start == "" { + break + } + for _, ip := range allrecs { + g.Resources = append(g.Resources, g.createVPEGatewayIPResources(*gateway.ID, *ip.ID, *ip.Name, dependsOn)) + } + } + return nil +} diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index ee53171e26..daf0026d84 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -85,6 +85,7 @@ func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGen "ibm_function": &CloudFunctionGenerator{}, "ibm_private_dns": &privateDNSTemplateGenerator{}, "ibm_certificate_manager": &CMGenerator{}, + "ibm_vpe_gateway": &VPEGenerator{}, } } From 4f251294fb420b9ea58fd9e9be49ec468f8e49b7 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Fri, 17 Sep 2021 06:09:33 -0300 Subject: [PATCH 236/276] azuredevops: new provider (#1054) * azuredevops: scafolding * azuredevops: fixes for a minimal working version * azuredevops: get GetResourceConnections per service * azuredevops: added azuredevops * azuredevops: simplified services impl * azuredevops: added group * azuredevops: added docs * azuredevops: fix ci lints * azuredevops: silence critic --- cmd/provider_cmd_azuredevops.go | 45 +++++++++ cmd/root.go | 2 + docs/azuredevops.md | 26 +++++ go.mod | 1 + go.sum | 2 + providers/azuredevops/azuredevops_provider.go | 96 +++++++++++++++++++ providers/azuredevops/azuredevops_service.go | 82 ++++++++++++++++ providers/azuredevops/git_repository.go | 50 ++++++++++ providers/azuredevops/group.go | 58 +++++++++++ providers/azuredevops/helpers.go | 12 +++ providers/azuredevops/project.go | 51 ++++++++++ 11 files changed, 425 insertions(+) create mode 100644 cmd/provider_cmd_azuredevops.go create mode 100644 docs/azuredevops.md create mode 100644 providers/azuredevops/azuredevops_provider.go create mode 100644 providers/azuredevops/azuredevops_service.go create mode 100644 providers/azuredevops/git_repository.go create mode 100644 providers/azuredevops/group.go create mode 100644 providers/azuredevops/helpers.go create mode 100644 providers/azuredevops/project.go diff --git a/cmd/provider_cmd_azuredevops.go b/cmd/provider_cmd_azuredevops.go new file mode 100644 index 0000000000..91f9e32b61 --- /dev/null +++ b/cmd/provider_cmd_azuredevops.go @@ -0,0 +1,45 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package cmd + +import ( + azuredevops "github.com/GoogleCloudPlatform/terraformer/providers/azuredevops" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdAzureDevOpsImporter(options ImportOptions) *cobra.Command { + + cmd := &cobra.Command{ + Use: "azuredevops", + Short: "Import current state to Terraform configuration from Azure DevOps", + Long: "Import current state to Terraform configuration from Azure DevOps", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newAzureDevOpsProvider() + err := Import(provider, options, []string{options.ResourceGroup}) + if err != nil { + return err + } + return nil + }, + } + cmd.AddCommand(listCmd(newAzureDevOpsProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "project,team,git", "project=name1:name2:name3") + return cmd +} + +func newAzureDevOpsProvider() terraformutils.ProviderGenerator { + return &azuredevops.AzureDevOpsProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index 2565246901..730ae16894 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -63,6 +63,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdNs1Importer, newCmdPanosImporter, // VCS + newCmdAzureDevOpsImporter, newCmdGithubImporter, newCmdGitLabImporter, // Monitoring & System Management @@ -108,6 +109,7 @@ func providerGenerators() map[string]func() terraformutils.ProviderGenerator { // Network newCloudflareProvider, // VCS + newAzureDevOpsProvider, newGitHubProvider, newGitLabProvider, // Monitoring & System Management diff --git a/docs/azuredevops.md b/docs/azuredevops.md new file mode 100644 index 0000000000..2031c24720 --- /dev/null +++ b/docs/azuredevops.md @@ -0,0 +1,26 @@ +# Use with Azure DevOps + +Supports acess via [Personal Access Token](https://registry.terraform.io/providers/microsoft/azuredevops/latest/docs/guides/authenticating_using_the_personal_access_token). + +## Example + +``` sh +export AZDO_ORG_SERVICE_URL="https://dev.azure.com/" +export AZDO_PERSONAL_ACCESS_TOKEN="" + +./terraformer import azuredevops -r * +./terraformer import azuredevops -r project,git_repository +``` + +## List of supported Azure resources + +* `project` + * `azuredevops_project` +* `group` + * `azuredevops_group` +* `git_repository` + * `azuredevops_git_repository` + +## Notes + +Since [Terraform Provider for Azure DevOps](https://github.com/microsoft/terraform-provider-azuredevops) `version 0.17`. diff --git a/go.mod b/go.mod index 3ed139b43b..b383715dfd 100644 --- a/go.mod +++ b/go.mod @@ -135,6 +135,7 @@ require ( github.com/jonboydell/logzio_client v1.2.0 github.com/labd/commercetools-go-sdk v0.3.1 github.com/linode/linodego v0.24.1 + github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/nicksnyder/go-i18n v1.10.1 // indirect github.com/ns1/ns1-go v2.4.0+incompatible diff --git a/go.sum b/go.sum index f060a142f2..c77936b315 100644 --- a/go.sum +++ b/go.sum @@ -963,6 +963,8 @@ github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee h1:7Ac2RNGC8DAwDNd5uZyuYLoJOlVXyBGbO1VtFboDamk= github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee/go.mod h1:yd3I5pyIO5TrBH7+Ym94u8qp9xc6NTHAqESeI8kOJY8= +github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 h1:YH424zrwLTlyHSH/GzLMJeu5zhYVZSx5RQxGKm1h96s= +github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqKSQK1vIfQ+yVaFcGjDySHvym6FM1cNYnwzbrY= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= diff --git a/providers/azuredevops/azuredevops_provider.go b/providers/azuredevops/azuredevops_provider.go new file mode 100644 index 0000000000..3c816a39a7 --- /dev/null +++ b/providers/azuredevops/azuredevops_provider.go @@ -0,0 +1,96 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package azuredevpos + +import ( + "errors" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type AzureDevOpsProvider struct { //nolint + terraformutils.Provider + organizationURL string + personalAccessToken string +} + +func (p *AzureDevOpsProvider) setEnvConfig() error { + + organizationURL := os.Getenv("AZDO_ORG_SERVICE_URL") + if organizationURL == "" { + return errors.New("environment variable AZDO_ORG_SERVICE_URL missing") + } + personalAccessToken := os.Getenv("AZDO_PERSONAL_ACCESS_TOKEN") + if personalAccessToken == "" { + return errors.New("environment variable AZDO_PERSONAL_ACCESS_TOKEN missing") + } + p.organizationURL = organizationURL + p.personalAccessToken = personalAccessToken + return nil +} + +func (p *AzureDevOpsProvider) Init(args []string) error { + err := p.setEnvConfig() + if err != nil { + return err + } + return nil +} + +func (p *AzureDevOpsProvider) GetName() string { + return "azuredevops" +} + +func (p *AzureDevOpsProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{} +} + +func (p AzureDevOpsProvider) GetResourceConnections() map[string]map[string][]string { + supported := p.GetSupportedService() + connections := make(map[string]map[string][]string) + for serviceName, service := range supported { + if service2, ok := service.(AzureDevOpsServiceGenerator); ok { + if conn := service2.GetResourceConnections(); conn != nil { + connections[serviceName] = conn + } + } + } + return connections +} + +func (p *AzureDevOpsProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "project": &ProjectGenerator{}, + "group": &GroupGenerator{}, + "git_repository": &GitRepositoryGenerator{}, + } +} + +func (p *AzureDevOpsProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New("azuredevpos: " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "organizationURL": p.organizationURL, + "personalAccessToken": p.personalAccessToken, + }) + return nil +} diff --git a/providers/azuredevops/azuredevops_service.go b/providers/azuredevops/azuredevops_service.go new file mode 100644 index 0000000000..d05a7d5acc --- /dev/null +++ b/providers/azuredevops/azuredevops_service.go @@ -0,0 +1,82 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package azuredevpos + +import ( + "context" + "log" + + "github.com/microsoft/azure-devops-go-api/azuredevops" + "github.com/microsoft/azure-devops-go-api/azuredevops/core" + "github.com/microsoft/azure-devops-go-api/azuredevops/git" + "github.com/microsoft/azure-devops-go-api/azuredevops/graph" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type AzureDevOpsServiceGenerator interface { + terraformutils.ServiceGenerator + GetResourceConnections() map[string][]string +} + +type AzureDevOpsService struct { //nolint + terraformutils.Service +} + +func (az *AzureDevOpsService) GetResourceConnections() map[string][]string { + return nil +} + +func (az *AzureDevOpsService) getConnection() *azuredevops.Connection { + + organizationURL := az.Args["organizationURL"].(string) + personalAccessToken := az.Args["personalAccessToken"].(string) + return azuredevops.NewPatConnection(organizationURL, personalAccessToken) +} + +func (az *AzureDevOpsService) getCoreClient() (core.Client, error) { + ctx := context.Background() + client, err := core.NewClient(ctx, az.getConnection()) + if err != nil { + log.Println(err) + return nil, err + } + return client, nil +} + +func (az *AzureDevOpsService) getGraphClient() (graph.Client, error) { + ctx := context.Background() + client, err := graph.NewClient(ctx, az.getConnection()) + if err != nil { + log.Println(err) + return nil, err + } + return client, nil +} + +func (az *AzureDevOpsService) getGitClient() (git.Client, error) { + ctx := context.Background() + client, err := git.NewClient(ctx, az.getConnection()) + if err != nil { + log.Println(err) + return nil, err + } + return client, nil +} + +func (az *AzureDevOpsService) appendSimpleResource(id string, resourceName string, resourceType string) { + newResource := terraformutils.NewSimpleResource(id, resourceName, resourceType, az.ProviderName, []string{}) + az.Resources = append(az.Resources, newResource) +} diff --git a/providers/azuredevops/git_repository.go b/providers/azuredevops/git_repository.go new file mode 100644 index 0000000000..0fb868c725 --- /dev/null +++ b/providers/azuredevops/git_repository.go @@ -0,0 +1,50 @@ +package azuredevpos + +import ( + "context" + + "github.com/microsoft/azure-devops-go-api/azuredevops/git" +) + +type GitRepositoryGenerator struct { + AzureDevOpsService +} + +func (az *GitRepositoryGenerator) listResources() ([]git.GitRepository, error) { + + client, err := az.getGitClient() + if err != nil { + return nil, err + } + ctx := context.Background() + resources, err := client.GetRepositories(ctx, git.GetRepositoriesArgs{}) + if err != nil { + return nil, err + } + return *resources, nil +} + +func (az *GitRepositoryGenerator) appendResource(resource *git.GitRepository) { + + id := *resource.Id + az.appendSimpleResource(id.String(), *resource.Name, "azuredevops_git_repository") +} + +func (az *GitRepositoryGenerator) InitResources() error { + + resources, err := az.listResources() + if err != nil { + return err + } + for _, resource := range resources { + az.appendResource(&resource) + } + return nil +} + +func (az *GitRepositoryGenerator) GetResourceConnections() map[string][]string { + + return map[string][]string{ + "project": {"project_id", "id"}, + } +} diff --git a/providers/azuredevops/group.go b/providers/azuredevops/group.go new file mode 100644 index 0000000000..f72e303454 --- /dev/null +++ b/providers/azuredevops/group.go @@ -0,0 +1,58 @@ +package azuredevpos + +import ( + "context" + + "github.com/microsoft/azure-devops-go-api/azuredevops/graph" +) + +type GroupGenerator struct { + AzureDevOpsService +} + +func (az *GroupGenerator) listResources() ([]graph.GraphGroup, error) { + + client, fail := az.getGraphClient() + if fail != nil { + return nil, fail + } + ctx := context.Background() + var resources []graph.GraphGroup + pageArgs := graph.ListGroupsArgs{} + pages, err := client.ListGroups(ctx, pageArgs) + for ; err == nil; pages, err = client.ListGroups(ctx, pageArgs) { + resources = append(resources, *pages.GraphGroups...) + if pages.ContinuationToken == nil { + return resources, nil + } + pageArgs = graph.ListGroupsArgs{ + ContinuationToken: &(*pages.ContinuationToken)[0], + } + } + return nil, err +} + +func (az *GroupGenerator) appendResource(resource *graph.GraphGroup) { + + resourceName := firstNonEmpty(resource.DisplayName, resource.MailAddress, resource.OriginId) + az.appendSimpleResource(*resource.Descriptor, *resourceName, "azuredevops_group") +} + +func (az *GroupGenerator) InitResources() error { + + resources, err := az.listResources() + if err != nil { + return err + } + for _, resource := range resources { + az.appendResource(&resource) + } + return nil +} + +func (az *GroupGenerator) GetResourceConnections() map[string][]string { + + return map[string][]string{ + "project": {"scope", "id"}, + } +} diff --git a/providers/azuredevops/helpers.go b/providers/azuredevops/helpers.go new file mode 100644 index 0000000000..14b60bb078 --- /dev/null +++ b/providers/azuredevops/helpers.go @@ -0,0 +1,12 @@ +package azuredevpos + +func firstNonEmpty(values ...*string) *string { + for _, val := range values { + if val != nil { + if len(*val) > 0 { + return val + } + } + } + return nil +} diff --git a/providers/azuredevops/project.go b/providers/azuredevops/project.go new file mode 100644 index 0000000000..e0f4b78439 --- /dev/null +++ b/providers/azuredevops/project.go @@ -0,0 +1,51 @@ +package azuredevpos + +import ( + "context" + + "github.com/microsoft/azure-devops-go-api/azuredevops/core" +) + +type ProjectGenerator struct { + AzureDevOpsService +} + +func (az *ProjectGenerator) listResources() ([]core.TeamProjectReference, error) { + client, fail := az.getCoreClient() + if fail != nil { + return nil, fail + } + ctx := context.Background() + var resources []core.TeamProjectReference + pageArgs := core.GetProjectsArgs{} + pages, err := client.GetProjects(ctx, pageArgs) + for ; err == nil; pages, err = client.GetProjects(ctx, pageArgs) { + fetched := *pages + items := fetched.Value + resources = append(resources, items...) + if pages.ContinuationToken == "" { + return resources, nil + } + pageArgs = core.GetProjectsArgs{ + ContinuationToken: &pages.ContinuationToken, + } + } + return nil, err +} + +func (az *ProjectGenerator) appendResource(resource *core.TeamProjectReference) { + id := *resource.Id + az.appendSimpleResource(id.String(), *resource.Name, "azuredevops_project") +} + +func (az *ProjectGenerator) InitResources() error { + + resources, err := az.listResources() + if err != nil { + return err + } + for _, resource := range resources { + az.appendResource(&resource) + } + return nil +} From 96ddb6454c1288fc3dcdbe9a0e47dc5c1f6d273e Mon Sep 17 00:00:00 2001 From: Dominik Malsch Date: Fri, 17 Sep 2021 19:46:40 +0200 Subject: [PATCH 237/276] added document db support (#1052) * added document db support * fix goimports * add cluster_parameter_group and subnet_group --- docs/aws.md | 5 ++ go.mod | 8 +- go.sum | 13 +++- providers/aws/aws_provider.go | 1 + providers/aws/docdb.go | 141 ++++++++++++++++++++++++++++++++++ 5 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 providers/aws/docdb.go diff --git a/docs/aws.md b/docs/aws.md index 2bffdc9e88..31f185ef17 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -97,6 +97,11 @@ In that case terraformer will not know with which region resources are associate * `aws_datapipeline_pipeline` * `devicefarm` * `aws_devicefarm_project` +* `docdb` + * `aws_docdb_cluster` + * `aws_docdb_cluster_instance` + * `aws_docdb_cluster_parameter_group` + * `aws_docdb_subnet_group` * `dynamodb` * `aws_dynamodb_table` * `ec2_instance` diff --git a/go.mod b/go.mod index b383715dfd..eaf1782869 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go-v2 v1.4.0 + github.com/aws/aws-sdk-go-v2 v1.9.0 github.com/aws/aws-sdk-go-v2/config v1.1.4 github.com/aws/aws-sdk-go-v2/credentials v1.1.4 github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 @@ -54,6 +54,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/configservice v1.3.0 github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.3 github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.3 + github.com/aws/aws-sdk-go-v2/service/docdb v1.9.0 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.1 github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0 github.com/aws/aws-sdk-go-v2/service/ecr v1.2.1 @@ -194,11 +195,12 @@ require ( github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect github.com/aws/aws-sdk-go v1.37.0 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 // indirect - github.com/aws/smithy-go v1.4.0 // indirect + github.com/aws/smithy-go v1.8.0 // indirect github.com/beevik/etree v1.1.0 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect diff --git a/go.sum b/go.sum index c77936b315..a765b50485 100644 --- a/go.sum +++ b/go.sum @@ -213,14 +213,17 @@ github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zK github.com/aws/aws-sdk-go-v2 v1.3.0/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+testmuQeRY= github.com/aws/aws-sdk-go-v2 v1.3.1/go.mod h1:5SmWRTjN6uTRFNCc7rR69xHsdcUJnthmaRHGDsYhpTE= github.com/aws/aws-sdk-go-v2 v1.3.2/go.mod h1:7OaACgj2SX3XGWnrIjGlJM22h6yD6MEWKvm7levnnM8= -github.com/aws/aws-sdk-go-v2 v1.4.0 h1:Ryh4fNebT9SwLyCKPSk83dyEZj+KB6KzDyb1gXii7EI= github.com/aws/aws-sdk-go-v2 v1.4.0/go.mod h1:tI4KhsR5VkzlUa2DZAdwx7wCAYGwkZZ1H31PYrBFx1w= +github.com/aws/aws-sdk-go-v2 v1.9.0 h1:+S+dSqQCN3MSU5vJRu1HqHrq00cJn6heIMU7X9hcsoo= +github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/config v1.1.4 h1:2hjdDldmJJjb+rFieQySfOFt4WwxKZJVTEB6RBI74T4= github.com/aws/aws-sdk-go-v2/config v1.1.4/go.mod h1:op05ummoVoAqctpA80jVt/+hvEtLfuKmDyx0bIuvfbE= github.com/aws/aws-sdk-go-v2/credentials v1.1.4 h1:whYYw2srG+zUQzUw4LhML83f+xd22Vm7gv0I7aJglc8= github.com/aws/aws-sdk-go-v2/credentials v1.1.4/go.mod h1:UQwsT2w2XelrWoVV2v/zL2uce1RxmVCiHaZsoKLamZg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 h1:5gCrezE41xYQHWDsDkJD9nT22tUH3s+Zrvs4c3v2FGc= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5/go.mod h1:z/NKNlYxMzphl7TzjV+ctUebHF4CFNGGlSvmV/NKcJU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 h1:d95cddM3yTm4qffj3P6EnP+TzX1SSkWaQypXSgT/hpA= +github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2/go.mod h1:BQV0agm+JEhqR+2RT5e1XTFIDcAAV0eW6z2trp+iduw= github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 h1:G7NSCbvUWDp4B0ny7tjHfuZvadphb7M66/1cYN9AnAg= github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0/go.mod h1:PMYdnRge1BUXxlvWhynvcT7ltjXevZ/pVV56B299wT0= github.com/aws/aws-sdk-go-v2/service/acm v1.2.1 h1:s3Yka4ZE67lTTbSG7ZXlgwIjC122RkG6okTcrEbCBBY= @@ -269,6 +272,8 @@ github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.3 h1:dF5BSnxQIaFmpNbi7ybc github.com/aws/aws-sdk-go-v2/service/datapipeline v1.1.3/go.mod h1:KfO/6uA+14FbbKydAiDSRKYG+DwEhYr56ujLlCgJCnw= github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.3 h1:6y0p4RYpzNH6B8dlbNXfVyMl55EQHvJAXw33OLffA7o= github.com/aws/aws-sdk-go-v2/service/devicefarm v1.1.3/go.mod h1:0sLAFkQrOqjK9Nm9CtrAB36cBQGe8K/1PsFHVPiZbvI= +github.com/aws/aws-sdk-go-v2/service/docdb v1.9.0 h1:riGho+STq0uon87fxZGltLVJ3H+0G7SwdWgNGEZJc2M= +github.com/aws/aws-sdk-go-v2/service/docdb v1.9.0/go.mod h1:1DCw0WdpubCl2OLsJbkol6phbHycCEcD5jGxbNUg6Kg= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.1 h1:NnYXRukLvkiTnNyZHCCQcZaoWJSeE5Y7tCVPgvTyWfw= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.1/go.mod h1:WqAbIrpO0PSa3AIDxMG12aPPN4D1u99rOFdEfSM/KgY= github.com/aws/aws-sdk-go-v2/service/ec2 v1.3.0 h1:y82WbYudKuiWx0KuKQheqTQ4RIF8ZHoHvS/rD8HCYCc= @@ -303,8 +308,9 @@ github.com/aws/aws-sdk-go-v2/service/iam v1.3.0 h1:V95YLxbxLGlTcFR0KMMSZEaudIxYC github.com/aws/aws-sdk-go-v2/service/iam v1.3.0/go.mod h1:gPUYT7MBEb30j9eAsJ17LN9KbXtD1uqKOOKesCC4tjc= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 h1:iLFz4nrWkXMTFeVn0n99wRyc4Xib4SlDbtAM3h2z8P8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3/go.mod h1:g3Xw4tO/W+ae4EMzkxB6nGnJ48cLM4i1Z61WmD+IKtY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5 h1:GbW4bbc1iED64aIL203xcGSfLzWOWuIdnKV0guMcJvg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5/go.mod h1:MW0O/RpmVpS6MWKn6W03XEJmqXlG7+d3iaYLzkd2fAc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 h1:VNJ5NLBteVXEwE2F1zEXVmyIH58mZ6kIQGJoC7C+vkg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 h1:wCzfVBrF1QRQFacZn1ywE/o2p92FzfpDNI2aCpIv+sY= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1/go.mod h1:6A0VfJAnYwhcXzt7KsixOdFlITEH5NFl4QeYxlZ5TtQ= github.com/aws/aws-sdk-go-v2/service/iot v1.2.0 h1:OTrzh5ew69Vd6x1zruCQ7B/dtcxwCQ5ohPJWwfkydKQ= @@ -368,8 +374,9 @@ github.com/aws/aws-sdk-go-v2/service/xray v1.2.1/go.mod h1:MZS769M8/1Xm4XYQydDJb github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.3.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.4.0 h1:3rsQpgRe+OoQgJhEwGNpIkosl0fJLdmQqF4gSFRjg+4= github.com/aws/smithy-go v1.4.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= diff --git a/providers/aws/aws_provider.go b/providers/aws/aws_provider.go index a668d8f0bb..8279ac4b04 100644 --- a/providers/aws/aws_provider.go +++ b/providers/aws/aws_provider.go @@ -252,6 +252,7 @@ func (p *AWSProvider) GetSupportedService() map[string]terraformutils.ServiceGen "customer_gateway": &AwsFacade{service: &CustomerGatewayGenerator{}}, "datapipeline": &AwsFacade{service: &DataPipelineGenerator{}}, "devicefarm": &AwsFacade{service: &DeviceFarmGenerator{}}, + "docdb": &AwsFacade{service: &DocDBGenerator{}}, "dynamodb": &AwsFacade{service: &DynamoDbGenerator{}}, "ebs": &AwsFacade{service: &EbsGenerator{}}, "ec2_instance": &AwsFacade{service: &Ec2Generator{}}, diff --git a/providers/aws/docdb.go b/providers/aws/docdb.go new file mode 100644 index 0000000000..fdebee9083 --- /dev/null +++ b/providers/aws/docdb.go @@ -0,0 +1,141 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aws + +import ( + "context" + "log" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/aws/aws-sdk-go-v2/service/docdb" +) + +var docDBAllowEmptyValues = []string{"tags."} + +type DocDBGenerator struct { + AWSService +} + +func (g *DocDBGenerator) InitResources() error { + config, e := g.generateConfig() + if e != nil { + return e + } + svc := docdb.NewFromConfig(config) + + if err := g.getClusters(svc); err != nil { + log.Println(err) + } + + if err := g.getSubnetGroups(svc); err != nil { + log.Println(err) + } + + if err := g.getParameterGroups(svc); err != nil { + log.Println(err) + } + + return nil +} + +func (g *DocDBGenerator) getClusters(svc *docdb.Client) error { + clusterPaginator := docdb.NewDescribeDBClustersPaginator(svc, &docdb.DescribeDBClustersInput{}) + for clusterPaginator.HasMorePages() { + page, err := clusterPaginator.NextPage(context.TODO()) + if err != nil { + return err + } + + for _, cluster := range page.DBClusters { + + resourceName := StringValue(cluster.DBClusterIdentifier) + + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + resourceName, + resourceName, + "aws_docdb_cluster", + "aws", + docDBAllowEmptyValues)) + + for _, member := range cluster.DBClusterMembers { + instanceName := StringValue(member.DBInstanceIdentifier) + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + instanceName, + instanceName, + "aws_docdb_cluster_instance", + "aws", + docDBAllowEmptyValues)) + } + + } + } + + return nil +} + +func (g *DocDBGenerator) getSubnetGroups(svc *docdb.Client) error { + subnetGroupPaginator := docdb.NewDescribeDBSubnetGroupsPaginator(svc, &docdb.DescribeDBSubnetGroupsInput{}) + + for subnetGroupPaginator.HasMorePages() { + page, err := subnetGroupPaginator.NextPage(context.TODO()) + if err != nil { + return err + } + + for _, subnetGroup := range page.DBSubnetGroups { + resourceName := StringValue(subnetGroup.DBSubnetGroupName) + + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + resourceName, + resourceName, + "aws_docdb_subnet_group", + "aws", + docDBAllowEmptyValues)) + + } + } + + return nil +} + +func (g *DocDBGenerator) getParameterGroups(svc *docdb.Client) error { + parameterGroupPaginator := docdb.NewDescribeDBClusterParameterGroupsPaginator(svc, &docdb.DescribeDBClusterParameterGroupsInput{}) + + for parameterGroupPaginator.HasMorePages() { + page, err := parameterGroupPaginator.NextPage(context.TODO()) + if err != nil { + return err + } + + for _, parameterGroup := range page.DBClusterParameterGroups { + resourceName := StringValue(parameterGroup.DBClusterParameterGroupName) + + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + resourceName, + resourceName, + "aws_docdb_cluster_parameter_group", + "aws", + docDBAllowEmptyValues)) + + } + } + + return nil +} + +// PostConvertHook for add policy json as heredoc +func (g *DocDBGenerator) PostConvertHook() error { + return nil +} From 7e64e27142b4069d4980198e9450ed8cb971d0f5 Mon Sep 17 00:00:00 2001 From: VaishnaviGopal Date: Fri, 17 Sep 2021 23:48:28 +0530 Subject: [PATCH 238/276] support for ibm directlink and transit gateway resources added (#1049) Co-authored-by: Sergey Lanzman --- docs/ibmcloud.md | 10 ++- providers/ibm/ibm_dl.go | 141 ++++++++++++++++++++++++++++++++++ providers/ibm/ibm_provider.go | 2 + providers/ibm/ibm_tg.go | 116 ++++++++++++++++++++++++++++ 4 files changed, 266 insertions(+), 3 deletions(-) create mode 100644 providers/ibm/ibm_dl.go create mode 100644 providers/ibm/ibm_tg.go diff --git a/docs/ibmcloud.md b/docs/ibmcloud.md index d7bbff54b4..1e516c1027 100644 --- a/docs/ibmcloud.md +++ b/docs/ibmcloud.md @@ -120,6 +120,13 @@ List of supported IBM Cloud resources: * `ibm_dns_glb_monitor` * `ibm_dns_glb_pool` * `ibm_dns_glb` +* `ibm_transit_gateway` + * `ibm_tg_gateway` + * `ibm_tg_connection` +* `ibm_direct_link` + * `ibm_dl_gateway` + * `ibm_dl_virtual_connection` + * `ibm_dl_provider_gateway` * `ibm_container_cluster` * `ibm_container_cluster` * `ibm_container_worker_pool` @@ -131,6 +138,3 @@ List of supported IBM Cloud resources: * `ibm_vpe_gateway` * `ibm_is_virtual_endpoint_gateway` * `ibm_is_virtual_endpoint_gateway_ip` - - - diff --git a/providers/ibm/ibm_dl.go b/providers/ibm/ibm_dl.go new file mode 100644 index 0000000000..fd4d8c0765 --- /dev/null +++ b/providers/ibm/ibm_dl.go @@ -0,0 +1,141 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2" + dl "github.com/IBM/networking-go-sdk/directlinkv1" +) + +// DLGenerator ... +type DLGenerator struct { + IBMService +} + +func (g DLGenerator) createDirectLinkGatewayResources(gatewayID, gatewayName string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + gatewayID, + gatewayName, + "ibm_dl_gateway", + "ibm", + []string{}) + return resources +} + +func (g DLGenerator) createDirectLinkVirtualConnectionResources(gatewayID, connectionID, connectionName string, dependsOn []string) terraformutils.Resource { + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", gatewayID, connectionID), + connectionName, + "ibm_dl_virtual_connection", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +func (g DLGenerator) createDirectLinkProviderGatewayResources(providerGatewayID, providerGatewayName string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + providerGatewayID, + providerGatewayName, + "ibm_dl_provider_gateway", + "ibm", + []string{}) + return resources +} + +// InitResources ... +func (g *DLGenerator) InitResources() error { + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + return fmt.Errorf("no API key set") + } + dlURL := "https://directlink.cloud.ibm.com/v1" + directlinkOptions := &dl.DirectLinkV1Options{ + URL: envFallBack([]string{"IBMCLOUD_DL_API_ENDPOINT"}, dlURL), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + Version: CreateVersionDate(), + } + dlclient, err := dl.NewDirectLinkV1(directlinkOptions) + if err != nil { + return err + } + + listGatewaysOptions := &dl.ListGatewaysOptions{} + gateways, response, err := dlclient.ListGateways(listGatewaysOptions) + if err != nil { + return fmt.Errorf("Error Fetching Direct Link Gateways %s\n%s", err, response) + } + for _, gateway := range gateways.Gateways { + g.Resources = append(g.Resources, g.createDirectLinkGatewayResources(*gateway.ID, *gateway.Name)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_dl_gateway."+terraformutils.TfSanitize(*gateway.Name)) + listGatewayVirtualConnectionsOptions := &dl.ListGatewayVirtualConnectionsOptions{ + GatewayID: gateway.ID, + } + connections, response, err := dlclient.ListGatewayVirtualConnections(listGatewayVirtualConnectionsOptions) + if err != nil { + return fmt.Errorf("Error Fetching Direct Link Virtual connections %s\n%s", err, response) + } + for _, connection := range connections.VirtualConnections { + g.Resources = append(g.Resources, g.createDirectLinkVirtualConnectionResources(*gateway.ID, *connection.ID, *connection.Name, dependsOn)) + } + } + + dlproviderURL := "https://directlink.cloud.ibm.com/provider/v2" + dlproviderOptions := &dlProviderV2.DirectLinkProviderV2Options{ + URL: envFallBack([]string{"IBMCLOUD_DL_PROVIDER_API_ENDPOINT"}, dlproviderURL), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + Version: CreateVersionDate(), + } + dlproviderclient, err := dlProviderV2.NewDirectLinkProviderV2(dlproviderOptions) + if err != nil { + return err + } + start := "" + allrecs := []dlProviderV2.ProviderGateway{} + for { + listProviderGatewaysOptions := &dlProviderV2.ListProviderGatewaysOptions{} + if start != "" { + listProviderGatewaysOptions.Start = &start + } + + providerGateways, resp, err := dlproviderclient.ListProviderGateways(listProviderGatewaysOptions) + if err != nil { + return fmt.Errorf("Error Listing Direct Link Provider Gateways %s\n%s", err, resp) + } + start = GetNext(providerGateways.Next) + allrecs = append(allrecs, providerGateways.Gateways...) + if start == "" { + break + } + } + for _, providerGateway := range allrecs { + g.Resources = append(g.Resources, g.createDirectLinkProviderGatewayResources(*providerGateway.ID, *providerGateway.Name)) + } + return nil +} diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index daf0026d84..e4560068ea 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -85,6 +85,8 @@ func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGen "ibm_function": &CloudFunctionGenerator{}, "ibm_private_dns": &privateDNSTemplateGenerator{}, "ibm_certificate_manager": &CMGenerator{}, + "ibm_direct_link": &DLGenerator{}, + "ibm_transit_gateway": &TGGenerator{}, "ibm_vpe_gateway": &VPEGenerator{}, } } diff --git a/providers/ibm/ibm_tg.go b/providers/ibm/ibm_tg.go new file mode 100644 index 0000000000..e0d4977036 --- /dev/null +++ b/providers/ibm/ibm_tg.go @@ -0,0 +1,116 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + "time" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/IBM/go-sdk-core/v4/core" + tg "github.com/IBM/networking-go-sdk/transitgatewayapisv1" +) + +// TGGenerator ... +type TGGenerator struct { + IBMService +} + +func (g TGGenerator) createTransitGatewayResources(gatewayID, gatewayName string) terraformutils.Resource { + resources := terraformutils.NewSimpleResource( + gatewayID, + gatewayName, + "ibm_tg_gateway", + "ibm", + []string{}) + return resources +} + +func (g TGGenerator) createTransitGatewayConnectionResources(gatewayID, connectionID, connectionName string, dependsOn []string) terraformutils.Resource { + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", gatewayID, connectionID), + connectionName, + "ibm_tg_connection", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources +} + +// CreateVersionDate requires mandatory version attribute. Any date from 2019-12-13 up to the currentdate may be provided. Specify the current date to request the latest version. +func CreateVersionDate() *string { + version := time.Now().Format("2006-01-02") + return &version +} + +// InitResources ... +func (g *TGGenerator) InitResources() error { + apiKey := os.Getenv("IC_API_KEY") + if apiKey == "" { + return fmt.Errorf("no API key set") + } + tgURL := "https://transit.cloud.ibm.com/v1" + transitgatewayOptions := &tg.TransitGatewayApisV1Options{ + URL: envFallBack([]string{"IBMCLOUD_TG_API_ENDPOINT"}, tgURL), + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + Version: CreateVersionDate(), + } + + tgclient, err := tg.NewTransitGatewayApisV1(transitgatewayOptions) + if err != nil { + return err + } + start := "" + allrecs := []tg.TransitGateway{} + for { + listTransitGatewaysOptions := &tg.ListTransitGatewaysOptions{} + if start != "" { + listTransitGatewaysOptions.Start = &start + } + + gateways, resp, err := tgclient.ListTransitGateways(listTransitGatewaysOptions) + if err != nil { + return fmt.Errorf("Error Listing Transit Gateways %s\n%s", err, resp) + } + start = GetNext(gateways.Next) + allrecs = append(allrecs, gateways.TransitGateways...) + if start == "" { + break + } + } + for _, gateway := range allrecs { + g.Resources = append(g.Resources, g.createTransitGatewayResources(*gateway.ID, *gateway.Name)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_tg_gateway."+terraformutils.TfSanitize(*gateway.Name)) + listTransitGatewayConnectionsOptions := &tg.ListTransitGatewayConnectionsOptions{ + TransitGatewayID: gateway.ID, + } + connections, response, err := tgclient.ListTransitGatewayConnections(listTransitGatewayConnectionsOptions) + if err != nil { + return fmt.Errorf("Error Listing Transit Gateway connections %s\n%s", err, response) + } + for _, connection := range connections.Connections { + g.Resources = append(g.Resources, g.createTransitGatewayConnectionResources(*gateway.ID, *connection.ID, *connection.Name, dependsOn)) + } + } + return nil +} From d7a13c641d7813b83951d9b753115abadbfba064 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Fri, 17 Sep 2021 21:18:43 +0300 Subject: [PATCH 239/276] Update version.go (#1056) --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 41fd486476..a51f7df18b 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.16" +const version = "v0.8.17" var versionCmd = &cobra.Command{ Use: "version", From b6ad01a326ecd994f2bd9dc59a167f97064f53ed Mon Sep 17 00:00:00 2001 From: kavya498 <46739084+kavya498@users.noreply.github.com> Date: Wed, 22 Sep 2021 18:34:12 +0530 Subject: [PATCH 240/276] Normalize IBM resource names (#1061) --- providers/ibm/database_elasticsearch.go | 2 +- providers/ibm/database_etcd.go | 2 +- providers/ibm/database_mongo.go | 2 +- providers/ibm/database_postgresql.go | 2 +- providers/ibm/database_rabbitmq.go | 2 +- providers/ibm/database_redis.go | 2 +- providers/ibm/helpers.go | 39 ++++++ providers/ibm/iam.go | 152 ++++++++++++++---------- 8 files changed, 136 insertions(+), 67 deletions(-) create mode 100644 providers/ibm/helpers.go diff --git a/providers/ibm/database_elasticsearch.go b/providers/ibm/database_elasticsearch.go index 282bfb801c..4489bb5562 100644 --- a/providers/ibm/database_elasticsearch.go +++ b/providers/ibm/database_elasticsearch.go @@ -33,7 +33,7 @@ type DatabaseElasticSearchGenerator struct { func (g DatabaseElasticSearchGenerator) loadElasticSearchDB(dbID string, dbName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( dbID, - dbName, + normalizeResourceName(dbName, false), "ibm_database", "ibm", []string{}) diff --git a/providers/ibm/database_etcd.go b/providers/ibm/database_etcd.go index 94236b52e3..3823982035 100644 --- a/providers/ibm/database_etcd.go +++ b/providers/ibm/database_etcd.go @@ -33,7 +33,7 @@ type DatabaseETCDGenerator struct { func (g DatabaseETCDGenerator) loadETCDDB(dbID string, dbName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( dbID, - dbName, + normalizeResourceName(dbName, false), "ibm_database", "ibm", []string{}) diff --git a/providers/ibm/database_mongo.go b/providers/ibm/database_mongo.go index 08a8bef014..aa63c9f955 100644 --- a/providers/ibm/database_mongo.go +++ b/providers/ibm/database_mongo.go @@ -33,7 +33,7 @@ type DatabaseMongoGenerator struct { func (g DatabaseMongoGenerator) loadMongoDB(dbID string, dbName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( dbID, - dbName, + normalizeResourceName(dbName, false), "ibm_database", "ibm", []string{}) diff --git a/providers/ibm/database_postgresql.go b/providers/ibm/database_postgresql.go index e3546b17e5..b8419a0697 100644 --- a/providers/ibm/database_postgresql.go +++ b/providers/ibm/database_postgresql.go @@ -33,7 +33,7 @@ type DatabasePostgresqlGenerator struct { func (g DatabasePostgresqlGenerator) loadPostgresqlDB(dbID string, dbName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( dbID, - dbName, + normalizeResourceName(dbName, false), "ibm_database", "ibm", []string{}) diff --git a/providers/ibm/database_rabbitmq.go b/providers/ibm/database_rabbitmq.go index 571baacbe6..dc358970fd 100644 --- a/providers/ibm/database_rabbitmq.go +++ b/providers/ibm/database_rabbitmq.go @@ -33,7 +33,7 @@ type DatabaseRabbitMQGenerator struct { func (g DatabaseRabbitMQGenerator) loadRabbitMQDB(dbID string, dbName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( dbID, - dbName, + normalizeResourceName(dbName, false), "ibm_database", "ibm", []string{}) diff --git a/providers/ibm/database_redis.go b/providers/ibm/database_redis.go index 206fd51d2a..7f62dd8837 100644 --- a/providers/ibm/database_redis.go +++ b/providers/ibm/database_redis.go @@ -33,7 +33,7 @@ type DatabaseRedisGenerator struct { func (g DatabaseRedisGenerator) loadRedisDB(dbID string, dbName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( dbID, - dbName, + normalizeResourceName(dbName, false), "ibm_database", "ibm", []string{}) diff --git a/providers/ibm/helpers.go b/providers/ibm/helpers.go new file mode 100644 index 0000000000..fd5a6a63ca --- /dev/null +++ b/providers/ibm/helpers.go @@ -0,0 +1,39 @@ +package ibm + +import ( + "fmt" + "math/rand" + "regexp" + "strings" +) + +func normalizeResourceName(s string, rand bool) string { + specialChars := `-<>()*#{}[]|@_ .%'",&` + for _, c := range specialChars { + s = strings.ReplaceAll(s, string(c), "_") + } + s = regexp.MustCompile(`^[^a-zA-Z_]+`).ReplaceAllLiteralString(s, "") + s = strings.TrimSuffix(s, "`_") + if rand { + randString := RandStringBytes(4) + return fmt.Sprintf("%s_%s", strings.ToLower(s), randString) + } + return strings.ToLower(s) +} + +const letterBytes = "abcdefghijklmnopqrstuvwxyz0123456789" + +func RandStringBytes(n int) string { + b := make([]byte, n) + for i := range b { + b[i] = letterBytes[rand.Intn(len(letterBytes))] + } + return string(b) +} +func getRandom(names map[string]struct{}, name string, random bool) (map[string]struct{}, bool) { + if _, ok := names[name]; ok { + random = true + } + names[name] = struct{}{} + return names, random +} diff --git a/providers/ibm/iam.go b/providers/ibm/iam.go index c9f0525246..6e192ddc72 100644 --- a/providers/ibm/iam.go +++ b/providers/ibm/iam.go @@ -37,57 +37,72 @@ type IAMGenerator struct { func (g IAMGenerator) loadUserPolicies(policyID string, user string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( fmt.Sprintf("%s/%s", user, policyID), - policyID, + normalizeResourceName("iam_user_policy", true), "ibm_iam_user_policy", "ibm", []string{}) return resources } -func (g IAMGenerator) loadAccessGroups(grpID string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( - grpID, - grpID, - "ibm_iam_access_group", - "ibm", - []string{}) - return resources +func (g IAMGenerator) loadAccessGroups() func(grpID, grpName string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(grpID, grpName string) terraformutils.Resource { + names, random = getRandom(names, grpName, random) + resources := terraformutils.NewSimpleResource( + grpID, + normalizeResourceName(grpName, random), + "ibm_iam_access_group", + "ibm", + []string{}) + return resources + } } -func (g IAMGenerator) loadServiceIDs(serviceID string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( - serviceID, - serviceID, - "ibm_iam_service_id", - "ibm", - []string{}) - return resources +func (g IAMGenerator) loadServiceIDs() func(serviceID, grpName string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(grpID, grpName string) terraformutils.Resource { + names, random = getRandom(names, grpName, random) + resources := terraformutils.NewSimpleResource( + grpID, + normalizeResourceName(grpName, random), + "ibm_iam_service_id", + "ibm", + []string{}) + return resources + } } func (g IAMGenerator) loadAuthPolicies(policyID string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( policyID, - policyID, + normalizeResourceName("iam_authorization_policy", true), "ibm_iam_authorization_policy", "ibm", []string{}) return resources } -func (g IAMGenerator) loadCustomRoles(roleID string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( - roleID, - roleID, - "ibm_iam_custom_role", - "ibm", - []string{}) - return resources +func (g IAMGenerator) loadCustomRoles() func(roleID, roleName string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(roleID, roleName string) terraformutils.Resource { + names, random = getRandom(names, roleName, random) + resources := terraformutils.NewSimpleResource( + roleID, + normalizeResourceName(roleName, random), + "ibm_iam_custom_role", + "ibm", + []string{}) + return resources + } } func (g IAMGenerator) loadServicePolicies(serviceID, policyID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", serviceID, policyID), - policyID, + normalizeResourceName("iam_service_policy", true), "ibm_iam_service_policy", "ibm", map[string]string{}, @@ -98,24 +113,29 @@ func (g IAMGenerator) loadServicePolicies(serviceID, policyID string, dependsOn return resources } -func (g IAMGenerator) loadAccessGroupMembers(grpID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( - fmt.Sprintf("%s/%s", grpID, grpID), - grpID, - "ibm_iam_access_group_members", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{ - "depends_on": dependsOn, - }) - return resources +func (g IAMGenerator) loadAccessGroupMembers() func(grpID string, dependsOn []string, grpName string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(grpID string, dependsOn []string, grpName string) terraformutils.Resource { + names, random = getRandom(names, grpName, random) + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", grpID, grpID), + normalizeResourceName(grpName, random), + "ibm_iam_access_group_members", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources + } } func (g IAMGenerator) loadAccessGroupPolicies(grpID, policyID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", grpID, policyID), - policyID, + normalizeResourceName("iam_access_group_policy", true), "ibm_iam_access_group_policy", "ibm", map[string]string{}, @@ -126,18 +146,23 @@ func (g IAMGenerator) loadAccessGroupPolicies(grpID, policyID string, dependsOn return resources } -func (g IAMGenerator) loadAccessGroupDynamicPolicies(grpID, ruleID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( - fmt.Sprintf("%s/%s", grpID, ruleID), - ruleID, - "ibm_iam_access_group_dynamic_rule", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{ - "depends_on": dependsOn, - }) - return resources +func (g IAMGenerator) loadAccessGroupDynamicPolicies() func(grpID, ruleID, name string, dependsOn []string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(grpID, ruleID, name string, dependsOn []string) terraformutils.Resource { + names, random = getRandom(names, name, random) + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", grpID, ruleID), + normalizeResourceName(name, random), + "ibm_iam_access_group_dynamic_rule", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources + } } func (g *IAMGenerator) InitResources() error { @@ -201,12 +226,15 @@ func (g *IAMGenerator) InitResources() error { if err != nil { return err } + fnObjt := g.loadAccessGroups() + agmfnObj := g.loadAccessGroupMembers() for _, group := range agrps { - g.Resources = append(g.Resources, g.loadAccessGroups(group.ID)) + g.Resources = append(g.Resources, fnObjt(group.ID, group.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName var dependsOn []string dependsOn = append(dependsOn, - "ibm_iam_access_group."+terraformutils.TfSanitize(group.ID)) - g.Resources = append(g.Resources, g.loadAccessGroupMembers(group.ID, dependsOn)) + "ibm_iam_access_group."+resourceName) + g.Resources = append(g.Resources, agmfnObj(group.ID, dependsOn, group.Name)) policies, err := iampap.V1Policy().List(iampapv1.SearchParams{ AccountID: accountID, @@ -224,8 +252,9 @@ func (g *IAMGenerator) InitResources() error { if err != nil { return err } + dpfnObj := g.loadAccessGroupDynamicPolicies() for _, d := range dynamicPolicies { - g.Resources = append(g.Resources, g.loadAccessGroupDynamicPolicies(group.ID, d.RuleID, dependsOn)) + g.Resources = append(g.Resources, dpfnObj(group.ID, d.RuleID, d.Name, dependsOn)) } } @@ -283,13 +312,14 @@ func (g *IAMGenerator) InitResources() error { break } } - + servicefnObjt := g.loadServiceIDs() // loop through all service IDs and fetch policies correspponds to each service ID for _, service := range allrecs { - g.Resources = append(g.Resources, g.loadServiceIDs(*service.ID)) + g.Resources = append(g.Resources, servicefnObjt(*service.ID, *service.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName var dependsOn []string dependsOn = append(dependsOn, - "ibm_iam_service_id."+terraformutils.TfSanitize(*service.ID)) + "ibm_iam_service_id."+resourceName) listServicePolicyOptions := iampolicymanagementv1.ListPoliciesOptions{ AccountID: core.StringPtr(accountID), @@ -337,9 +367,9 @@ func (g *IAMGenerator) InitResources() error { if err != nil { return fmt.Errorf("error retrieving custom roles: %s", err) } - + rolefnObjt := g.loadCustomRoles() for _, r := range customRoles { - g.Resources = append(g.Resources, g.loadCustomRoles(*r.ID)) + g.Resources = append(g.Resources, rolefnObjt(*r.ID, *r.Name)) } return nil From 2b0f1a051b25a3ac241f68cc6ef3c3ca5e03c6f0 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 27 Sep 2021 18:05:52 -0300 Subject: [PATCH 241/276] azurerm: added support for some networking resouces (#1066) * azurerm: added route_table see: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/route * azurerm: added network_security_rule * azurerm: added network_watcher * azuredevops: added link on README.md * azurerm: added ssh_public_key * azurerm: added management_lock * azurerm: fix lint * azurerm: added license in all new files --- README.md | 1 + docs/azure.md | 11 ++ providers/azure/azure_provider.go | 35 +++++- providers/azure/data_factory.go | 14 +++ providers/azure/databricks.go | 14 +++ providers/azure/eventhub.go | 14 +++ providers/azure/management_lock.go | 71 +++++++++++ providers/azure/network_security_group.go | 91 +++++++++----- providers/azure/network_watcher.go | 109 +++++++++++++++++ providers/azure/private_endpoint.go | 14 +++ providers/azure/purview.go | 14 +++ providers/azure/route_table.go | 143 ++++++++++++++++++++++ providers/azure/ssh_public_key.go | 71 +++++++++++ providers/azure/subnet.go | 14 +++ providers/azure/synapse.go | 14 +++ 15 files changed, 599 insertions(+), 31 deletions(-) create mode 100644 providers/azure/management_lock.go create mode 100644 providers/azure/network_watcher.go create mode 100644 providers/azure/route_table.go create mode 100644 providers/azure/ssh_public_key.go diff --git a/README.md b/README.md index 49cac8fecb..6de399abc3 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [Cloudflare](/docs/cloudflare.md) * [PAN-OS](/docs/panos.md) * VCS + * [Azure DevOps](/docs/azuredevops.md) * [GitHub](/docs/github.md) * [Gitlab](/docs/gitlab.md) * Monitoring & System Management diff --git a/docs/azure.md b/docs/azure.md index 9b6532f13b..8218f65617 100644 --- a/docs/azure.md +++ b/docs/azure.md @@ -135,6 +135,11 @@ export ARM_TENANT_ID=[TENANT_ID] * `azurerm_network_interface` * `network_security_group` * `azurerm_network_security_group` + * `azurerm_network_security_rule` +* `network_watcher` + * `azurerm_network_watcher` + * `azurerm_network_watcher_flow_log` + * `azurerm_network_packet_capture` * `private_dns` * `azurerm_private_dns_a_record` * `azurerm_private_dns_aaaa_record` @@ -157,6 +162,11 @@ export ARM_TENANT_ID=[TENANT_ID] * `azurerm_purview_account` * `resource_group` * `azurerm_resource_group` + * `azurerm_management_lock` +* `route_table` + * `azurerm_route_table` + * `azurerm_route` + * `azurerm_route_filter` * `scaleset` * `azurerm_virtual_machine_scale_set` * `security_center` @@ -174,6 +184,7 @@ export ARM_TENANT_ID=[TENANT_ID] * `azurerm_synapse_managed_private_endpoint` * `azurerm_synapse_private_link_hub` * `virtual_machine` + * `azurerm_ssh_public_key` * `azurerm_virtual_machine` * `virtual_network` * `azurerm_virtual_network` diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index 42c4a3eca8..a2703bef9f 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -198,11 +198,27 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "subnet": []string{"subnet_id", "id"}, }, "network_security_group": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, + "network_security_group": []string{"network_security_group_name", "name"}, + }, + "network_watcher": { + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, + "network_watcher": []string{"network_watcher_name", "name"}, + "storage_account": []string{"storage_account_id", "id"}, }, "private_dns": { "resource_group": []string{"resource_group_name", "name"}, "virtual_network": []string{"virtual_network_id", "id"}, + "private_dns": []string{ + "zone_name", "name", + "private_dns_zone_name", "name", + }, }, "private_endpoint": { "resource_group": []string{"resource_group_name", "name"}, @@ -217,9 +233,22 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "redis": { "resource_group": []string{"resource_group_name", "name"}, }, + "route_table": { + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, + "route_table": []string{"route_table_name", "name"}, + }, "scaleset": { "resource_group": []string{"resource_group_name", "name"}, }, + "ssh_public_key": { + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, + }, "storage_account": { "resource_group": []string{"resource_group_name", "name"}, "virtual_network": []string{"virtual_network_subnet_ids", "id"}, @@ -268,17 +297,21 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG "eventhub": &EventHubGenerator{}, "keyvault": &KeyVaultGenerator{}, "load_balancer": &LoadBalancerGenerator{}, + "management_lock": &ManagementLockGenerator{}, "network_interface": &NetworkInterfaceGenerator{}, "network_security_group": &NetworkSecurityGroupGenerator{}, + "network_watcher": &NetworkWatcherGenerator{}, "private_dns": &PrivateDNSGenerator{}, "private_endpoint": &PrivateEndpointGenerator{}, "public_ip": &PublicIPGenerator{}, "purview": &PurviewGenerator{}, "redis": &RedisGenerator{}, "resource_group": &ResourceGroupGenerator{}, + "route_table": &RouteTableGenerator{}, "scaleset": &ScaleSetGenerator{}, "security_center_contact": &SecurityCenterContactGenerator{}, "security_center_subscription_pricing": &SecurityCenterSubscriptionPricingGenerator{}, + "ssh_public_key": &SSHPublicKeyGenerator{}, "storage_account": &StorageAccountGenerator{}, "storage_blob": &StorageBlobGenerator{}, "storage_container": &StorageContainerGenerator{}, diff --git a/providers/azure/data_factory.go b/providers/azure/data_factory.go index 30f813b920..ce558f7f8c 100644 --- a/providers/azure/data_factory.go +++ b/providers/azure/data_factory.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package azure import ( diff --git a/providers/azure/databricks.go b/providers/azure/databricks.go index ad2749f948..acede36ff3 100644 --- a/providers/azure/databricks.go +++ b/providers/azure/databricks.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package azure import ( diff --git a/providers/azure/eventhub.go b/providers/azure/eventhub.go index 5b0c7ad6fa..6fd25bf9c0 100644 --- a/providers/azure/eventhub.go +++ b/providers/azure/eventhub.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package azure import ( diff --git a/providers/azure/management_lock.go b/providers/azure/management_lock.go new file mode 100644 index 0000000000..25925fb087 --- /dev/null +++ b/providers/azure/management_lock.go @@ -0,0 +1,71 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" +) + +type ManagementLockGenerator struct { + AzureService +} + +func (az *ManagementLockGenerator) listResources() ([]locks.ManagementLockObject, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := locks.NewManagementLocksClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator locks.ManagementLockListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListAtResourceGroupLevelComplete(ctx, resourceGroup, "") + } else { + iterator, err = client.ListAtSubscriptionLevelComplete(ctx, "") + } + if err != nil { + return nil, err + } + var resources []locks.ManagementLockObject + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *ManagementLockGenerator) appendResource(resource *locks.ManagementLockObject) { + az.AppendSimpleResource(*resource.ID, *resource.Name, "azurerm_management_lock") +} + +func (az *ManagementLockGenerator) InitResources() error { + + resources, err := az.listResources() + if err != nil { + return err + } + for _, resource := range resources { + az.appendResource(&resource) + } + return nil +} diff --git a/providers/azure/network_security_group.go b/providers/azure/network_security_group.go index ecbd0e2b5f..9743d0bac4 100644 --- a/providers/azure/network_security_group.go +++ b/providers/azure/network_security_group.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Terraformer Authors. +// Copyright 2021 The Terraformer Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,27 +18,35 @@ import ( "context" "log" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-08-01/network" - "github.com/Azure/go-autorest/autorest" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/hashicorp/go-azure-helpers/authentication" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-03-01/network" ) type NetworkSecurityGroupGenerator struct { AzureService } -func (g NetworkSecurityGroupGenerator) createResources(securityGroupListResult network.SecurityGroupListResultIterator) ([]terraformutils.Resource, error) { - var resources []terraformutils.Resource - for securityGroupListResult.NotDone() { - nsg := securityGroupListResult.Value() - resources = append(resources, terraformutils.NewSimpleResource( - *nsg.ID, - *nsg.Name, - "azurerm_network_security_group", - "azurerm", - []string{})) - if err := securityGroupListResult.Next(); err != nil { +func (az *NetworkSecurityGroupGenerator) listResources() ([]network.SecurityGroup, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := network.NewSecurityGroupsClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator network.SecurityGroupListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListAllComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []network.SecurityGroup + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return resources, err } @@ -46,23 +54,46 @@ func (g NetworkSecurityGroupGenerator) createResources(securityGroupListResult n return resources, nil } -func (g *NetworkSecurityGroupGenerator) InitResources() error { - ctx := context.Background() - securityGroupsClient := network.NewSecurityGroupsClient(g.Args["config"].(authentication.Config).SubscriptionID) - securityGroupsClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) +func (az *NetworkSecurityGroupGenerator) appendResource(resource *network.SecurityGroup) { + az.AppendSimpleResource(*resource.ID, *resource.Name, "azurerm_network_security_group") +} - var ( - output network.SecurityGroupListResultIterator - err error - ) - if rg := g.Args["resource_group"].(string); rg != "" { - output, err = securityGroupsClient.ListComplete(ctx, rg) - } else { - output, err = securityGroupsClient.ListAllComplete(ctx) +func (az *NetworkSecurityGroupGenerator) appendRules(parent *network.SecurityGroup, resourceGroupID *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := network.NewSecurityRulesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListComplete(ctx, resourceGroupID.ResourceGroup, *parent.Name) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_network_security_rule") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } } + return nil +} + +func (az *NetworkSecurityGroupGenerator) InitResources() error { + + resources, err := az.listResources() if err != nil { return err } - g.Resources, err = g.createResources(output) - return err + for _, resource := range resources { + az.appendResource(&resource) + resourceGroupID, err := ParseAzureResourceID(*resource.ID) + if err != nil { + return err + } + err = az.appendRules(&resource, resourceGroupID) + if err != nil { + return err + } + } + return nil } diff --git a/providers/azure/network_watcher.go b/providers/azure/network_watcher.go new file mode 100644 index 0000000000..3db38bec45 --- /dev/null +++ b/providers/azure/network_watcher.go @@ -0,0 +1,109 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-03-01/network" +) + +type NetworkWatcherGenerator struct { + AzureService +} + +func (az *NetworkWatcherGenerator) listResources() ([]network.Watcher, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := network.NewWatchersClient(subscriptionID) + client.Authorizer = authorizer + var ( + resources network.WatcherListResult + err error + ) + ctx := context.Background() + if resourceGroup != "" { + resources, err = client.List(ctx, resourceGroup) + } else { + resources, err = client.ListAll(ctx) + } + if err != nil { + return nil, err + } + return *resources.Value, nil +} + +func (az *NetworkWatcherGenerator) appendResource(resource *network.Watcher) { + az.AppendSimpleResource(*resource.ID, *resource.Name, "azurerm_network_watcher") +} + +func (az *NetworkWatcherGenerator) appendFlowLogs(parent *network.Watcher, resourceGroupID *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := network.NewFlowLogsClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListComplete(ctx, resourceGroupID.ResourceGroup, *parent.Name) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_network_watcher_flow_log") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *NetworkWatcherGenerator) appendPacketCaptures(parent *network.Watcher, resourceGroupID *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := network.NewPacketCapturesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + resources, err := client.List(ctx, resourceGroupID.ResourceGroup, *parent.Name) + if err != nil { + return err + } + for _, item := range *resources.Value { + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_network_packet_capture") + } + return nil +} + +func (az *NetworkWatcherGenerator) InitResources() error { + + resources, err := az.listResources() + if err != nil { + return err + } + for _, resource := range resources { + az.appendResource(&resource) + resourceGroupID, err := ParseAzureResourceID(*resource.ID) + if err != nil { + return err + } + err = az.appendFlowLogs(&resource, resourceGroupID) + if err != nil { + return err + } + err = az.appendPacketCaptures(&resource, resourceGroupID) + if err != nil { + return err + } + } + return nil +} diff --git a/providers/azure/private_endpoint.go b/providers/azure/private_endpoint.go index bea08893d2..acacbcf94f 100644 --- a/providers/azure/private_endpoint.go +++ b/providers/azure/private_endpoint.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package azure import ( diff --git a/providers/azure/purview.go b/providers/azure/purview.go index 43901bc135..a4fce7d037 100644 --- a/providers/azure/purview.go +++ b/providers/azure/purview.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package azure import ( diff --git a/providers/azure/route_table.go b/providers/azure/route_table.go new file mode 100644 index 0000000000..b0b9b6bde4 --- /dev/null +++ b/providers/azure/route_table.go @@ -0,0 +1,143 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-03-01/network" +) + +type RouteTableGenerator struct { + AzureService +} + +func (az *RouteTableGenerator) listResources() ([]network.RouteTable, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := network.NewRouteTablesClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator network.RouteTableListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListAllComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []network.RouteTable + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *RouteTableGenerator) appendResource(resource *network.RouteTable) { + az.AppendSimpleResource(*resource.ID, *resource.Name, "azurerm_route_table") +} + +func (az *RouteTableGenerator) appendRoutes(parent *network.RouteTable, resourceGroupID *ResourceID) error { + subscriptionID, _, authorizer := az.getClientArgs() + client := network.NewRoutesClient(subscriptionID) + client.Authorizer = authorizer + ctx := context.Background() + iterator, err := client.ListComplete(ctx, resourceGroupID.ResourceGroup, *parent.Name) + if err != nil { + return err + } + for iterator.NotDone() { + item := iterator.Value() + az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_route") + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return err + } + } + return nil +} + +func (az *RouteTableGenerator) listRouteFilters() ([]network.RouteFilter, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := network.NewRouteFiltersClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator network.RouteFilterListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []network.RouteFilter + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *RouteTableGenerator) appendRouteFilters(resource *network.RouteFilter) { + az.AppendSimpleResource(*resource.ID, *resource.Name, "azurerm_route_filter") +} + +func (az *RouteTableGenerator) InitResources() error { + + resources, err := az.listResources() + if err != nil { + return err + } + for _, resource := range resources { + az.appendResource(&resource) + resourceGroupID, err := ParseAzureResourceID(*resource.ID) + if err != nil { + return err + } + err = az.appendRoutes(&resource, resourceGroupID) + if err != nil { + return err + } + } + + filters, err := az.listRouteFilters() + if err != nil { + return err + } + for _, resource := range filters { + az.appendRouteFilters(&resource) + if err != nil { + return err + } + } + return nil +} diff --git a/providers/azure/ssh_public_key.go b/providers/azure/ssh_public_key.go new file mode 100644 index 0000000000..7c6d234d23 --- /dev/null +++ b/providers/azure/ssh_public_key.go @@ -0,0 +1,71 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-12-01/compute" +) + +type SSHPublicKeyGenerator struct { + AzureService +} + +func (az *SSHPublicKeyGenerator) listResources() ([]compute.SSHPublicKeyResource, error) { + subscriptionID, resourceGroup, authorizer := az.getClientArgs() + client := compute.NewSSHPublicKeysClient(subscriptionID) + client.Authorizer = authorizer + var ( + iterator compute.SSHPublicKeysGroupListResultIterator + err error + ) + ctx := context.Background() + if resourceGroup != "" { + iterator, err = client.ListByResourceGroupComplete(ctx, resourceGroup) + } else { + iterator, err = client.ListBySubscriptionComplete(ctx) + } + if err != nil { + return nil, err + } + var resources []compute.SSHPublicKeyResource + for iterator.NotDone() { + item := iterator.Value() + resources = append(resources, item) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (az *SSHPublicKeyGenerator) appendResource(resource *compute.SSHPublicKeyResource) { + az.AppendSimpleResource(*resource.ID, *resource.Name, "azurerm_ssh_public_key") +} + +func (az *SSHPublicKeyGenerator) InitResources() error { + + resources, err := az.listResources() + if err != nil { + return err + } + for _, resource := range resources { + az.appendResource(&resource) + } + return nil +} diff --git a/providers/azure/subnet.go b/providers/azure/subnet.go index d017e52d84..484b369499 100644 --- a/providers/azure/subnet.go +++ b/providers/azure/subnet.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package azure import ( diff --git a/providers/azure/synapse.go b/providers/azure/synapse.go index aebe8add22..da43b724a2 100644 --- a/providers/azure/synapse.go +++ b/providers/azure/synapse.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package azure import ( From c911a345992e94302af5c371d5f7c53fd5bfd2a2 Mon Sep 17 00:00:00 2001 From: rui Date: Mon, 27 Sep 2021 17:06:03 -0400 Subject: [PATCH 242/276] deps: go-fastly 3.12.0 (#1063) Signed-off-by: Rui Chen --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eaf1782869..927fae1f25 100644 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/duosecurity/duo_api_golang v0.0.0-20201112143038-0e07e9f869e3 // indirect github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect - github.com/fastly/go-fastly/v3 v3.9.3 + github.com/fastly/go-fastly/v3 v3.12.0 github.com/fatih/structs v1.1.0 // indirect github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d // indirect github.com/google/go-github/v35 v35.1.0 diff --git a/go.sum b/go.sum index a765b50485..209cd99979 100644 --- a/go.sum +++ b/go.sum @@ -495,8 +495,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y 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/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fastly/go-fastly/v3 v3.9.3 h1:/uwbNqS3zU9QaAXeSlZ3zXjF1fBw7CdoPj6RQLQm/bg= -github.com/fastly/go-fastly/v3 v3.9.3/go.mod h1:KOaCWsmkIKSASPzADl8PT/bTQIghOw/eEaxlHOu3jMA= +github.com/fastly/go-fastly/v3 v3.12.0 h1:rF+SF34yYcX2eig7aOXiDKdT/ipdfnxKHiNfsbnsR4s= +github.com/fastly/go-fastly/v3 v3.12.0/go.mod h1:KOaCWsmkIKSASPzADl8PT/bTQIghOw/eEaxlHOu3jMA= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= From 1dcc8758284948c4b6b7cfd4e0b84acc39b9f36b Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 27 Sep 2021 18:06:45 -0300 Subject: [PATCH 243/276] hcl: fix for #921: 002D printed instead of hyphen (#1045) * terraformutils: fixed #921: 002D printed instead of hyphen * hcl: fix tests failing after hyphens fix --- terraformutils/connect_test.go | 12 ++++++------ terraformutils/hcl.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/terraformutils/connect_test.go b/terraformutils/connect_test.go index afc76c5a46..2263c703d8 100644 --- a/terraformutils/connect_test.go +++ b/terraformutils/connect_test.go @@ -40,7 +40,7 @@ func TestSimpleReference(t *testing.T) { resources := ConnectServices(importResources, true, resourceConnections) if !reflect.DeepEqual(resources["type1"][0].Item, map[string]interface{}{ - "type2_ref": "${data.terraform_remote_state.type2.outputs.type2_tfer--name-002D-type2_id}", + "type2_ref": "${data.terraform_remote_state.type2.outputs.type2_tfer--name-type2_id}", }) { t.Errorf("failed to connect %v", resources["type1"][0].Item) } @@ -69,8 +69,8 @@ func TestManyReferences(t *testing.T) { resources := ConnectServices(importResources, true, resourceConnections) if !reflect.DeepEqual(resources["type1"][0].Item, map[string]interface{}{ - "type2_ref1": "${data.terraform_remote_state.type2.outputs.type2_tfer--name-002D-type2_id}", - "type2_ref2": "${data.terraform_remote_state.type2.outputs.type2_tfer--name-002D-type2_id}", + "type2_ref1": "${data.terraform_remote_state.type2.outputs.type2_tfer--name-type2_id}", + "type2_ref2": "${data.terraform_remote_state.type2.outputs.type2_tfer--name-type2_id}", }) { t.Errorf("failed to connect %v", resources["type1"][0].Item) } @@ -106,8 +106,8 @@ func TestResourceGroups(t *testing.T) { resources := ConnectServices(importResources, true, resourceConnections) if !reflect.DeepEqual(resources["group1"][0].Item, map[string]interface{}{ - "type2_ref1": "${data.terraform_remote_state.group2.outputs.type2_tfer--name-002D-type2_uid}", - "type2_ref2": "${data.terraform_remote_state.group2.outputs.type2_tfer--name-002D-type2_uid}", + "type2_ref1": "${data.terraform_remote_state.group2.outputs.type2_tfer--name-type2_uid}", + "type2_ref2": "${data.terraform_remote_state.group2.outputs.type2_tfer--name-type2_uid}", }) { t.Errorf("failed to connect %v", resources["group1"][0].Item) } @@ -128,7 +128,7 @@ func TestNestedReference(t *testing.T) { } resources := ConnectServices(importResources, true, resourceConnections) - if !reflect.DeepEqual(resources["type1"][0].Item, mapI("nested", mapI("type2_ref", "${data.terraform_remote_state.type2.outputs.type2_tfer--name-002D-type2_id}"))) { + if !reflect.DeepEqual(resources["type1"][0].Item, mapI("nested", mapI("type2_ref", "${data.terraform_remote_state.type2.outputs.type2_tfer--name-type2_id}"))) { t.Errorf("failed to connect %v", resources) } } diff --git a/terraformutils/hcl.go b/terraformutils/hcl.go index c439df4570..ca970332b7 100644 --- a/terraformutils/hcl.go +++ b/terraformutils/hcl.go @@ -32,7 +32,7 @@ import ( const safeChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_" -var unsafeChars = regexp.MustCompile(`[^0-9A-Za-z_]`) +var unsafeChars = regexp.MustCompile(`[^0-9A-Za-z_\-]`) // sanitizer fixes up an invalid HCL AST, as produced by the HCL parser for JSON type astSanitizer struct{} From dc62f23e2375720bc10dfdaaf800b8e2e7b202e5 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Tue, 28 Sep 2021 19:10:22 -0300 Subject: [PATCH 244/276] azurerm: misc improvements (#1068) * azurerm: more resource connections * azurerm: fix azurerm_synapse_managed_private_endpoint * azurerm: refactor AzureService --- providers/azure/azure_provider.go | 101 +++++++++++++++++------------- providers/azure/azure_service.go | 34 ++++++++++ providers/azure/synapse.go | 12 ++-- 3 files changed, 97 insertions(+), 50 deletions(-) diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index a2703bef9f..d77282d047 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -21,10 +21,11 @@ import ( "strings" "github.com/Azure/go-autorest/autorest" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" "github.com/hashicorp/go-azure-helpers/authentication" "github.com/hashicorp/go-azure-helpers/sender" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/GoogleCloudPlatform/terraformer/terraformutils/providerwrapper" ) type AzureProvider struct { //nolint @@ -149,18 +150,28 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "resource_group": []string{"resource_group_name", "name"}, }, "cosmosdb": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, }, "container": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, }, "database": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, }, "databricks": { "resource_group": []string{ "resource_group_name", "name", "managed_resource_group_name", "name", + "location", "location", }, "storage_account": []string{"storage_account_name", "name"}, "subnet": []string{ @@ -170,9 +181,19 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "virtual_network": []string{"virtual_network_id", "id"}, }, "data_factory": { - "resource_group": []string{"resource_group_name", "name"}, - "data_factory": []string{"data_factory_name", "name"}, - "keyvault": []string{"keyvault_id", "id"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, + "data_factory": []string{ + "data_factory_name", "name", + "data_factory_id", "id", + "linked_service_name", "name", + "integration_runtime_name", "name", + }, + "databricks": []string{"existing_cluster_id", "id"}, + "keyvault": []string{"keyvault_id", "id"}, + "storage_account": []string{"storage_account_id", "id"}, }, "disk": { "resource_group": []string{"resource_group_name", "name"}, @@ -188,14 +209,20 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { }, }, "keyvault": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, }, "load_balancer": { "resource_group": []string{"resource_group_name", "name"}, }, "network_interface": { - "resource_group": []string{"resource_group_name", "name"}, - "subnet": []string{"subnet_id", "id"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, + "subnet": []string{"subnet_id", "id"}, }, "network_security_group": { "resource_group": []string{ @@ -221,11 +248,17 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { }, }, "private_endpoint": { - "resource_group": []string{"resource_group_name", "name"}, - "subnet": []string{"subnet_id", "id"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, + "subnet": []string{"subnet_id", "id"}, }, "public_ip": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, }, "purview": { "resource_group": []string{"resource_group_name", "name"}, @@ -250,7 +283,10 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { }, }, "storage_account": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, "virtual_network": []string{"virtual_network_subnet_ids", "id"}, }, "storage_blob": { @@ -271,10 +307,14 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "resource_group": []string{"resource_group_name", "name"}, "virtual_network": []string{"virtual_network_name", "name"}, "network_security_group": []string{"network_security_group_id", "id"}, + "route_table": []string{"route_table_id", "id"}, "subnet": []string{"subnet_id", "id"}, }, "virtual_machine": { - "resource_group": []string{"resource_group_name", "name"}, + "resource_group": []string{ + "resource_group_name", "name", + "location", "location", + }, "network_interface": []string{"network_interface_ids", "id"}, }, "virtual_network": { @@ -338,32 +378,3 @@ func (p *AzureProvider) InitService(serviceName string, verbose bool) error { }) return nil } - -func (p *AzureService) getClientArgs() (subscriptionID string, resourceGroup string, authorizer autorest.Authorizer) { - subs := p.Args["config"].(authentication.Config).SubscriptionID - auth := p.Args["authorizer"].(autorest.Authorizer) - resg := p.Args["resource_group"].(string) - return subs, resg, auth -} - -func (p *AzureService) AppendSimpleResource(id string, resourceName string, resourceType string) { - newResource := terraformutils.NewSimpleResource(id, resourceName, resourceType, p.ProviderName, []string{}) - p.Resources = append(p.Resources, newResource) -} - -func (p *AzureService) appendSimpleAssociation(id string, linkedResourceName string, resourceName *string, resourceType string, attributes map[string]string) { - var resourceName2 string - if resourceName != nil { - resourceName2 = *resourceName - } else { - resourceName0 := strings.ReplaceAll(resourceType, "azurerm_", "") - resourceName1 := resourceName0[strings.IndexByte(resourceName0, '_'):] - resourceName2 = linkedResourceName + resourceName1 - } - newResource := terraformutils.NewResource( - id, resourceName2, resourceType, p.ProviderName, attributes, - []string{"name"}, - map[string]interface{}{}, - ) - p.Resources = append(p.Resources, newResource) -} diff --git a/providers/azure/azure_service.go b/providers/azure/azure_service.go index 4f2975f1ab..b1e1af14b1 100644 --- a/providers/azure/azure_service.go +++ b/providers/azure/azure_service.go @@ -15,9 +15,43 @@ package azure import ( + "strings" + + "github.com/Azure/go-autorest/autorest" + "github.com/hashicorp/go-azure-helpers/authentication" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) type AzureService struct { //nolint terraformutils.Service } + +func (az *AzureService) getClientArgs() (subscriptionID string, resourceGroup string, authorizer autorest.Authorizer) { + subs := az.Args["config"].(authentication.Config).SubscriptionID + auth := az.Args["authorizer"].(autorest.Authorizer) + resg := az.Args["resource_group"].(string) + return subs, resg, auth +} + +func (az *AzureService) AppendSimpleResource(id string, resourceName string, resourceType string) { + newResource := terraformutils.NewSimpleResource(id, resourceName, resourceType, az.ProviderName, []string{}) + az.Resources = append(az.Resources, newResource) +} + +func (az *AzureService) appendSimpleAssociation(id string, linkedResourceName string, resourceName *string, resourceType string, attributes map[string]string) { + var resourceName2 string + if resourceName != nil { + resourceName2 = *resourceName + } else { + resourceName0 := strings.ReplaceAll(resourceType, "azurerm_", "") + resourceName1 := resourceName0[strings.IndexByte(resourceName0, '_'):] + resourceName2 = linkedResourceName + resourceName1 + } + newResource := terraformutils.NewResource( + id, resourceName2, resourceType, az.ProviderName, attributes, + []string{"name"}, + map[string]interface{}{}, + ) + az.Resources = append(az.Resources, newResource) +} diff --git a/providers/azure/synapse.go b/providers/azure/synapse.go index da43b724a2..edf47d18fb 100644 --- a/providers/azure/synapse.go +++ b/providers/azure/synapse.go @@ -126,6 +126,9 @@ func (az *SynapseGenerator) appendManagedPrivateEndpoint(workspace *synapse.Work return nil } virtualNetworkName := *workspace.WorkspaceProperties.ManagedVirtualNetwork + if virtualNetworkName == "" || virtualNetworkName == "default" { + return nil + } subscriptionID, _, authorizer := az.getClientArgs() client := managedvirtualnetwork.NewManagedPrivateEndpointsClient(subscriptionID) client.Authorizer = authorizer @@ -209,11 +212,10 @@ func (az *SynapseGenerator) InitResources() error { } hubs, err := az.listPrivateLinkHubs() - if err != nil { - return err - } - for _, hub := range hubs { - az.appendtPrivateLinkHubs(&hub) + if err == nil { + for _, hub := range hubs { + az.appendtPrivateLinkHubs(&hub) + } } return nil } From d2916ad40b1767601537157aee36dfe6ce385503 Mon Sep 17 00:00:00 2001 From: rajnadimpalli <55568696+rajnadimpalli@users.noreply.github.com> Date: Thu, 30 Sep 2021 05:56:12 +1000 Subject: [PATCH 245/276] Add Okta Schema, TOTP, App Schema resources (#1070) * Add Okta Schemas, TOTP Factors * Add Okta Schemas, TOTP Factors * Add Okta Schema, TOTP, App Schema resources --- go.mod | 4 +- go.sum | 5 ++ providers/okta/app.go | 48 ++++++------ providers/okta/app_user_schema.go | 82 ++++++++++++++++++++ providers/okta/factor.go | 52 +++++++++++-- providers/okta/helpers.go | 26 +++++++ providers/okta/network_zone.go | 15 ++-- providers/okta/okta_provider.go | 2 + providers/okta/okta_service.go | 6 +- providers/okta/user_schema.go | 125 ++++++++++++++++++++++++++++++ 10 files changed, 320 insertions(+), 45 deletions(-) create mode 100644 providers/okta/app_user_schema.go create mode 100644 providers/okta/user_schema.go diff --git a/go.mod b/go.mod index 927fae1f25..fa908f651a 100644 --- a/go.mod +++ b/go.mod @@ -140,8 +140,7 @@ require ( github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200506151941-509881368409 github.com/nicksnyder/go-i18n v1.10.1 // indirect github.com/ns1/ns1-go v2.4.0+incompatible - github.com/okta/okta-sdk-golang/v2 v2.6.1 - github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9 + github.com/okta/okta-sdk-golang/v2 v2.6.3-0.20210923165359-20aeac44ab01 github.com/opencontainers/image-spec v1.0.1 // indirect github.com/opencontainers/runc v1.0.1 // indirect github.com/ory/dockertest v3.3.5+incompatible // indirect @@ -278,6 +277,7 @@ require ( github.com/mozillazg/go-httpheader v0.2.1 // indirect github.com/oklog/run v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect + github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 // indirect github.com/pborman/uuid v1.2.0 // indirect diff --git a/go.sum b/go.sum index 209cd99979..2066f21200 100644 --- a/go.sum +++ b/go.sum @@ -824,6 +824,7 @@ github.com/hashicorp/terraform-plugin-sdk v1.16.1 h1:G2iK7MBT4LuNcVASPXWS1ciBUuI github.com/hashicorp/terraform-plugin-sdk v1.16.1/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0/go.mod h1:grseeRo9g3yNkYW09iFlV8LG78jTa1ssBgouogQg/RU= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.1/go.mod h1:o3pdss6ynDZW9FfiZ+rETUH5LEVufrXdhwLU+5OiRo0= github.com/hashicorp/terraform-plugin-test/v2 v2.1.3/go.mod h1:pmaUHiUtDL/8Mz3FuyZ/vRDb0LpaOWQjVRW9ORF7FHs= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= @@ -1044,8 +1045,12 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/okta/okta-sdk-golang/v2 v2.3.1-0.20210617075430-6c6c25f48f92/go.mod h1:G4GCqqnZJCt91zMqYhDMLhg2INVbjiiFKkQ2mnia1J0= github.com/okta/okta-sdk-golang/v2 v2.6.1 h1:r0C6Z+WXuBIUv3/lq6wDGqoZBAcrNNCSoixB/BhLONo= github.com/okta/okta-sdk-golang/v2 v2.6.1/go.mod h1:0y8stgdplWMjaEbMr4mVtw0R+BdktpGZRw2sWKZWsMs= +github.com/okta/okta-sdk-golang/v2 v2.6.3-0.20210923165359-20aeac44ab01 h1:eTw4NCD4FBAAT+tqx8qq2WhPjVwauVp//mvG4c3wrUY= +github.com/okta/okta-sdk-golang/v2 v2.6.3-0.20210923165359-20aeac44ab01/go.mod h1:0y8stgdplWMjaEbMr4mVtw0R+BdktpGZRw2sWKZWsMs= github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9 h1:gC6OakV7GUVaTKm3KMpqVe9LOQfflzePtFsVDUbCPgo= github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9/go.mod h1:G6kMVF+QIjldN0X6s1U8MAcHNOWwdwJiMWmeCyotCJc= +github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b h1:ML6q0susBNxEEXZkifQGjY5ILGJHhU0a72Dm2DHEbSg= +github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b/go.mod h1:hVb3TxYi4ibGeUpue2Rqm84YhD/473w0Xv0uIlylUY8= github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= diff --git a/providers/okta/app.go b/providers/okta/app.go index 1dc08626f0..11522be39b 100644 --- a/providers/okta/app.go +++ b/providers/okta/app.go @@ -22,8 +22,22 @@ import ( //NOTE: Okta SDK v2.6.1 ListApplications() method does not support applications by type at this time. So // we have to create the application filter by our self. - func getApplications(ctx context.Context, client *okta.Client, signOnMode string) ([]*okta.Application, error) { + supportedApps, err := getAllApplications(ctx, client) + if err != nil { + return nil, err + } + + var filterApps []*okta.Application + for _, app := range supportedApps { + if app.SignOnMode == signOnMode { + filterApps = append(filterApps, app) + } + } + return filterApps, nil +} + +func getAllApplications(ctx context.Context, client *okta.Client) ([]*okta.Application, error) { apps, resp, err := client.Application.ListApplications(ctx, nil) if err != nil { return nil, err @@ -38,34 +52,18 @@ func getApplications(ctx context.Context, client *okta.Client, signOnMode string apps = append(apps, nextAppSet...) } - resultingApps := make([]*okta.Application, len(apps)) - for i := range apps { - resultingApps[i] = apps[i].(*okta.Application) - } - var supportedApps []*okta.Application - for _, app := range resultingApps { + for _, app := range apps { //NOTE: Okta provider does not support the following app type/name - if app.Name == "template_wsfed" || - app.Name == "template_swa_two_page" || - app.Name == "okta_enduser" || - app.Name == "okta_browser_plugin" || - app.Name == "saasure" { + if app.(*okta.Application).Name == "template_wsfed" || + app.(*okta.Application).Name == "template_swa_two_page" || + app.(*okta.Application).Name == "okta_enduser" || + app.(*okta.Application).Name == "okta_browser_plugin" || + app.(*okta.Application).Name == "saasure" { continue } - supportedApps = append(supportedApps, app) - } - - oktaSupportApplications := map[*okta.Application]string{} - for _, app := range supportedApps { - oktaSupportApplications[app] = app.SignOnMode + supportedApps = append(supportedApps, app.(*okta.Application)) } - var filterApps []*okta.Application - for app, appSignOnNode := range oktaSupportApplications { - if appSignOnNode == signOnMode { - filterApps = append(filterApps, app) - } - } - return filterApps, nil + return supportedApps, nil } diff --git a/providers/okta/app_user_schema.go b/providers/okta/app_user_schema.go new file mode 100644 index 0000000000..2738c6defa --- /dev/null +++ b/providers/okta/app_user_schema.go @@ -0,0 +1,82 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type AppUserSchemaPropertyGenerator struct { + OktaService +} + +func (g AppUserSchemaPropertyGenerator) createResources(appUserSchema *okta.UserSchema, appID string) []terraformutils.Resource { + var resources []terraformutils.Resource + for index := range appUserSchema.Definitions.Custom.Properties { + resources = append(resources, terraformutils.NewResource( + index, + normalizeResourceName(appID)+"_property_"+normalizeResourceName(index), + "okta_app_user_schema_property", + "okta", + map[string]string{ + "app_id": appID, + "index": index, + }, + []string{}, + map[string]interface{}{}, + )) + } + + for index := range appUserSchema.Definitions.Base.Properties { + resources = append(resources, terraformutils.NewResource( + index, + normalizeResourceName(appID)+"_property_"+normalizeResourceName(index), + "okta_app_user_base_schema_property", + "okta", + map[string]string{ + "app_id": appID, + "index": index, + }, + []string{}, + map[string]interface{}{}, + )) + } + return resources +} + +func (g *AppUserSchemaPropertyGenerator) InitResources() error { + var resources []terraformutils.Resource + ctx, client, e := g.Client() + if e != nil { + return e + } + + apps, err := getAllApplications(ctx, client) + if err != nil { + return err + } + + for _, app := range apps { + appUserSchema, _, err := client.UserSchema.GetApplicationUserSchema(ctx, app.Id) + if err != nil { + return err + } + + resources = append(resources, g.createResources(appUserSchema, app.Id)...) + } + g.Resources = resources + return nil +} diff --git a/providers/okta/factor.go b/providers/okta/factor.go index 5aad0e42b8..fed75f0b7d 100644 --- a/providers/okta/factor.go +++ b/providers/okta/factor.go @@ -19,7 +19,6 @@ import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/okta/okta-sdk-golang/v2/okta" - "github.com/okta/terraform-provider-okta/sdk" ) @@ -27,13 +26,13 @@ type FactorGenerator struct { OktaService } -func (g FactorGenerator) createResources(factorList []*sdk.Factor) []terraformutils.Resource { +func (g FactorGenerator) createResources(ctx context.Context, factorList []*okta.UserFactor, client *sdk.APISupplement) []terraformutils.Resource { var resources []terraformutils.Resource for _, factor := range factorList { if factor.Status == "ACTIVE" { resources = append(resources, terraformutils.NewResource( factor.Id, - factor.Id, + "factor_"+normalizeResourceNameWithRandom(factor.Id, true), "okta_factor", "okta", map[string]string{ @@ -43,13 +42,37 @@ func (g FactorGenerator) createResources(factorList []*sdk.Factor) []terraformut map[string]interface{}{}, )) + if factor.FactorType == "token:hotp" { + hotpFactorProfiles, _, _ := getHotpFactorProfiles(ctx, client) + + for _, factorProfile := range hotpFactorProfiles { + if factorProfile != nil { + resources = append(resources, terraformutils.NewResource( + factorProfile.ID, + "factor_totp_"+normalizeResourceNameWithRandom(factorProfile.Name, true), + "okta_factor_totp", + "okta", + map[string]string{}, + []string{}, + map[string]interface{}{ + "name": factorProfile.Name, + "otp_length": factorProfile.Settings.OtpLength, + "time_step": factorProfile.Settings.TimeStep, + "clock_drift_interval": factorProfile.Settings.AcceptableAdjacentIntervals, + "shared_secret_encoding": factorProfile.Settings.Encoding, + "hmac_algorithm": factorProfile.Settings.TimeStep, + }, + )) + } + } + } } } return resources } func (g *FactorGenerator) InitResources() error { - var factors = []*sdk.Factor{} + var factors []*okta.UserFactor ctx, client, err := g.APISupplementClient() if err != nil { @@ -60,20 +83,35 @@ func (g *FactorGenerator) InitResources() error { if err != nil { return err } + factors = append(factors, output...) - g.Resources = g.createResources(factors) + g.Resources = g.createResources(ctx, factors, client) return nil } -func getListFactors(ctx context.Context, m *sdk.ApiSupplement) ([]*sdk.Factor, *okta.Response, error) { +func getListFactors(ctx context.Context, m *sdk.APISupplement) ([]*okta.UserFactor, *okta.Response, error) { //NOTE: Okta SDK does not support general ListFactors method so we got to manually implement the REST calls. url := "/api/v1/org/factors" req, err := m.RequestExecutor.NewRequest("GET", url, nil) if err != nil { return nil, nil, err } - var factors []*sdk.Factor + var factors []*okta.UserFactor + resp, err := m.RequestExecutor.Do(ctx, req, &factors) + if err != nil { + return nil, resp, err + } + return factors, resp, nil +} + +func getHotpFactorProfiles(ctx context.Context, m *sdk.APISupplement) ([]*sdk.HotpFactorProfile, *okta.Response, error) { + url := "/api/v1/org/factors/hotp/profiles" + req, err := m.RequestExecutor.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + var factors []*sdk.HotpFactorProfile resp, err := m.RequestExecutor.Do(ctx, req, &factors) if err != nil { return nil, resp, err diff --git a/providers/okta/helpers.go b/providers/okta/helpers.go index 222a4354a1..74cf117096 100644 --- a/providers/okta/helpers.go +++ b/providers/okta/helpers.go @@ -15,6 +15,8 @@ package okta import ( + "fmt" + "math/rand" "regexp" "strings" ) @@ -31,3 +33,27 @@ func normalizeResourceName(s string) string { return strings.ToLower(s) } + +func normalizeResourceNameWithRandom(s string, rand bool) string { + specialChars := `-<>()*#{}[]|@_ .%'",&` + for _, c := range specialChars { + s = strings.ReplaceAll(s, string(c), "_") + } + s = regexp.MustCompile(`^[^a-zA-Z_]+`).ReplaceAllLiteralString(s, "") + s = strings.TrimSuffix(s, "`_") + if rand { + randString := RandStringBytes(4) + return fmt.Sprintf("%s_%s", strings.ToLower(s), randString) + } + return strings.ToLower(s) +} + +const letterBytes = "abcdefghijklmnopqrstuvwxyz0123456789" + +func RandStringBytes(n int) string { + b := make([]byte, n) + for i := range b { + b[i] = letterBytes[rand.Intn(len(letterBytes))] + } + return string(b) +} diff --git a/providers/okta/network_zone.go b/providers/okta/network_zone.go index 72b7429e62..1c91c92067 100644 --- a/providers/okta/network_zone.go +++ b/providers/okta/network_zone.go @@ -16,20 +16,19 @@ package okta import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - - "github.com/okta/terraform-provider-okta/sdk" + "github.com/okta/okta-sdk-golang/v2/okta" ) type NetworkZoneGenerator struct { OktaService } -func (g NetworkZoneGenerator) createResources(networkZoneList []*sdk.NetworkZone) []terraformutils.Resource { +func (g NetworkZoneGenerator) createResources(networkZoneList []*okta.NetworkZone) []terraformutils.Resource { var resources []terraformutils.Resource for _, networkZone := range networkZoneList { resources = append(resources, terraformutils.NewResource( - networkZone.ID, + networkZone.Id, networkZone.Name, "okta_network_zone", "okta", @@ -45,18 +44,18 @@ func (g NetworkZoneGenerator) createResources(networkZoneList []*sdk.NetworkZone } func (g *NetworkZoneGenerator) InitResources() error { - ctx, client, err := g.APISupplementClient() + ctx, client, err := g.Client() if err != nil { return err } - output, resp, err := client.ListNetworkZones(ctx) + output, resp, err := client.NetworkZone.ListNetworkZones(ctx, nil) if err != nil { return err } for resp.HasNextPage() { - var networkZoneSet []*sdk.NetworkZone + var networkZoneSet []*okta.NetworkZone resp, _ = resp.Next(ctx, &networkZoneSet) output = append(output, networkZoneSet...) } @@ -65,7 +64,7 @@ func (g *NetworkZoneGenerator) InitResources() error { return nil } -func attributesNetworkZone(networkZone *sdk.NetworkZone) map[string]interface{} { +func attributesNetworkZone(networkZone *okta.NetworkZone) map[string]interface{} { attributes := map[string]interface{}{} attributes["usage"] = networkZone.Usage diff --git a/providers/okta/okta_provider.go b/providers/okta/okta_provider.go index dfe0fe0b9f..844dd3cad7 100644 --- a/providers/okta/okta_provider.go +++ b/providers/okta/okta_provider.go @@ -121,5 +121,7 @@ func (p *OktaProvider) GetSupportedService() map[string]terraformutils.ServiceGe "okta_auth_server_scope": &AuthorizationServerScopeGenerator{}, "okta_auth_server_claim": &AuthorizationServerClaimGenerator{}, "okta_auth_server_policy": &AuthorizationServerPolicyGenerator{}, + "okta_user_schema": &UserSchemaPropertyGenerator{}, + "okta_app_user_schema": &AppUserSchemaPropertyGenerator{}, } } diff --git a/providers/okta/okta_service.go b/providers/okta/okta_service.go index 05b10d9548..7dfff025c2 100644 --- a/providers/okta/okta_service.go +++ b/providers/okta/okta_service.go @@ -46,7 +46,7 @@ func (s *OktaService) Client() (context.Context, *okta.Client, error) { return ctx, client, nil } -func (s *OktaService) APISupplementClient() (context.Context, *sdk.ApiSupplement, error) { +func (s *OktaService) APISupplementClient() (context.Context, *sdk.APISupplement, error) { baseURL := s.Args["base_url"].(string) orgName := s.Args["org_name"].(string) apiToken := s.Args["api_token"].(string) @@ -62,8 +62,8 @@ func (s *OktaService) APISupplementClient() (context.Context, *sdk.ApiSupplement return ctx, nil, err } - apiSupplementClient := &sdk.ApiSupplement{ - RequestExecutor: client.GetRequestExecutor(), + apiSupplementClient := &sdk.APISupplement{ + RequestExecutor: client.CloneRequestExecutor(), } return ctx, apiSupplementClient, nil diff --git a/providers/okta/user_schema.go b/providers/okta/user_schema.go new file mode 100644 index 0000000000..a003df7c75 --- /dev/null +++ b/providers/okta/user_schema.go @@ -0,0 +1,125 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package okta + +import ( + "context" + "net/url" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/okta/okta-sdk-golang/v2/okta" +) + +type UserSchemaPropertyGenerator struct { + OktaService +} + +func (g UserSchemaPropertyGenerator) createResources(userSchema *okta.UserSchema, userTypeID string, userTypeName string) []terraformutils.Resource { + var resources []terraformutils.Resource + for index := range userSchema.Definitions.Custom.Properties { + resources = append(resources, terraformutils.NewResource( + index, + normalizeResourceName(userTypeName)+"_property_"+normalizeResourceName(index), + "okta_user_schema_property", + "okta", + map[string]string{ + "index": index, + "user_type": userTypeID, + }, + []string{}, + map[string]interface{}{}, + )) + } + + for index := range userSchema.Definitions.Base.Properties { + resources = append(resources, terraformutils.NewResource( + index, + normalizeResourceName(userTypeName)+"_property_"+normalizeResourceName(index), + "okta_user_base_schema_property", + "okta", + map[string]string{ + "index": index, + "user_type": userTypeID, + }, + []string{}, + map[string]interface{}{}, + )) + } + return resources +} + +func (g *UserSchemaPropertyGenerator) InitResources() error { + var resources []terraformutils.Resource + ctx, client, e := g.Client() + if e != nil { + return e + } + + userTypes, err := getUserTypes(ctx, client) + if err != nil { + return err + } + + for _, userType := range userTypes { + schemaID := getUserTypeSchemaID(userType) + if schemaID != "" { + schema, _, err := client.UserSchema.GetUserSchema(ctx, schemaID) + if err != nil { + return err + } + + userTypeID := "default" + if userType.Name != "user" { + userTypeID = userType.Id + } + + resources = append(resources, g.createResources(schema, userTypeID, userType.Name)...) + } + } + + g.Resources = resources + return nil +} + +func getUserTypes(ctx context.Context, client *okta.Client) ([]*okta.UserType, error) { + output, resp, err := client.UserType.ListUserTypes(ctx) + if err != nil { + return nil, err + } + + for resp.HasNextPage() { + var nextUserTypeSet []*okta.UserType + resp, _ = resp.Next(ctx, &nextUserTypeSet) + output = append(output, nextUserTypeSet...) + } + + return output, nil +} + +func getUserTypeSchemaID(ut *okta.UserType) string { + fm, ok := ut.Links.(map[string]interface{}) + if ok { + sm, ok := fm["schema"].(map[string]interface{}) + if ok { + href, ok := sm["href"].(string) + if ok { + u, _ := url.Parse(href) + return strings.TrimPrefix(u.EscapedPath(), "/api/v1/meta/schemas/user/") + } + } + } + return "" +} From 6943eb71c926cf7500a7710d6628e84486387d75 Mon Sep 17 00:00:00 2001 From: rui Date: Thu, 30 Sep 2021 01:38:38 -0400 Subject: [PATCH 246/276] docs: remove travis build badge and add gha ones (#1076) Signed-off-by: Rui Chen --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6de399abc3..ded834194e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Terraformer -[![Build Status](https://travis-ci.com/GoogleCloudPlatform/terraformer.svg?branch=master)](https://travis-ci.com/GoogleCloudPlatform/terraformer) +[![tests](https://github.com/GoogleCloudPlatform/terraformer/actions/workflows/test.yml/badge.svg)](https://github.com/GoogleCloudPlatform/terraformer/actions/workflows/test.yml) +[![linter](https://github.com/GoogleCloudPlatform/terraformer/actions/workflows/linter.yml/badge.svg)](https://github.com/GoogleCloudPlatform/terraformer/actions/workflows/linter.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/GoogleCloudPlatform/terraformer)](https://goreportcard.com/report/github.com/GoogleCloudPlatform/terraformer) [![AUR package](https://img.shields.io/aur/version/terraformer)](https://aur.archlinux.org/packages/terraformer/) [![Homebrew](https://img.shields.io/badge/dynamic/json.svg?url=https://formulae.brew.sh/api/formula/terraformer.json&query=$.versions.stable&label=homebrew)](https://formulae.brew.sh/formula/terraformer) From b0a2fc4d667583421b13e7003816db37f863193f Mon Sep 17 00:00:00 2001 From: rui Date: Thu, 30 Sep 2021 01:39:28 -0400 Subject: [PATCH 247/276] docs: update aws resource order alphabetically and add `batch` resource (#1074) * docs: update aws resource order alphabetically Signed-off-by: Rui Chen * docs: add batch resource support Signed-off-by: Rui Chen --- docs/aws.md | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/docs/aws.md b/docs/aws.md index 31f185ef17..68236e1165 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -55,16 +55,20 @@ In that case terraformer will not know with which region resources are associate * `aws_autoscaling_group` * `aws_launch_configuration` * `aws_launch_template` +* `batch` + * `aws_batch_compute_environment` + * `aws_batch_job_definition` + * `aws_batch_job_queue` * `budgets` * `aws_budgets_budget` * `cloud9` * `aws_cloud9_environment_ec2` -* `cloudfront` - * `aws_cloudfront_distribution` * `cloudformation` * `aws_cloudformation_stack` * `aws_cloudformation_stack_set` * `aws_cloudformation_stack_set_instance` +* `cloudfront` + * `aws_cloudfront_distribution` * `cloudhsm` * `aws_cloudhsm_v2_cluster` * `aws_cloudhsm_v2_hsm` @@ -87,12 +91,12 @@ In that case terraformer will not know with which region resources are associate * `cognito` * `aws_cognito_identity_pool` * `aws_cognito_user_pool` -* `customer_gateway` - * `aws_customer_gateway` * `config` * `aws_config_config_rule` * `aws_config_configuration_recorder` * `aws_config_delivery_channel` +* `customer_gateway` + * `aws_customer_gateway` * `datapipeline` * `aws_datapipeline_pipeline` * `devicefarm` @@ -104,38 +108,38 @@ In that case terraformer will not know with which region resources are associate * `aws_docdb_subnet_group` * `dynamodb` * `aws_dynamodb_table` -* `ec2_instance` - * `aws_instance` -* `eip` - * `aws_eip` -* `elasticache` - * `aws_elasticache_cluster` - * `aws_elasticache_parameter_group` - * `aws_elasticache_subnet_group` - * `aws_elasticache_replication_group` * `ebs` * `aws_ebs_volume` * `aws_volume_attachment` -* `elastic_beanstalk` - * `aws_elastic_beanstalk_application` - * `aws_elastic_beanstalk_environment` -* `ecs` - * `aws_ecs_cluster` - * `aws_ecs_service` - * `aws_ecs_task_definition` +* `ec2_instance` + * `aws_instance` * `ecr` * `aws_ecr_lifecycle_policy` * `aws_ecr_repository` * `aws_ecr_repository_policy` * `ecrpublic` * `aws_ecrpublic_repository` +* `ecs` + * `aws_ecs_cluster` + * `aws_ecs_service` + * `aws_ecs_task_definition` * `efs` * `aws_efs_access_point` * `aws_efs_file_system` * `aws_efs_file_system_policy` * `aws_efs_mount_target` +* `eip` + * `aws_eip` * `eks` * `aws_eks_cluster` +* `elasticache` + * `aws_elasticache_cluster` + * `aws_elasticache_parameter_group` + * `aws_elasticache_subnet_group` + * `aws_elasticache_replication_group` +* `elastic_beanstalk` + * `aws_elastic_beanstalk_application` + * `aws_elastic_beanstalk_environment` * `elb` * `aws_elb` * `emr` @@ -192,10 +196,10 @@ In that case terraformer will not know with which region resources are associate * `aws_media_store_container` * `msk` * `aws_msk_cluster` -* `nat` - * `aws_nat_gateway` * `nacl` * `aws_network_acl` +* `nat` + * `aws_nat_gateway` * `opsworks` * `aws_opsworks_application` * `aws_opsworks_custom_layer` From f4196ec990dce5a617c87005abef649c9c795eae Mon Sep 17 00:00:00 2001 From: Philip Brown Date: Wed, 6 Oct 2021 02:34:40 -0700 Subject: [PATCH 248/276] Update README.md (#1080) Tweaked formatting of one Install line, for clarity and readability when not on an ultra-wide monitor --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ded834194e..32d4c70162 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,8 @@ It's possible to combine `--compact` `--path-pattern` parameters together. From source: 1. Run `git clone && cd terraformer/` 2. Run `go mod download` -3. Run `go build -v` for all providers OR build with one provider `go run build/main.go {google,aws,azure,kubernetes and etc}` +3. Run `go build -v` for all providers OR build with one provider +`go run build/main.go {google,aws,azure,kubernetes,etc}` 4. Run ```terraform init``` against a ```versions.tf``` file to install the plugins required for your platform. For example, if you need plugins for the google provider, ```versions.tf``` should contain: ``` From cd523da680b75b39c1d8ed478a70b35b7f98c6bc Mon Sep 17 00:00:00 2001 From: anilkumarnagaraj Date: Thu, 14 Oct 2021 01:59:27 +0530 Subject: [PATCH 249/276] Sanitize the resource name (#1086) --- docs/ibmcloud.md | 7 +- go.mod | 19 +- go.sum | 52 ++--- providers/ibm/cis.go | 67 +++---- providers/ibm/cloud_functions.go | 30 ++- providers/ibm/container_cluster.go | 50 +++-- providers/ibm/cos.go | 7 +- providers/ibm/database_elasticsearch.go | 2 +- providers/ibm/database_etcd.go | 2 +- providers/ibm/database_mongo.go | 2 +- providers/ibm/database_postgresql.go | 2 +- providers/ibm/database_rabbitmq.go | 2 +- providers/ibm/database_redis.go | 2 +- providers/ibm/iam.go | 2 +- providers/ibm/ibm_dl.go | 48 ++--- providers/ibm/ibm_is_floating_ip.go | 30 +-- providers/ibm/ibm_is_flow_log.go | 21 +- providers/ibm/ibm_is_ike_policy.go | 4 +- providers/ibm/ibm_is_image.go | 18 +- providers/ibm/ibm_is_instance.go | 39 ++-- providers/ibm/ibm_is_instance_template.go | 4 +- providers/ibm/ibm_is_ipsec_policy.go | 26 ++- providers/ibm/ibm_is_lb.go | 43 +++-- providers/ibm/ibm_is_network_acl.go | 18 +- providers/ibm/ibm_is_public_gateway.go | 17 +- providers/ibm/ibm_is_security_group.go | 26 +-- providers/ibm/ibm_is_ssh_key.go | 17 +- providers/ibm/ibm_is_subnet.go | 30 +-- .../ibm/ibm_is_virtual_endpoint_gateway.go | 20 +- providers/ibm/ibm_is_volume.go | 4 +- providers/ibm/ibm_is_vpc.go | 72 ++++--- providers/ibm/ibm_is_vpn_gateway.go | 26 +-- providers/ibm/ibm_kp.go | 61 +++--- providers/ibm/ibm_private_dns.go | 180 ++++++++++-------- providers/ibm/ibm_provider.go | 19 +- providers/ibm/ibm_tg.go | 15 +- providers/ibm/instance_groups.go | 4 +- providers/ibm/satellite.go | 141 ++++++++++++++ providers/ibm/utils.go | 52 +++++ providers/ibm/vpc_cluster.go | 19 +- 40 files changed, 749 insertions(+), 451 deletions(-) create mode 100644 providers/ibm/satellite.go diff --git a/docs/ibmcloud.md b/docs/ibmcloud.md index 1e516c1027..421c0a7d57 100644 --- a/docs/ibmcloud.md +++ b/docs/ibmcloud.md @@ -8,7 +8,6 @@ If you want to run Terraformer with the IBM Cloud provider plugin on your system ``` export IC_API_KEY= - export IC_REGION= terraformer import ibm -r ibm_cos,ibm_iam.... ``` 2. Use flag for Resource Group to classify resources accordingly. @@ -16,8 +15,7 @@ If you want to run Terraformer with the IBM Cloud provider plugin on your system ``` export IC_API_KEY= - export IC_REGION= - terraformer import ibm --resources=ibm_is_vpc --resource_group=a0d5213d831a454ebace7ed38ca9c8ca + terraformer import ibm --resources=ibm_is_vpc --resource_group=default terraformer import ibm --resources=ibm_function --region=us-south ``` List of supported IBM Cloud resources: @@ -138,3 +136,6 @@ List of supported IBM Cloud resources: * `ibm_vpe_gateway` * `ibm_is_virtual_endpoint_gateway` * `ibm_is_virtual_endpoint_gateway_ip` +* `ibm_satellite` + * `ibm_satellite_location` + * `ibm_satellite_host` diff --git a/go.mod b/go.mod index fa908f651a..69cd98f931 100644 --- a/go.mod +++ b/go.mod @@ -169,6 +169,15 @@ require ( k8s.io/client-go v0.21.0 ) +require ( + github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62 + github.com/IBM/go-sdk-core v1.1.0 + github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 // indirect + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b + github.com/zclconf/go-cty-yaml v1.0.2 // indirect +) + require ( github.com/Azure/azure-pipeline-go v0.2.2 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect @@ -194,7 +203,6 @@ require ( github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect github.com/aws/aws-sdk-go v1.37.0 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 // indirect @@ -225,7 +233,7 @@ require ( github.com/gofrs/uuid v3.2.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/golang/protobuf v1.5.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/go-cmp v0.5.6 // indirect github.com/google/go-querystring v1.0.0 // indirect @@ -248,7 +256,6 @@ require ( github.com/hashicorp/hcl/v2 v2.8.2 // indirect github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 // indirect github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect - github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.12 // indirect @@ -277,13 +284,13 @@ require ( github.com/mozillazg/go-httpheader v0.2.1 // indirect github.com/oklog/run v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 // indirect github.com/pborman/uuid v1.2.0 // indirect github.com/pelletier/go-toml v1.7.0 // indirect github.com/posener/complete v1.2.1 // indirect github.com/russellhaering/goxmldsig v1.1.0 // indirect + github.com/sergi/go-diff v1.2.0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 // indirect github.com/spf13/afero v1.2.2 // indirect @@ -291,13 +298,12 @@ require ( github.com/ulikunitz/xz v0.5.8 // indirect github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect - github.com/zclconf/go-cty-yaml v1.0.2 // indirect go.mongodb.org/mongo-driver v1.5.1 // indirect go.opencensus.io v0.22.5 // indirect golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/mod v0.4.1 // indirect - golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect + golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect @@ -307,6 +313,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/grpc v1.35.0 // indirect google.golang.org/protobuf v1.26.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 2066f21200..9ae7676240 100644 --- a/go.sum +++ b/go.sum @@ -101,6 +101,8 @@ github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 h1:sUpBb2/GC8L6UOKDnbEZLRTxQB2RQgMv1mxbnOHOQW4= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= +github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62 h1:MOkcr6qQGk4tY542ZJ1DggVh2WUP72EEyLB79llFVH8= +github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY= github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY= github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY= github.com/IBM/go-sdk-core/v3 v3.3.1 h1:DoXjP1+Wm8Yd4XJsvBMRcYLvQwSLFnzKlMjSrg3Rzpw= @@ -161,7 +163,6 @@ github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0 github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 h1:fJ4XPqxuZfm11zauw9XX7c30P8xwDyucdWu8H6Htrxs= github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= @@ -382,8 +383,6 @@ github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= -github.com/bflad/tfproviderlint v0.27.0/go.mod h1:7Z9Pyl1Z1UWJcPBuyjN89D2NaJGpjReQb5NoaaQCthQ= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= @@ -517,12 +516,9 @@ github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/ github.com/go-bdd/gobdd v1.1.3 h1:eirGvZ9gMz6clOo2k6O7+Ys3iHAaFZoRQXVwV76B3JI= github.com/go-bdd/gobdd v1.1.3/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -564,6 +560,7 @@ github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gG github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= @@ -638,8 +635,9 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= @@ -734,8 +732,6 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= -github.com/hashicorp/go-getter v1.5.2/go.mod h1:orNH3BTYLu/fIxGIdLjLoAJHWMDQ/UKQr5O4m3iBuoo= github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= @@ -757,7 +753,6 @@ github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uP github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -783,7 +778,6 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= @@ -811,21 +805,12 @@ github.com/hashicorp/terraform v0.12.31/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhk github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= -github.com/hashicorp/terraform-exec v0.13.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= -github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= -github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= -github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= +github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2bHu4fjRB1H6Ag4U= github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= -github.com/hashicorp/terraform-plugin-sdk v1.16.1 h1:G2iK7MBT4LuNcVASPXWS1ciBUuIm8oIY0zRfCmi3xy4= -github.com/hashicorp/terraform-plugin-sdk v1.16.1/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0/go.mod h1:grseeRo9g3yNkYW09iFlV8LG78jTa1ssBgouogQg/RU= github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.1/go.mod h1:o3pdss6ynDZW9FfiZ+rETUH5LEVufrXdhwLU+5OiRo0= -github.com/hashicorp/terraform-plugin-test/v2 v2.1.3/go.mod h1:pmaUHiUtDL/8Mz3FuyZ/vRDb0LpaOWQjVRW9ORF7FHs= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= @@ -849,7 +834,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -862,7 +846,6 @@ github.com/jarcoal/httpmock v1.0.7/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jefferai/jsonx v1.0.1 h1:GvWkLWihoLqDG0BSP45TUQJH9qsINX50PVrFULgpc/I= github.com/jefferai/jsonx v1.0.1/go.mod h1:yFo3l2fcm7cZVHGq3HKLXE+Pd4RWuRjNBDHksM7XekQ= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= @@ -899,7 +882,6 @@ github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaR github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= @@ -976,7 +958,6 @@ github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqK github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= @@ -1036,19 +1017,15 @@ github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDh github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/okta/okta-sdk-golang/v2 v2.3.1-0.20210617075430-6c6c25f48f92/go.mod h1:G4GCqqnZJCt91zMqYhDMLhg2INVbjiiFKkQ2mnia1J0= -github.com/okta/okta-sdk-golang/v2 v2.6.1 h1:r0C6Z+WXuBIUv3/lq6wDGqoZBAcrNNCSoixB/BhLONo= -github.com/okta/okta-sdk-golang/v2 v2.6.1/go.mod h1:0y8stgdplWMjaEbMr4mVtw0R+BdktpGZRw2sWKZWsMs= github.com/okta/okta-sdk-golang/v2 v2.6.3-0.20210923165359-20aeac44ab01 h1:eTw4NCD4FBAAT+tqx8qq2WhPjVwauVp//mvG4c3wrUY= github.com/okta/okta-sdk-golang/v2 v2.6.3-0.20210923165359-20aeac44ab01/go.mod h1:0y8stgdplWMjaEbMr4mVtw0R+BdktpGZRw2sWKZWsMs= -github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9 h1:gC6OakV7GUVaTKm3KMpqVe9LOQfflzePtFsVDUbCPgo= -github.com/okta/terraform-provider-okta v0.0.0-20210723144213-09bad12091e9/go.mod h1:G6kMVF+QIjldN0X6s1U8MAcHNOWwdwJiMWmeCyotCJc= github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b h1:ML6q0susBNxEEXZkifQGjY5ILGJHhU0a72Dm2DHEbSg= github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b/go.mod h1:hVb3TxYi4ibGeUpue2Rqm84YhD/473w0Xv0uIlylUY8= github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M= @@ -1059,15 +1036,18 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -1252,7 +1232,6 @@ github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= @@ -1400,8 +1379,9 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1491,6 +1471,7 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1554,7 +1535,6 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= diff --git a/providers/ibm/cis.go b/providers/ibm/cis.go index 64a47c9f0f..197f03fb77 100644 --- a/providers/ibm/cis.go +++ b/providers/ibm/cis.go @@ -54,7 +54,7 @@ type CISGenerator struct { func (g CISGenerator) loadInstances(crn, name, resGrpID string) terraformutils.Resource { resource := terraformutils.NewResource( crn, - name, + normalizeResourceName(name, false), "ibm_cis", "ibm", map[string]string{ @@ -68,7 +68,7 @@ func (g CISGenerator) loadInstances(crn, name, resGrpID string) terraformutils.R func (g CISGenerator) loadDomains(crn, domainID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", domainID, crn), - domainID, + normalizeResourceName("ibm_cis_domain", true), "ibm_cis_domain", "ibm", map[string]string{}, @@ -82,7 +82,7 @@ func (g CISGenerator) loadDomains(crn, domainID string, dependsOn []string) terr func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", dnsRecordID, domainID, crn), - dnsRecordID, + normalizeResourceName("ibm_cis_dns_record", true), "ibm_cis_dns_record", "ibm", map[string]string{}, @@ -96,7 +96,7 @@ func (g CISGenerator) loadDNSRecords(crn, domainID, dnsRecordID string, dependsO func (g CISGenerator) loadFirewall(crn, domainID, fID, fType string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s:%s", fType, fID, domainID, crn), - fID, + normalizeResourceName("ibm_cis_firewall", true), "ibm_cis_firewall", "ibm", map[string]string{}, @@ -110,7 +110,7 @@ func (g CISGenerator) loadFirewall(crn, domainID, fID, fType string, dependsOn [ func (g CISGenerator) loadDomainSettings(crn, dID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", dID, crn), - dID, + normalizeResourceName("ibm_cis_domain_settings", true), "ibm_cis_domain_settings", "ibm", map[string]string{}, @@ -124,7 +124,7 @@ func (g CISGenerator) loadDomainSettings(crn, dID string, dependsOn []string) te func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", gID, dID, crn), - fmt.Sprintf("%s:%s:%s", gID, dID, crn), + normalizeResourceName("ibm_cis_global_load_balancer", true), "ibm_cis_global_load_balancer", "ibm", map[string]string{}, @@ -140,10 +140,10 @@ func (g CISGenerator) loadGlobalBalancer(crn, dID, gID string, dependsOn []strin return resource } -func (g CISGenerator) loadGlobalBalancerPool(crn, pID string, dependsOn []string) terraformutils.Resource { +func (g CISGenerator) loadGlobalBalancerPool(crn, pID, pName string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", pID, crn), - fmt.Sprintf("%s:%s", pID, crn), + normalizeResourceName(pName, true), "ibm_cis_origin_pool", g.ProviderName, map[string]string{}, @@ -157,7 +157,7 @@ func (g CISGenerator) loadGlobalBalancerPool(crn, pID string, dependsOn []string func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID, port string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", gblmID, crn), - gblmID, + normalizeResourceName("ibm_cis_healthcheck", true), "ibm_cis_healthcheck", "ibm", map[string]string{ @@ -173,7 +173,7 @@ func (g CISGenerator) loadGlobalBalancerMonitor(crn, gblmID, port string, depend func (g CISGenerator) loadRateLimit(crn, dID, rID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", rID, dID, crn), - rID, + normalizeResourceName("ibm_cis_rate_limit", true), "ibm_cis_rate_limit", "ibm", map[string]string{}, @@ -187,7 +187,7 @@ func (g CISGenerator) loadRateLimit(crn, dID, rID string, dependsOn []string) te func (g CISGenerator) loadEdgeFunctionAction(crn, dID, actionID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", actionID, dID, crn), - actionID, + normalizeResourceName("ibm_cis_edge_functions_action", true), "ibm_cis_edge_functions_action", "ibm", map[string]string{}, @@ -201,7 +201,7 @@ func (g CISGenerator) loadEdgeFunctionAction(crn, dID, actionID string, dependsO func (g CISGenerator) loadEdgeFunctionTrigger(crn, dID, triggerID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", triggerID, dID, crn), - triggerID, + normalizeResourceName("ibm_cis_edge_functions_trigger", true), "ibm_cis_edge_functions_trigger", "ibm", map[string]string{}, @@ -215,7 +215,7 @@ func (g CISGenerator) loadEdgeFunctionTrigger(crn, dID, triggerID string, depend func (g CISGenerator) loadWafRulePackage(crn, dID, pkgID, actionMode, sensitivity string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", pkgID, dID, crn), - fmt.Sprintf("%s:%s", pkgID, dID), + normalizeResourceName("ibm_cis_waf_package", true), "ibm_cis_waf_package", "ibm", map[string]string{ @@ -232,7 +232,7 @@ func (g CISGenerator) loadWafRulePackage(crn, dID, pkgID, actionMode, sensitivit func (g CISGenerator) loadWafGroups(crn, dID, pkgID, grpID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s:%s", grpID, pkgID, dID, crn), - fmt.Sprintf("%s:%s:%s", grpID, pkgID, dID), + normalizeResourceName("ibm_cis_waf_group", true), "ibm_cis_waf_group", "ibm", map[string]string{}, @@ -246,7 +246,7 @@ func (g CISGenerator) loadWafGroups(crn, dID, pkgID, grpID string, dependsOn []s func (g CISGenerator) loadPageRule(crn, dID, ruleID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", ruleID, dID, crn), - fmt.Sprintf("%s:%s:%s", ruleID, dID, crn), + normalizeResourceName("ibm_cis_page_rule", true), "ibm_cis_page_rule", "ibm", map[string]string{}, @@ -260,7 +260,7 @@ func (g CISGenerator) loadPageRule(crn, dID, ruleID string, dependsOn []string) func (g CISGenerator) loadCustomPage(crn, dID, cpID, url string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", cpID, dID, crn), - fmt.Sprintf("%s:%s:%s", cpID, dID, crn), + normalizeResourceName("ibm_cis_custom_page", true), "ibm_cis_custom_page", "ibm", map[string]string{ @@ -276,7 +276,7 @@ func (g CISGenerator) loadCustomPage(crn, dID, cpID, url string, dependsOn []str func (g CISGenerator) loadRangeApp(crn, dID, appID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", appID, dID, crn), - fmt.Sprintf("%s:%s", appID, dID), + normalizeResourceName("ibm_cis_range_app", true), "ibm_cis_range_app", "ibm", map[string]string{}, @@ -290,7 +290,7 @@ func (g CISGenerator) loadRangeApp(crn, dID, appID string, dependsOn []string) t func (g CISGenerator) loadSSLCertificates(crn, dID, cID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", cID, dID, crn), - cID, + normalizeResourceName("ibm_cis_certificate_order", true), "ibm_cis_certificate_order", "ibm", map[string]string{}, @@ -304,7 +304,7 @@ func (g CISGenerator) loadSSLCertificates(crn, dID, cID string, dependsOn []stri func (g CISGenerator) loadCISRouting(crn, dID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", dID, crn), - fmt.Sprintf("%s:%s", dID, crn), + normalizeResourceName("ibm_cis_routing", true), "ibm_cis_routing", "ibm", map[string]string{}, @@ -318,7 +318,7 @@ func (g CISGenerator) loadCISRouting(crn, dID string, dependsOn []string) terraf func (g CISGenerator) loadCacheSettings(crn, dID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", dID, crn), - fmt.Sprintf("%s:%s", dID, crn), + normalizeResourceName("ibm_cis_cache_settings", true), "ibm_cis_cache_settings", "ibm", map[string]string{}, @@ -332,7 +332,7 @@ func (g CISGenerator) loadCacheSettings(crn, dID string, dependsOn []string) ter func (g CISGenerator) loadTLSSettings(crn, dID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", dID, crn), - fmt.Sprintf("%s:%s", dID, crn), + normalizeResourceName("ibm_cis_tls_settings", true), "ibm_cis_tls_settings", "ibm", map[string]string{}, @@ -346,7 +346,7 @@ func (g CISGenerator) loadTLSSettings(crn, dID string, dependsOn []string) terra func (g CISGenerator) loadFilters(crn, dID, fID string, dependsOn []string) terraformutils.Resource { resource := terraformutils.NewResource( fmt.Sprintf("%s:%s:%s", fID, dID, crn), - fmt.Sprintf("%s:%s:%s", fID, dID, crn), + normalizeResourceName("ibm_cis_filter", true), "ibm_cis_filter", "ibm", map[string]string{}, @@ -409,10 +409,11 @@ func (g *CISGenerator) InitResources() error { // Instance crn := c.Crn.String() g.Resources = append(g.Resources, g.loadInstances(crn, c.Name, c.ResourceGroupID)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName var cisDependsOn []string cisDependsOn = append(cisDependsOn, - "ibm_cis."+terraformutils.TfSanitize(c.Name)) + "ibm_cis."+resourceName) // Domain zoneOpts := &zonesv1.ZonesV1Options{ @@ -456,7 +457,7 @@ func (g *CISGenerator) InitResources() error { for _, gbl := range gblPoolList.Result { if gbl.ID != nil { - g.Resources = append(g.Resources, g.loadGlobalBalancerPool(crn, *gbl.ID, cisDependsOn)) + g.Resources = append(g.Resources, g.loadGlobalBalancerPool(crn, *gbl.ID, *gbl.Name, cisDependsOn)) } } @@ -486,11 +487,12 @@ func (g *CISGenerator) InitResources() error { for _, z := range zoneList.Result { var domainDependsOn []string domainDependsOn = append(domainDependsOn, - "ibm_cis."+terraformutils.TfSanitize(c.Name)) - domainDependsOn = append(domainDependsOn, - "ibm_cis_domain."+terraformutils.TfSanitize(*z.ID)) + "ibm_cis."+resourceName) g.Resources = append(g.Resources, g.loadDomains(crn, *z.ID, domainDependsOn)) + zoneResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + domainDependsOn = append(domainDependsOn, + "ibm_cis_domain."+zoneResourceName) // DNS Record zoneID := *z.ID @@ -680,10 +682,11 @@ func (g *CISGenerator) InitResources() error { for _, el := range edgeActionResonse.Result { if el.Routes != nil { for _, elT := range el.Routes { + g.Resources = append(g.Resources, g.loadEdgeFunctionAction(crn, *z.ID, *elT.Script, domainDependsOn)) + elResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName edgeFunctionActionDependsOn := makeDependsOn(domainDependsOn, - "ibm_cis_edge_functions_action."+terraformutils.TfSanitize(*elT.Script)) + "ibm_cis_edge_functions_action."+elResourceName) - g.Resources = append(g.Resources, g.loadEdgeFunctionAction(crn, *z.ID, *elT.Script, domainDependsOn)) g.Resources = append(g.Resources, g.loadEdgeFunctionTrigger(crn, *z.ID, *elT.ID, edgeFunctionActionDependsOn)) } } @@ -829,10 +832,10 @@ func (g *CISGenerator) InitResources() error { g.Resources = append(g.Resources, g.loadTLSSettings(crn, *z.ID, domainDependsOn)) for _, d := range dnsList.Result { - dnsDependsOn := makeDependsOn(domainDependsOn, - "ibm_cis_dns_record."+terraformutils.TfSanitize(*d.ID)) - g.Resources = append(g.Resources, g.loadDNSRecords(crn, *z.ID, *d.ID, domainDependsOn)) + dnsResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + dnsDependsOn := makeDependsOn(domainDependsOn, + "ibm_cis_dns_record."+dnsResourceName) // Global Load Balancer gblSetttingOpts := &globalloadbalancerv1.GlobalLoadBalancerV1Options{ diff --git a/providers/ibm/cloud_functions.go b/providers/ibm/cloud_functions.go index a68f3db008..a613a0f2b2 100644 --- a/providers/ibm/cloud_functions.go +++ b/providers/ibm/cloud_functions.go @@ -36,7 +36,7 @@ type CloudFunctionGenerator struct { } func (g CloudFunctionGenerator) loadPackages(namespace, pkgName string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", namespace, pkgName), pkgName, "ibm_function_package", @@ -44,31 +44,31 @@ func (g CloudFunctionGenerator) loadPackages(namespace, pkgName string) terrafor map[string]string{}, []string{}, map[string]interface{}{}) - return resources + return resource } func (g CloudFunctionGenerator) loadRules(namespace, ruleName string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", namespace, ruleName), - ruleName, + normalizeResourceName(ruleName, false), "ibm_function_rule", "ibm", map[string]string{}, []string{}, map[string]interface{}{}) - return resources + return resource } func (g CloudFunctionGenerator) loadTriggers(namespace, triggerName string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s:%s", namespace, triggerName), - triggerName, + normalizeResourceName(triggerName, false), "ibm_function_trigger", "ibm", map[string]string{}, []string{}, map[string]interface{}{}) - return resources + return resource } /* @@ -105,17 +105,11 @@ func setupOpenWhiskClientConfigIAM(response ns.NamespaceResponse, c *bluemix.Con // InitResources .. func (g *CloudFunctionGenerator) InitResources() error { - var region string + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), } - rg := g.Args["region"] - if rg != "" { - region = rg.(string) - } else { - region = "us-south" - } bmxConfig.Region = region sess, err := session.New(bmxConfig) @@ -145,7 +139,7 @@ func (g *CloudFunctionGenerator) InitResources() error { for _, n := range nsList.Namespaces { // Namespace - if n.IsCf() { + if !n.IsIamEnabled() { continue } @@ -191,7 +185,7 @@ func (g *CloudFunctionGenerator) InitResources() error { actionID = fmt.Sprintf("%s/%s", parts[1], a.Name) g.Resources = append(g.Resources, terraformutils.NewResource( fmt.Sprintf("%s:%s", n.GetName(), actionID), - a.Name, + normalizeResourceName(a.Name, false), "ibm_function_action", "ibm", map[string]string{}, @@ -202,7 +196,7 @@ func (g *CloudFunctionGenerator) InitResources() error { } else { g.Resources = append(g.Resources, terraformutils.NewResource( fmt.Sprintf("%s:%s", n.GetName(), a.Name), - a.Name, + normalizeResourceName(a.Name, false), "ibm_function_action", "ibm", map[string]string{}, diff --git a/providers/ibm/container_cluster.go b/providers/ibm/container_cluster.go index bab27a34ea..652437ffe1 100644 --- a/providers/ibm/container_cluster.go +++ b/providers/ibm/container_cluster.go @@ -29,19 +29,29 @@ type ContainerClusterGenerator struct { } func (g ContainerClusterGenerator) loadcluster(clustersID, clusterName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewResource( clustersID, - clusterName, + normalizeResourceName(clusterName, false), "ibm_container_cluster", "ibm", - []string{}) - return resources + map[string]string{ + "force_delete_storage": "true", + "update_all_workers": "false", + "wait_for_worker_update": "true", + }, + []string{}, + map[string]interface{}{}) + + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^worker_num$", "^region$", + ) + return resource } -func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID string, dependsOn []string) terraformutils.Resource { +func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID, poolName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", clustersID, poolID), - poolID, + normalizeResourceName(poolName, true), "ibm_container_worker_pool", "ibm", map[string]string{}, @@ -55,7 +65,7 @@ func (g ContainerClusterGenerator) loadWorkerPools(clustersID, poolID string, de func (g ContainerClusterGenerator) loadWorkerPoolZones(clustersID, poolID, zoneID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", clustersID, poolID, zoneID), - fmt.Sprintf("%s/%s/%s", clustersID, poolID, zoneID), + normalizeResourceName("ibm_container_worker_pool_zone_attachment", true), "ibm_container_worker_pool_zone_attachment", "ibm", map[string]string{}, @@ -86,23 +96,25 @@ func (g *ContainerClusterGenerator) InitResources() error { for _, cs := range clusters { g.Resources = append(g.Resources, g.loadcluster(cs.ID, cs.Name)) - workerPools, err := client.WorkerPools().ListWorkerPools(cs.ID, containerv1.ClusterTargetHeader{}) + clusterResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + workerPools, err := client.WorkerPools().ListWorkerPools(cs.ID, containerv1.ClusterTargetHeader{ + ResourceGroup: cs.ResourceGroupID, + }) if err != nil { return err } for _, pool := range workerPools { - if pool.Name != "default" { - var dependsOn []string - dependsOn = append(dependsOn, - "ibm_container_cluster."+terraformutils.TfSanitize(cs.Name)) - g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, dependsOn)) + var dependsOn []string + dependsOn = append(dependsOn, + "ibm_container_cluster."+clusterResourceName) + g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, pool.Name, dependsOn)) + poolResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName - dependsOn = append(dependsOn, - "ibm_container_worker_pool."+terraformutils.TfSanitize(pool.ID)) - zones := pool.Zones - for _, zone := range zones { - g.Resources = append(g.Resources, g.loadWorkerPoolZones(cs.ID, pool.ID, zone.ID, dependsOn)) - } + dependsOn = append(dependsOn, + "ibm_container_worker_pool."+poolResourceName) + zones := pool.Zones + for _, zone := range zones { + g.Resources = append(g.Resources, g.loadWorkerPoolZones(cs.ID, pool.ID, zone.ID, dependsOn)) } } } diff --git a/providers/ibm/cos.go b/providers/ibm/cos.go index 6f02ef8ad8..62c105a86c 100644 --- a/providers/ibm/cos.go +++ b/providers/ibm/cos.go @@ -39,7 +39,7 @@ type COSGenerator struct { func (g COSGenerator) loadCOS(cosID string, cosName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( cosID, - cosName, + normalizeResourceName(cosName, false), "ibm_resource_instance", "ibm", []string{}) @@ -49,7 +49,7 @@ func (g COSGenerator) loadCOS(cosID string, cosName string) terraformutils.Resou func (g COSGenerator) loadCOSBuckets(bucketID, bucketName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( bucketID, - bucketName, + normalizeResourceName(bucketName, false), "ibm_cos_bucket", "ibm", map[string]string{}, @@ -93,6 +93,7 @@ func (g *COSGenerator) InitResources() error { authEndpoint := "https://iam.cloud.ibm.com/identity/token" for _, cs := range cosInstances { g.Resources = append(g.Resources, g.loadCOS(cs.ID, cs.Name)) + csResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName s3Conf := ibmaws.NewConfig().WithCredentials(ibmiam.NewStaticCredentials(ibmaws.NewConfig(), authEndpoint, os.Getenv("IC_API_KEY"), cs.ID)).WithS3ForcePathStyle(true).WithEndpoint("s3.us-south.cloud-object-storage.appdomain.cloud") s3Sess := cossession.Must(cossession.NewSession()) s3Client := coss3.New(s3Sess, s3Conf) @@ -103,7 +104,7 @@ func (g *COSGenerator) InitResources() error { for _, b := range d.Buckets { var dependsOn []string dependsOn = append(dependsOn, - "ibm_resource_instance."+terraformutils.TfSanitize(cs.Name)) + "ibm_resource_instance."+csResourceName) var apiType, location string bLocationConstraint := *b.LocationConstraint if singleSiteLocationRegex.MatchString(bLocationConstraint) { diff --git a/providers/ibm/database_elasticsearch.go b/providers/ibm/database_elasticsearch.go index 4489bb5562..458fa439bc 100644 --- a/providers/ibm/database_elasticsearch.go +++ b/providers/ibm/database_elasticsearch.go @@ -43,7 +43,7 @@ func (g DatabaseElasticSearchGenerator) loadElasticSearchDB(dbID string, dbName // InitResources ... func (g *DatabaseElasticSearchGenerator) InitResources() error { - region := os.Getenv("IC_REGION") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), Region: region, diff --git a/providers/ibm/database_etcd.go b/providers/ibm/database_etcd.go index 3823982035..5eb32ace1c 100644 --- a/providers/ibm/database_etcd.go +++ b/providers/ibm/database_etcd.go @@ -43,7 +43,7 @@ func (g DatabaseETCDGenerator) loadETCDDB(dbID string, dbName string) terraformu // InitResources ... func (g *DatabaseETCDGenerator) InitResources() error { - region := os.Getenv("IC_REGION") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), Region: region, diff --git a/providers/ibm/database_mongo.go b/providers/ibm/database_mongo.go index aa63c9f955..d91c4d2993 100644 --- a/providers/ibm/database_mongo.go +++ b/providers/ibm/database_mongo.go @@ -43,7 +43,7 @@ func (g DatabaseMongoGenerator) loadMongoDB(dbID string, dbName string) terrafor // InitResources ... func (g *DatabaseMongoGenerator) InitResources() error { - region := os.Getenv("IC_REGION") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), Region: region, diff --git a/providers/ibm/database_postgresql.go b/providers/ibm/database_postgresql.go index b8419a0697..515953716f 100644 --- a/providers/ibm/database_postgresql.go +++ b/providers/ibm/database_postgresql.go @@ -42,7 +42,7 @@ func (g DatabasePostgresqlGenerator) loadPostgresqlDB(dbID string, dbName string // InitResources ... func (g *DatabasePostgresqlGenerator) InitResources() error { - region := os.Getenv("IC_REGION") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), Region: region, diff --git a/providers/ibm/database_rabbitmq.go b/providers/ibm/database_rabbitmq.go index dc358970fd..14cf2dedf5 100644 --- a/providers/ibm/database_rabbitmq.go +++ b/providers/ibm/database_rabbitmq.go @@ -43,7 +43,7 @@ func (g DatabaseRabbitMQGenerator) loadRabbitMQDB(dbID string, dbName string) te // InitResources ... func (g *DatabaseRabbitMQGenerator) InitResources() error { - region := os.Getenv("IC_REGION") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), Region: region, diff --git a/providers/ibm/database_redis.go b/providers/ibm/database_redis.go index 7f62dd8837..9d15b1f48c 100644 --- a/providers/ibm/database_redis.go +++ b/providers/ibm/database_redis.go @@ -43,7 +43,7 @@ func (g DatabaseRedisGenerator) loadRedisDB(dbID string, dbName string) terrafor // InitResources ... func (g *DatabaseRedisGenerator) InitResources() error { - region := os.Getenv("IC_REGION") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), Region: region, diff --git a/providers/ibm/iam.go b/providers/ibm/iam.go index 6e192ddc72..46e7bd814b 100644 --- a/providers/ibm/iam.go +++ b/providers/ibm/iam.go @@ -25,7 +25,7 @@ import ( "github.com/IBM-Cloud/bluemix-go/api/iamuum/iamuumv2" "github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2" "github.com/IBM-Cloud/bluemix-go/session" - "github.com/IBM/go-sdk-core/v4/core" + "github.com/IBM/go-sdk-core/core" "github.com/IBM/platform-services-go-sdk/iamidentityv1" "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" ) diff --git a/providers/ibm/ibm_dl.go b/providers/ibm/ibm_dl.go index fd4d8c0765..eb01e8f1d8 100644 --- a/providers/ibm/ibm_dl.go +++ b/providers/ibm/ibm_dl.go @@ -30,19 +30,19 @@ type DLGenerator struct { } func (g DLGenerator) createDirectLinkGatewayResources(gatewayID, gatewayName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewSimpleResource( gatewayID, - gatewayName, + normalizeResourceName(gatewayName, false), "ibm_dl_gateway", "ibm", []string{}) - return resources + return resource } func (g DLGenerator) createDirectLinkVirtualConnectionResources(gatewayID, connectionID, connectionName string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s/%s", gatewayID, connectionID), - connectionName, + normalizeResourceName(connectionName, false), "ibm_dl_virtual_connection", "ibm", map[string]string{}, @@ -50,17 +50,17 @@ func (g DLGenerator) createDirectLinkVirtualConnectionResources(gatewayID, conne map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } func (g DLGenerator) createDirectLinkProviderGatewayResources(providerGatewayID, providerGatewayName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewSimpleResource( providerGatewayID, - providerGatewayName, + normalizeResourceName(providerGatewayName, false), "ibm_dl_provider_gateway", "ibm", []string{}) - return resources + return resource } // InitResources ... @@ -87,20 +87,22 @@ func (g *DLGenerator) InitResources() error { if err != nil { return fmt.Errorf("Error Fetching Direct Link Gateways %s\n%s", err, response) } - for _, gateway := range gateways.Gateways { - g.Resources = append(g.Resources, g.createDirectLinkGatewayResources(*gateway.ID, *gateway.Name)) - var dependsOn []string - dependsOn = append(dependsOn, - "ibm_dl_gateway."+terraformutils.TfSanitize(*gateway.Name)) - listGatewayVirtualConnectionsOptions := &dl.ListGatewayVirtualConnectionsOptions{ - GatewayID: gateway.ID, - } - connections, response, err := dlclient.ListGatewayVirtualConnections(listGatewayVirtualConnectionsOptions) - if err != nil { - return fmt.Errorf("Error Fetching Direct Link Virtual connections %s\n%s", err, response) - } - for _, connection := range connections.VirtualConnections { - g.Resources = append(g.Resources, g.createDirectLinkVirtualConnectionResources(*gateway.ID, *connection.ID, *connection.Name, dependsOn)) + if gateways.Gateways != nil { + for _, gateway := range gateways.Gateways { + g.Resources = append(g.Resources, g.createDirectLinkGatewayResources(*gateway.ID, *gateway.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + var dependsOn []string + dependsOn = append(dependsOn, "ibm_dl_gateway."+resourceName) + listGatewayVirtualConnectionsOptions := &dl.ListGatewayVirtualConnectionsOptions{ + GatewayID: gateway.ID, + } + connections, response, err := dlclient.ListGatewayVirtualConnections(listGatewayVirtualConnectionsOptions) + if err != nil { + return fmt.Errorf("Error Fetching Direct Link Virtual connections %s\n%s", err, response) + } + for _, connection := range connections.VirtualConnections { + g.Resources = append(g.Resources, g.createDirectLinkVirtualConnectionResources(*gateway.ID, *connection.ID, *connection.Name, dependsOn)) + } } } diff --git a/providers/ibm/ibm_is_floating_ip.go b/providers/ibm/ibm_is_floating_ip.go index 7b3eb08fbc..2d487e385f 100644 --- a/providers/ibm/ibm_is_floating_ip.go +++ b/providers/ibm/ibm_is_floating_ip.go @@ -30,28 +30,30 @@ type FloatingIPGenerator struct { } func (g FloatingIPGenerator) createFloatingIPResources(fipID, fipName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewResource( fipID, - fipName, + normalizeResourceName(fipName, false), "ibm_is_floating_ip", "ibm", - []string{}) - return resources + map[string]string{}, + []string{}, + map[string]interface{}{}) + + // Conflict parameters + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^zone$", + ) + return resource } // InitResources ... func (g *FloatingIPGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -70,8 +72,12 @@ func (g *FloatingIPGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } fips, response, err := vpcclient.ListFloatingIps(options) if err != nil { diff --git a/providers/ibm/ibm_is_flow_log.go b/providers/ibm/ibm_is_flow_log.go index 8db4279e7d..7cc14a8c2b 100644 --- a/providers/ibm/ibm_is_flow_log.go +++ b/providers/ibm/ibm_is_flow_log.go @@ -30,28 +30,23 @@ type FlowLogGenerator struct { } func (g FlowLogGenerator) createFlowLogResources(flogID, flogName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewSimpleResource( flogID, - flogName, + normalizeResourceName(flogName, false), "ibm_is_flow_log", "ibm", []string{}) - return resources + return resource } // InitResources ... func (g *FlowLogGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -70,8 +65,12 @@ func (g *FlowLogGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } flogs, response, err := vpcclient.ListFlowLogCollectors(options) if err != nil { diff --git a/providers/ibm/ibm_is_ike_policy.go b/providers/ibm/ibm_is_ike_policy.go index 3c0faace36..524c7e7a85 100644 --- a/providers/ibm/ibm_is_ike_policy.go +++ b/providers/ibm/ibm_is_ike_policy.go @@ -32,7 +32,7 @@ type IkeGenerator struct { func (g IkeGenerator) createIkeResources(ikeID, ikeName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( ikeID, - ikeName, + normalizeResourceName(ikeName, false), "ibm_is_ike_policy", "ibm", []string{}) @@ -41,7 +41,7 @@ func (g IkeGenerator) createIkeResources(ikeID, ikeName string) terraformutils.R // InitResources ... func (g *IkeGenerator) InitResources() error { - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") diff --git a/providers/ibm/ibm_is_image.go b/providers/ibm/ibm_is_image.go index ddc2636a29..5292836078 100644 --- a/providers/ibm/ibm_is_image.go +++ b/providers/ibm/ibm_is_image.go @@ -32,7 +32,7 @@ type ImageGenerator struct { func (g ImageGenerator) createImageResources(imageID, imageName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( imageID, - imageName, + normalizeResourceName(imageName, true), "ibm_is_image", "ibm", []string{}) @@ -41,18 +41,12 @@ func (g ImageGenerator) createImageResources(imageID, imageName string) terrafor // InitResources ... func (g *ImageGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -71,8 +65,12 @@ func (g *ImageGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } images, response, err := vpcclient.ListImages(options) if err != nil { diff --git a/providers/ibm/ibm_is_instance.go b/providers/ibm/ibm_is_instance.go index ffdae94482..8c0334500c 100644 --- a/providers/ibm/ibm_is_instance.go +++ b/providers/ibm/ibm_is_instance.go @@ -28,30 +28,35 @@ type InstanceGenerator struct { IBMService } -func (g InstanceGenerator) createInstanceResources(instanceID, instanceName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( +func (g InstanceGenerator) createInstanceResources(instanceID, instanceName, instanceImgID string) terraformutils.Resource { + resource := terraformutils.NewResource( instanceID, - instanceName, + normalizeResourceName(instanceName, false), "ibm_is_instance", "ibm", - []string{}) - return resources + map[string]string{ + "image": instanceImgID, + }, + []string{}, + map[string]interface{}{ + "keys": []string{}, + }) + + // Deprecated parameters + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^port$", + ) + return resource } // InitResources ... func (g *InstanceGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -70,8 +75,12 @@ func (g *InstanceGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } instances, response, err := vpcclient.ListInstances(options) if err != nil { @@ -85,7 +94,7 @@ func (g *InstanceGenerator) InitResources() error { } for _, instance := range allrecs { - g.Resources = append(g.Resources, g.createInstanceResources(*instance.ID, *instance.Name)) + g.Resources = append(g.Resources, g.createInstanceResources(*instance.ID, *instance.Name, *instance.Image.ID)) } return nil } diff --git a/providers/ibm/ibm_is_instance_template.go b/providers/ibm/ibm_is_instance_template.go index 8bf2aca912..b79a062be2 100644 --- a/providers/ibm/ibm_is_instance_template.go +++ b/providers/ibm/ibm_is_instance_template.go @@ -31,7 +31,7 @@ type InstanceTemplateGenerator struct { func (g InstanceTemplateGenerator) createInstanceTemplateResources(templateID, templateName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( templateID, - templateName, + normalizeResourceName(templateName, false), "ibm_is_instance_template", "ibm", []string{}) @@ -40,7 +40,7 @@ func (g InstanceTemplateGenerator) createInstanceTemplateResources(templateID, t // InitResources ... func (g *InstanceTemplateGenerator) InitResources() error { - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("no API key set") diff --git a/providers/ibm/ibm_is_ipsec_policy.go b/providers/ibm/ibm_is_ipsec_policy.go index f3a72744a8..5a561bac88 100644 --- a/providers/ibm/ibm_is_ipsec_policy.go +++ b/providers/ibm/ibm_is_ipsec_policy.go @@ -29,19 +29,24 @@ type IpsecGenerator struct { IBMService } -func (g IpsecGenerator) createIpsecResources(ipsecID, ipsecName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( - ipsecID, - ipsecName, - "ibm_is_ipsec_policy", - "ibm", - []string{}) - return resources +func (g IpsecGenerator) createIpsecResources() func(ipsecID, ipsecName string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(ipsecID, ipsecName string) terraformutils.Resource { + names, random = getRandom(names, ipsecName, random) + resources := terraformutils.NewSimpleResource( + ipsecID, + normalizeResourceName(ipsecName, random), + "ibm_is_ipsec_policy", + "ibm", + []string{}) + return resources + } } // InitResources ... func (g *IpsecGenerator) InitResources() error { - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") @@ -76,8 +81,9 @@ func (g *IpsecGenerator) InitResources() error { } } + fnObjt := g.createIpsecResources() for _, policy := range allrecs { - g.Resources = append(g.Resources, g.createIpsecResources(*policy.ID, *policy.Name)) + g.Resources = append(g.Resources, fnObjt(*policy.ID, *policy.Name)) } return nil } diff --git a/providers/ibm/ibm_is_lb.go b/providers/ibm/ibm_is_lb.go index 12d5f409d8..7f53b49e02 100644 --- a/providers/ibm/ibm_is_lb.go +++ b/providers/ibm/ibm_is_lb.go @@ -29,19 +29,26 @@ type LBGenerator struct { } func (g LBGenerator) createLBResources(lbID, lbName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewResource( lbID, - lbName, + normalizeResourceName(lbName, true), "ibm_is_lb", "ibm", - []string{}) - return resources + map[string]string{}, + []string{}, + map[string]interface{}{}) + + // Deprecated parameters + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^profile$", + ) + return resource } func (g LBGenerator) createLBPoolResources(lbID, lbPoolID, lbPoolName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", lbID, lbPoolID), - lbPoolName, + normalizeResourceName(lbPoolName, true), "ibm_is_lb_pool", "ibm", map[string]string{}, @@ -55,7 +62,7 @@ func (g LBGenerator) createLBPoolResources(lbID, lbPoolID, lbPoolName string, de func (g LBGenerator) createLBPoolMemberResources(lbID, lbPoolID, lbPoolMemberID, lbPoolMemberName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", lbID, lbPoolID, lbPoolMemberID), - lbPoolMemberName, + normalizeResourceName(lbPoolMemberName, true), "ibm_is_lb_pool_member", "ibm", map[string]string{}, @@ -69,7 +76,7 @@ func (g LBGenerator) createLBPoolMemberResources(lbID, lbPoolID, lbPoolMemberID, func (g LBGenerator) createLBListenerResources(lbID, lbListenerID, lbListenerName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", lbID, lbListenerID), - lbListenerName, + normalizeResourceName(lbListenerName, true), "ibm_is_lb_listener", "ibm", map[string]string{}, @@ -83,7 +90,7 @@ func (g LBGenerator) createLBListenerResources(lbID, lbListenerID, lbListenerNam func (g LBGenerator) createLBListenerPolicyResources(lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", lbID, lbListenerID, lbListenerPolicyID), - lbListenerPolicyName, + normalizeResourceName(lbListenerPolicyName, true), "ibm_is_lb_listener_policy", "ibm", map[string]string{}, @@ -97,7 +104,7 @@ func (g LBGenerator) createLBListenerPolicyResources(lbID, lbListenerID, lbListe func (g LBGenerator) createLBListenerPolicyRuleResources(lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyRuleID, lbListenerPolicyName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s/%s", lbID, lbListenerID, lbListenerPolicyID, lbListenerPolicyRuleID), - lbListenerPolicyName, + normalizeResourceName(lbListenerPolicyName, true), "ibm_is_lb_listener_policy_rule", "ibm", map[string]string{}, @@ -110,7 +117,7 @@ func (g LBGenerator) createLBListenerPolicyRuleResources(lbID, lbListenerID, lbL // InitResources ... func (g *LBGenerator) InitResources() error { - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("no API key set") @@ -143,9 +150,10 @@ func (g *LBGenerator) InitResources() error { for _, lb := range allrecs { var dependsOn []string - dependsOn = append(dependsOn, - "ibm_is_lb."+terraformutils.TfSanitize(*lb.Name)) g.Resources = append(g.Resources, g.createLBResources(*lb.ID, *lb.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + dependsOn = append(dependsOn, + "ibm_is_lb."+resourceName) listLoadBalancerPoolsOptions := &vpcv1.ListLoadBalancerPoolsOptions{ LoadBalancerID: lb.ID, } @@ -155,8 +163,9 @@ func (g *LBGenerator) InitResources() error { } for _, lbPool := range lbPools.Pools { g.Resources = append(g.Resources, g.createLBPoolResources(*lb.ID, *lbPool.ID, *lbPool.Name, dependsOn)) - dependsOn1 := append(dependsOn, - "ibm_is_lb_pool."+terraformutils.TfSanitize(*lbPool.Name)) + lbPoolResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + dependsOn1 := makeDependsOn(dependsOn, + "ibm_is_lb_pool."+lbPoolResourceName) listLoadBalancerPoolMembersOptions := &vpcv1.ListLoadBalancerPoolMembersOptions{ LoadBalancerID: lb.ID, PoolID: lbPool.ID, @@ -179,8 +188,9 @@ func (g *LBGenerator) InitResources() error { } for _, lbListener := range lbListeners.Listeners { g.Resources = append(g.Resources, g.createLBListenerResources(*lb.ID, *lbListener.ID, *lbListener.ID, dependsOn)) + lbListenerResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName var dependsOn2 = append(dependsOn, //nolint:goimports,gofmt - "ibm_is_lb_listener."+terraformutils.TfSanitize(*lbListener.ID)) + "ibm_is_lb_listener."+lbListenerResourceName) listLoadBalancerListenerPoliciesOptions := &vpcv1.ListLoadBalancerListenerPoliciesOptions{ LoadBalancerID: lb.ID, ListenerID: lbListener.ID, @@ -191,8 +201,9 @@ func (g *LBGenerator) InitResources() error { } for _, lbListenerPolicy := range lbListenerPolicies.Policies { g.Resources = append(g.Resources, g.createLBListenerPolicyResources(*lb.ID, *lbListener.ID, *lbListenerPolicy.ID, *lbListenerPolicy.Name, dependsOn2)) + lbListenerPolicyResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName dependsOn2 = append(dependsOn2, - "ibm_is_lb_listener_policy."+terraformutils.TfSanitize(*lbListenerPolicy.Name)) + "ibm_is_lb_listener_policy."+lbListenerPolicyResourceName) listLoadBalancerListenerPolicyRulesOptions := &vpcv1.ListLoadBalancerListenerPolicyRulesOptions{ LoadBalancerID: lb.ID, ListenerID: lbListener.ID, diff --git a/providers/ibm/ibm_is_network_acl.go b/providers/ibm/ibm_is_network_acl.go index dce16bcd55..cb29127896 100644 --- a/providers/ibm/ibm_is_network_acl.go +++ b/providers/ibm/ibm_is_network_acl.go @@ -32,7 +32,7 @@ type NetworkACLGenerator struct { func (g NetworkACLGenerator) createNetworkACLResources(nwaclID, nwaclName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( nwaclID, - nwaclName, + normalizeResourceName(nwaclName, true), "ibm_is_network_acl", "ibm", []string{}) @@ -41,18 +41,12 @@ func (g NetworkACLGenerator) createNetworkACLResources(nwaclID, nwaclName string // InitResources ... func (g *NetworkACLGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -71,8 +65,12 @@ func (g *NetworkACLGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } nwacls, response, err := vpcclient.ListNetworkAcls(options) if err != nil { diff --git a/providers/ibm/ibm_is_public_gateway.go b/providers/ibm/ibm_is_public_gateway.go index 1c8af8181e..0cdff6948d 100644 --- a/providers/ibm/ibm_is_public_gateway.go +++ b/providers/ibm/ibm_is_public_gateway.go @@ -32,7 +32,7 @@ type PublicGatewayGenerator struct { func (g PublicGatewayGenerator) createPublicGatewayResources(publicGatewayID, publicGatewayName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( publicGatewayID, - publicGatewayName, + normalizeResourceName(publicGatewayName, false), "ibm_is_public_gateway", "ibm", []string{}) @@ -41,17 +41,12 @@ func (g PublicGatewayGenerator) createPublicGatewayResources(publicGatewayID, pu // InitResources ... func (g *PublicGatewayGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -70,8 +65,12 @@ func (g *PublicGatewayGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } pgs, response, err := vpcclient.ListPublicGateways(options) if err != nil { diff --git a/providers/ibm/ibm_is_security_group.go b/providers/ibm/ibm_is_security_group.go index b1df920a07..3925bd56bf 100644 --- a/providers/ibm/ibm_is_security_group.go +++ b/providers/ibm/ibm_is_security_group.go @@ -32,7 +32,7 @@ type SecurityGroupGenerator struct { func (g SecurityGroupGenerator) createSecurityGroupResources(sgID, sgName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( sgID, - sgName, + normalizeResourceName(sgName, false), "ibm_is_security_group", "ibm", []string{}) @@ -42,7 +42,7 @@ func (g SecurityGroupGenerator) createSecurityGroupResources(sgID, sgName string func (g SecurityGroupGenerator) createSecurityGroupRuleResources(sgID, sgRuleID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s.%s", sgID, sgRuleID), - sgRuleID, + normalizeResourceName("ibm_is_security_group_rule", true), "ibm_is_security_group_rule", "ibm", map[string]string{}, @@ -55,18 +55,12 @@ func (g SecurityGroupGenerator) createSecurityGroupRuleResources(sgID, sgRuleID // InitResources ... func (g *SecurityGroupGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -85,8 +79,12 @@ func (g *SecurityGroupGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } sgs, response, err := vpcclient.ListSecurityGroups(options) if err != nil { @@ -101,9 +99,11 @@ func (g *SecurityGroupGenerator) InitResources() error { for _, group := range allrecs { var dependsOn []string - dependsOn = append(dependsOn, - "ibm_is_security_group"+terraformutils.TfSanitize(*group.Name)) + g.Resources = append(g.Resources, g.createSecurityGroupResources(*group.ID, *group.Name)) + sgResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + dependsOn = append(dependsOn, + "ibm_is_security_group."+sgResourceName) listSecurityGroupRulesOptions := &vpcv1.ListSecurityGroupRulesOptions{ SecurityGroupID: group.ID, } diff --git a/providers/ibm/ibm_is_ssh_key.go b/providers/ibm/ibm_is_ssh_key.go index f7e65941f4..e2b7f60903 100644 --- a/providers/ibm/ibm_is_ssh_key.go +++ b/providers/ibm/ibm_is_ssh_key.go @@ -32,7 +32,7 @@ type SSHKeyGenerator struct { func (g SSHKeyGenerator) createSSHKeyResources(sshKeyID, sshKeyName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( sshKeyID, - sshKeyName, + normalizeResourceName(sshKeyName, true), "ibm_is_ssh_key", "ibm", []string{}) @@ -41,17 +41,12 @@ func (g SSHKeyGenerator) createSSHKeyResources(sshKeyID, sshKeyName string) terr // InitResources ... func (g *SSHKeyGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -64,8 +59,12 @@ func (g *SSHKeyGenerator) InitResources() error { return err } options := &vpcv1.ListKeysOptions{} - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } keys, response, err := vpcclient.ListKeys(options) if err != nil { diff --git a/providers/ibm/ibm_is_subnet.go b/providers/ibm/ibm_is_subnet.go index 1f54116085..a71dc29239 100644 --- a/providers/ibm/ibm_is_subnet.go +++ b/providers/ibm/ibm_is_subnet.go @@ -29,29 +29,29 @@ type SubnetGenerator struct { } func (g SubnetGenerator) createSubnetResources(subnetID, subnetName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewResource( subnetID, - subnetName, + normalizeResourceName(subnetName, false), "ibm_is_subnet", "ibm", - []string{}) - return resources + map[string]string{}, + []string{}, + map[string]interface{}{}) + + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^total_ipv4_address_count$", + ) + return resource } // InitResources ... func (g *SubnetGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -71,8 +71,12 @@ func (g *SubnetGenerator) InitResources() error { if start != "" { options.Start = &start } - if resoureGroup != "" { - options.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + options.ResourceGroupID = &rg } subnets, response, err := vpcclient.ListSubnets(options) if err != nil { diff --git a/providers/ibm/ibm_is_virtual_endpoint_gateway.go b/providers/ibm/ibm_is_virtual_endpoint_gateway.go index bc3d8d2488..09cce57c8b 100644 --- a/providers/ibm/ibm_is_virtual_endpoint_gateway.go +++ b/providers/ibm/ibm_is_virtual_endpoint_gateway.go @@ -31,7 +31,7 @@ type VPEGenerator struct { func (g VPEGenerator) createVPEGatewayResources(gatewayID, gatewayName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( gatewayID, - gatewayName, + normalizeResourceName(gatewayName, false), "ibm_is_virtual_endpoint_gateway", "ibm", []string{}) @@ -41,7 +41,7 @@ func (g VPEGenerator) createVPEGatewayResources(gatewayID, gatewayName string) t func (g VPEGenerator) createVPEGatewayIPResources(gatewayID, gatewayIPID, gatewayIPName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", gatewayID, gatewayIPID), - gatewayIPName, + normalizeResourceName(gatewayIPName, false), "ibm_is_virtual_endpoint_gateway_ip", "ibm", map[string]string{}, @@ -54,18 +54,12 @@ func (g VPEGenerator) createVPEGatewayIPResources(gatewayID, gatewayIPID, gatewa // InitResources ... func (g *VPEGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("No API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -85,8 +79,12 @@ func (g *VPEGenerator) InitResources() error { if start != "" { listEndpointGatewaysOptions.Start = &start } - if resoureGroup != "" { - listEndpointGatewaysOptions.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + listEndpointGatewaysOptions.ResourceGroupID = &rg } gateways, response, err := vpcclient.ListEndpointGateways(listEndpointGatewaysOptions) if err != nil { diff --git a/providers/ibm/ibm_is_volume.go b/providers/ibm/ibm_is_volume.go index 4d9ffe9f7b..bc5145b64e 100644 --- a/providers/ibm/ibm_is_volume.go +++ b/providers/ibm/ibm_is_volume.go @@ -32,7 +32,7 @@ type VolumeGenerator struct { func (g VolumeGenerator) createVolumeResources(volID, volName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( volID, - volName, + normalizeResourceName(volName, true), "ibm_is_volume", "ibm", []string{}) @@ -41,7 +41,7 @@ func (g VolumeGenerator) createVolumeResources(volID, volName string) terraformu // InitResources ... func (g *VolumeGenerator) InitResources() error { - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { log.Fatal("No API key set") diff --git a/providers/ibm/ibm_is_vpc.go b/providers/ibm/ibm_is_vpc.go index b285af3ee2..01cbca9310 100644 --- a/providers/ibm/ibm_is_vpc.go +++ b/providers/ibm/ibm_is_vpc.go @@ -29,19 +29,27 @@ type VPCGenerator struct { } func (g VPCGenerator) createVPCResources(vpcID, vpcName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewResource( vpcID, - vpcName, + normalizeResourceName(vpcName, false), "ibm_is_vpc", "ibm", - []string{}) - return resources + map[string]string{}, + []string{}, + map[string]interface{}{}) + + // Deprecated parameters + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^default_network_acl$", + ) + + return resource } func (g VPCGenerator) createVPCAddressPrefixResources(vpcID, addPrefixID, addPrefixName string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, addPrefixID), - addPrefixName, + normalizeResourceName(addPrefixName, false), "ibm_is_vpc_address_prefix", "ibm", map[string]string{}, @@ -49,13 +57,14 @@ func (g VPCGenerator) createVPCAddressPrefixResources(vpcID, addPrefixID, addPre map[string]interface{}{ "depends_on": dependsOn, }) - return resources + + return resource } func (g VPCGenerator) createVPCRouteResources(vpcID, routeID, routeName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, routeID), - routeName, + normalizeResourceName(routeName, false), "ibm_is_vpc_route", "ibm", map[string]string{}, @@ -69,10 +78,12 @@ func (g VPCGenerator) createVPCRouteResources(vpcID, routeID, routeName string, func (g VPCGenerator) createVPCRouteTableResources(vpcID, routeTableID, routeTableName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpcID, routeTableID), - routeTableName, + normalizeResourceName(routeTableName, false), "ibm_is_vpc_routing_table", "ibm", - map[string]string{}, + map[string]string{ + "vpc": vpcID, + }, []string{}, map[string]interface{}{ "depends_on": dependsOn, @@ -81,33 +92,36 @@ func (g VPCGenerator) createVPCRouteTableResources(vpcID, routeTableID, routeTab } func (g VPCGenerator) createVPCRouteTableRouteResources(vpcID, routeTableID, routeTableRouteID, routeTableRouteName string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", vpcID, routeTableID, routeTableRouteID), - routeTableRouteName, + normalizeResourceName(routeTableRouteName, false), "ibm_is_vpc_routing_table_route", "ibm", - map[string]string{}, + map[string]string{ + "vpc": vpcID, + "routing_table": routeTableID, + "action": "deliver", + }, []string{}, map[string]interface{}{ "depends_on": dependsOn, }) - return resources + + // Deprecated parameters + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^action$", + ) + return resource } // InitResources ... func (g *VPCGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("no API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -126,8 +140,12 @@ func (g *VPCGenerator) InitResources() error { if start != "" { listVpcsOptions.Start = &start } - if resoureGroup != "" { - listVpcsOptions.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + listVpcsOptions.ResourceGroupID = &rg } vpcs, response, err := vpcclient.ListVpcs(listVpcsOptions) if err != nil { @@ -142,9 +160,9 @@ func (g *VPCGenerator) InitResources() error { for _, vpc := range allrecs { var dependsOn []string - dependsOn = append(dependsOn, - "ibm_is_vpc."+terraformutils.TfSanitize(*vpc.Name)) g.Resources = append(g.Resources, g.createVPCResources(*vpc.ID, *vpc.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + dependsOn = append(dependsOn, "ibm_is_vpc."+resourceName) listVPCAddressPrefixesOptions := &vpcv1.ListVPCAddressPrefixesOptions{ VPCID: vpc.ID, } @@ -176,8 +194,8 @@ func (g *VPCGenerator) InitResources() error { } for _, table := range tables.RoutingTables { g.Resources = append(g.Resources, g.createVPCRouteTableResources(*vpc.ID, *table.ID, *table.Name, dependsOn)) - dependsOn = append(dependsOn, - "ibm_is_vpc_routing_table."+terraformutils.TfSanitize(*table.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + dependsOn = append(dependsOn, "ibm_is_vpc_routing_table."+resourceName) listVPCRoutingTableRoutesOptions := &vpcv1.ListVPCRoutingTableRoutesOptions{ VPCID: vpc.ID, RoutingTableID: table.ID, diff --git a/providers/ibm/ibm_is_vpn_gateway.go b/providers/ibm/ibm_is_vpn_gateway.go index 6a198b2859..a95f007e99 100644 --- a/providers/ibm/ibm_is_vpn_gateway.go +++ b/providers/ibm/ibm_is_vpn_gateway.go @@ -31,7 +31,7 @@ type VPNGatewayGenerator struct { func (g VPNGatewayGenerator) createVPNGatewayResources(vpngwID, vpngwName string) terraformutils.Resource { resources := terraformutils.NewSimpleResource( vpngwID, - vpngwName, + normalizeResourceName(vpngwName, false), "ibm_is_vpn_gateway", "ibm", []string{}) @@ -41,7 +41,7 @@ func (g VPNGatewayGenerator) createVPNGatewayResources(vpngwID, vpngwName string func (g VPNGatewayGenerator) createVPNGatewayConnectionResources(vpngwID, vpngwConnectionID, vpngwConnectionName string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", vpngwID, vpngwConnectionID), - vpngwConnectionName, + normalizeResourceName(vpngwConnectionName, false), "ibm_is_vpn_gateway_connections", "ibm", map[string]string{}, @@ -54,18 +54,12 @@ func (g VPNGatewayGenerator) createVPNGatewayConnectionResources(vpngwID, vpngwC // InitResources ... func (g *VPNGatewayGenerator) InitResources() error { - var resoureGroup string - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("no API key set") } - rg := g.Args["resource_group"] - if rg != nil { - resoureGroup = rg.(string) - } - vpcurl := fmt.Sprintf("https://%s.iaas.cloud.ibm.com/v1", region) vpcoptions := &vpcv1.VpcV1Options{ URL: envFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, vpcurl), @@ -84,8 +78,12 @@ func (g *VPNGatewayGenerator) InitResources() error { if start != "" { listVPNGatewaysOptions.Start = &start } - if resoureGroup != "" { - listVPNGatewaysOptions.ResourceGroupID = &resoureGroup + if rg := g.Args["resource_group"].(string); rg != "" { + rg, err = GetResourceGroupID(apiKey, rg, region) + if err != nil { + return fmt.Errorf("Error Fetching Resource Group Id %s", err) + } + listVPNGatewaysOptions.ResourceGroupID = &rg } vpngws, response, err := vpcclient.ListVPNGateways(listVPNGatewaysOptions) if err != nil { @@ -101,9 +99,11 @@ func (g *VPNGatewayGenerator) InitResources() error { for _, gw := range allrecs { vpngw := gw.(*vpcv1.VPNGateway) var dependsOn []string - dependsOn = append(dependsOn, - "ibm_is_vpn_gateway."+terraformutils.TfSanitize(*vpngw.Name)) + g.Resources = append(g.Resources, g.createVPNGatewayResources(*vpngw.ID, *vpngw.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + dependsOn = append(dependsOn, + "ibm_is_vpn_gateway."+resourceName) listVPNGatewayConnectionsOptions := &vpcv1.ListVPNGatewayConnectionsOptions{ VPNGatewayID: vpngw.ID, } diff --git a/providers/ibm/ibm_kp.go b/providers/ibm/ibm_kp.go index c0bab45fe6..2a319550f5 100644 --- a/providers/ibm/ibm_kp.go +++ b/providers/ibm/ibm_kp.go @@ -31,32 +31,42 @@ type KPGenerator struct { IBMService } -func (g KPGenerator) loadKP(kpID, kpGUID string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( - kpID, - kpGUID, - "ibm_resource_instance", - "ibm", - []string{}) - return resources +func (g KPGenerator) loadKP() func(kpID, kpName string) terraformutils.Resource { + names := make(map[string]struct{}) + random := true + return func(kpID, kpName string) terraformutils.Resource { + names, random = getRandom(names, kpName, random) + resource := terraformutils.NewSimpleResource( + kpID, + normalizeResourceName(kpName, random), + "ibm_resource_instance", + "ibm", + []string{}) + return resource + } } -func (g KPGenerator) loadkPKeys(kpKeyCRN, kpKeyID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( - kpKeyCRN, - kpKeyID, - "ibm_kms_key", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{ - "depends_on": dependsOn, - }) - return resources +func (g KPGenerator) loadkPKeys() func(kpKeyCRN, kpKeyName string, dependsOn []string) terraformutils.Resource { + names := make(map[string]struct{}) + random := true + return func(kpKeyCRN, kpKeyName string, dependsOn []string) terraformutils.Resource { + names, random = getRandom(names, kpKeyName, random) + resource := terraformutils.NewResource( + kpKeyCRN, + normalizeResourceName(kpKeyName, random), + "ibm_kms_key", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resource + } } func (g *KPGenerator) InitResources() error { - region := envFallBack([]string{"IC_REGION"}, "us-south") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), } @@ -97,19 +107,22 @@ func (g *KPGenerator) InitResources() error { if err != nil { return err } + fnObjt := g.loadKP() for _, kpInstance := range kpInstances { - g.Resources = append(g.Resources, g.loadKP(kpInstance.ID, kpInstance.Guid)) + g.Resources = append(g.Resources, fnObjt(kpInstance.ID, kpInstance.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName client.Config.InstanceID = kpInstance.Guid output, err := client.GetKeys(context.Background(), 100, 0) if err != nil { return err } + fnObjt := g.loadkPKeys() for _, key := range output.Keys { var dependsOn []string dependsOn = append(dependsOn, - "ibm_resource_instance."+terraformutils.TfSanitize(kpInstance.Guid)) - g.Resources = append(g.Resources, g.loadkPKeys(key.CRN, key.ID, dependsOn)) + "ibm_resource_instance."+resourceName) + g.Resources = append(g.Resources, fnObjt(key.CRN, key.Name, dependsOn)) } } diff --git a/providers/ibm/ibm_private_dns.go b/providers/ibm/ibm_private_dns.go index 5cb592d1fe..3debc4a56b 100644 --- a/providers/ibm/ibm_private_dns.go +++ b/providers/ibm/ibm_private_dns.go @@ -34,25 +34,30 @@ type privateDNSTemplateGenerator struct { } // loadPrivateDNS ... -func (g privateDNSTemplateGenerator) loadPrivateDNS(pDNSID string, pDNSName string, resGrpID string) terraformutils.Resource { - resources := terraformutils.NewResource( - pDNSID, - pDNSName, - "ibm_resource_instance", - "ibm", - map[string]string{ - "resource_group_id": resGrpID, - }, - []string{}, - map[string]interface{}{}) - return resources +func (g privateDNSTemplateGenerator) loadPrivateDNS() func(pDNSID, pDNSName, resGrpID string) terraformutils.Resource { + names := make(map[string]struct{}) + random := true + return func(pDNSID, pDNSName, resGrpID string) terraformutils.Resource { + names, random = getRandom(names, pDNSName, random) + resource := terraformutils.NewResource( + pDNSID, + normalizeResourceName(pDNSName, random), + "ibm_resource_instance", + "ibm", + map[string]string{ + "resource_group_id": resGrpID, + }, + []string{}, + map[string]interface{}{}) + return resource + } } // loadPrivateDNSZone ... func (g privateDNSTemplateGenerator) loadPrivateDNSZone(pDNSGuid string, zoneID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s", pDNSGuid, zoneID), - zoneID, + normalizeResourceName("ibm_dns_zone", true), "ibm_dns_zone", "ibm", map[string]string{}, @@ -67,7 +72,7 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSZone(pDNSGuid string, zoneID func (g privateDNSTemplateGenerator) loadPrivateDNSPermittedNetwork(pDNSGuid string, zoneID string, permittedNetworkID string, dependsOn []string) terraformutils.Resource { resources := terraformutils.NewResource( fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, permittedNetworkID), - permittedNetworkID, + normalizeResourceName("ibm_dns_permitted_network", true), "ibm_dns_permitted_network", "ibm", map[string]string{}, @@ -79,69 +84,89 @@ func (g privateDNSTemplateGenerator) loadPrivateDNSPermittedNetwork(pDNSGuid str } // loadPrivateDNSResourceRecord ... -func (g privateDNSTemplateGenerator) loadPrivateDNSResourceRecord(pDNSGuid string, zoneID string, recordID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( - fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, recordID), - recordID, - "ibm_dns_resource_record", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{ - "depends_on": dependsOn, - }) - return resources +func (g privateDNSTemplateGenerator) loadPrivateDNSResourceRecord() func(pDNSGuid, zoneID, recordID, recordName string, dependsOn []string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(pDNSGuid, zoneID, recordID, recordName string, dependsOn []string) terraformutils.Resource { + names, random = getRandom(names, recordName, random) + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, recordID), + normalizeResourceName(recordName, random), + "ibm_dns_resource_record", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources + } } // loadPrivateDNSGLBMonitor ... -func (g privateDNSTemplateGenerator) loadPrivateDNSGLBMonitor(pDNSGuid string, monitorID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( - fmt.Sprintf("%s/%s", pDNSGuid, monitorID), - monitorID, - "ibm_dns_glb_monitor", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{ - "depends_on": dependsOn, - }) - return resources +func (g privateDNSTemplateGenerator) loadPrivateDNSGLBMonitor() func(pDNSGuid, monitorID, monitorName string, dependsOn []string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(pDNSGuid, monitorID, monitorName string, dependsOn []string) terraformutils.Resource { + names, random = getRandom(names, monitorName, random) + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", pDNSGuid, monitorID), + normalizeResourceName(monitorName, random), + "ibm_dns_glb_monitor", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources + } } // loadPrivateDNSGLBPool ... -func (g privateDNSTemplateGenerator) loadPrivateDNSGLBPool(pDNSGuid string, poolID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( - fmt.Sprintf("%s/%s", pDNSGuid, poolID), - poolID, - "ibm_dns_glb_pool", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{ - "depends_on": dependsOn, - }) - return resources +func (g privateDNSTemplateGenerator) loadPrivateDNSGLBPool() func(pDNSGuid, poolID, poolName string, dependsOn []string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(pDNSGuid, poolID, poolName string, dependsOn []string) terraformutils.Resource { + names, random = getRandom(names, poolName, random) + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s", pDNSGuid, poolID), + normalizeResourceName(poolName, random), + "ibm_dns_glb_pool", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources + } } // loadPrivateDNSGLB ... -func (g privateDNSTemplateGenerator) loadPrivateDNSGLB(pDNSGuid string, zoneID string, lbID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( - fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, lbID), - lbID, - "ibm_dns_glb", - "ibm", - map[string]string{}, - []string{}, - map[string]interface{}{ - "depends_on": dependsOn, - }) - return resources +func (g privateDNSTemplateGenerator) loadPrivateDNSGLB() func(pDNSGuid, zoneID, lbID, lbName string, dependsOn []string) terraformutils.Resource { + names := make(map[string]struct{}) + random := false + return func(pDNSGuid, zoneID, lbID, lbName string, dependsOn []string) terraformutils.Resource { + names, random = getRandom(names, lbName, random) + resources := terraformutils.NewResource( + fmt.Sprintf("%s/%s/%s", pDNSGuid, zoneID, lbID), + normalizeResourceName(lbName, random), + "ibm_dns_glb", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "depends_on": dependsOn, + }) + return resources + } } // InitResources ... func (g *privateDNSTemplateGenerator) InitResources() error { - region := os.Getenv("IC_REGION") + region := g.Args["region"].(string) bmxConfig := &bluemix.Config{ BluemixAPIKey: os.Getenv("IC_API_KEY"), Region: region, @@ -190,10 +215,12 @@ func (g *privateDNSTemplateGenerator) InitResources() error { instanceID := instance.ID instanceGUID := instance.Guid // Instance - g.Resources = append(g.Resources, g.loadPrivateDNS(instanceID, instance.Name, instance.ResourceGroupID)) + fnObjt := g.loadPrivateDNS() + g.Resources = append(g.Resources, fnObjt(instanceID, instance.Name, instance.ResourceGroupID)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName var pDNSDependsOn []string pDNSDependsOn = append(pDNSDependsOn, - "ibm_resource_instance."+terraformutils.TfSanitize(instance.Name)) + "ibm_resource_instance."+resourceName) // Zones zoneOpts := &dns.DnsSvcsV1Options{ @@ -217,9 +244,8 @@ func (g *privateDNSTemplateGenerator) InitResources() error { for _, zone := range zoneList.Dnszones { zoneID := *zone.ID g.Resources = append(g.Resources, g.loadPrivateDNSZone(instanceGUID, zoneID, pDNSDependsOn)) - - domainDependsOn := append(pDNSDependsOn, - "ibm_dns_zone."+terraformutils.TfSanitize(zoneID)) + domainResourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + domainDependsOn := makeDependsOn(pDNSDependsOn, "ibm_dns_zone."+domainResourceName) // Permitted Network Records permittedNetworkOpt := dns.ListPermittedNetworksOptions{ @@ -244,9 +270,10 @@ func (g *privateDNSTemplateGenerator) InitResources() error { if err != nil { return fmt.Errorf("error Listing Resource Records %s", err) } + + pdnsFnObjt := g.loadPrivateDNSResourceRecord() for _, record := range resourceRecordList.ResourceRecords { - recordID := *record.ID - g.Resources = append(g.Resources, g.loadPrivateDNSResourceRecord(instanceGUID, zoneID, recordID, domainDependsOn)) + g.Resources = append(g.Resources, pdnsFnObjt(instanceGUID, zoneID, *record.ID, *record.Name, domainDependsOn)) } // GLB Records @@ -258,9 +285,9 @@ func (g *privateDNSTemplateGenerator) InitResources() error { if err != nil { return fmt.Errorf("error Listing GLBs %s", err) } + glbFntObj := g.loadPrivateDNSGLB() for _, lb := range glbOptList.LoadBalancers { - lbID := *lb.ID - g.Resources = append(g.Resources, g.loadPrivateDNSGLB(instanceGUID, zoneID, lbID, domainDependsOn)) + g.Resources = append(g.Resources, glbFntObj(instanceGUID, zoneID, *lb.ID, *lb.Name, domainDependsOn)) } } // Monitor Records @@ -271,9 +298,10 @@ func (g *privateDNSTemplateGenerator) InitResources() error { if err != nil { return fmt.Errorf("error Listing GLB Monitor %s", err) } + + lbMonitorObjt := g.loadPrivateDNSGLBMonitor() for _, monitor := range glbMonitorList.Monitors { - monitorID := *monitor.ID - g.Resources = append(g.Resources, g.loadPrivateDNSGLBMonitor(instanceGUID, monitorID, pDNSDependsOn)) + g.Resources = append(g.Resources, lbMonitorObjt(instanceGUID, *monitor.ID, *monitor.Name, pDNSDependsOn)) } // Pool Records @@ -284,9 +312,9 @@ func (g *privateDNSTemplateGenerator) InitResources() error { if err != nil { return fmt.Errorf("error Listing GLB Pools %s", err) } + dnsGlbfnObj := g.loadPrivateDNSGLBPool() for _, pool := range glbPoolOptList.Pools { - poolID := *pool.ID - g.Resources = append(g.Resources, g.loadPrivateDNSGLBPool(instanceGUID, poolID, pDNSDependsOn)) + g.Resources = append(g.Resources, dnsGlbfnObj(instanceGUID, *pool.ID, *pool.Name, pDNSDependsOn)) } } diff --git a/providers/ibm/ibm_provider.go b/providers/ibm/ibm_provider.go index e4560068ea..85f16c4b24 100644 --- a/providers/ibm/ibm_provider.go +++ b/providers/ibm/ibm_provider.go @@ -16,10 +16,14 @@ package ibm import ( "errors" + "os" "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) +const DefaultRegion = "us-south" +const NoRegion = "" + type IBMProvider struct { //nolint terraformutils.Provider ResourceGroup string @@ -32,6 +36,16 @@ func (p *IBMProvider) Init(args []string) error { p.Region = args[1] p.CIS = args[2] + var err error + if p.Region != DefaultRegion && p.Region != NoRegion { + err = os.Setenv("IC_REGION", p.Region) + } else { + p.Region = DefaultRegion + err = os.Setenv("IC_REGION", DefaultRegion) + } + if err != nil { + return err + } return nil } @@ -42,7 +56,9 @@ func (p *IBMProvider) GetName() string { func (p *IBMProvider) GetProviderData(arg ...string) map[string]interface{} { return map[string]interface{}{ "provider": map[string]interface{}{ - "ibm": map[string]interface{}{}, + "ibm": map[string]interface{}{ + "region": p.Region, + }, }, } } @@ -88,6 +104,7 @@ func (p *IBMProvider) GetSupportedService() map[string]terraformutils.ServiceGen "ibm_direct_link": &DLGenerator{}, "ibm_transit_gateway": &TGGenerator{}, "ibm_vpe_gateway": &VPEGenerator{}, + "ibm_satellite": &SatelliteGenerator{}, } } diff --git a/providers/ibm/ibm_tg.go b/providers/ibm/ibm_tg.go index e0d4977036..51eb8be993 100644 --- a/providers/ibm/ibm_tg.go +++ b/providers/ibm/ibm_tg.go @@ -30,19 +30,19 @@ type TGGenerator struct { } func (g TGGenerator) createTransitGatewayResources(gatewayID, gatewayName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewSimpleResource( gatewayID, - gatewayName, + normalizeResourceName(gatewayName, false), "ibm_tg_gateway", "ibm", []string{}) - return resources + return resource } func (g TGGenerator) createTransitGatewayConnectionResources(gatewayID, connectionID, connectionName string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( + resource := terraformutils.NewResource( fmt.Sprintf("%s/%s", gatewayID, connectionID), - connectionName, + normalizeResourceName(connectionName, false), "ibm_tg_connection", "ibm", map[string]string{}, @@ -50,7 +50,7 @@ func (g TGGenerator) createTransitGatewayConnectionResources(gatewayID, connecti map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } // CreateVersionDate requires mandatory version attribute. Any date from 2019-12-13 up to the currentdate may be provided. Specify the current date to request the latest version. @@ -98,9 +98,10 @@ func (g *TGGenerator) InitResources() error { } for _, gateway := range allrecs { g.Resources = append(g.Resources, g.createTransitGatewayResources(*gateway.ID, *gateway.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName var dependsOn []string dependsOn = append(dependsOn, - "ibm_tg_gateway."+terraformutils.TfSanitize(*gateway.Name)) + "ibm_tg_gateway."+resourceName) listTransitGatewayConnectionsOptions := &tg.ListTransitGatewayConnectionsOptions{ TransitGatewayID: gateway.ID, } diff --git a/providers/ibm/instance_groups.go b/providers/ibm/instance_groups.go index d9b5483850..31045a2f72 100644 --- a/providers/ibm/instance_groups.go +++ b/providers/ibm/instance_groups.go @@ -116,7 +116,7 @@ func (g *InstanceGroupGenerator) handleManagers(sess *vpcv1.VpcV1, instanceGroup policies = append(policies, *(instanceGroupManager.Policies[i].ID)) } policiesWG.Add(1) - dependsOn1 := append(dependsOn, + dependsOn1 := makeDependsOn(dependsOn, "ibm_is_instance_group_manger."+terraformutils.TfSanitize(*instanceGroupManager.Name)) go g.handlePolicies(sess, instanceGroupID, instanceGroupManagerID, policies, dependsOn1, &policiesWG) } @@ -164,7 +164,7 @@ func (g *InstanceGroupGenerator) handleInstanceGroups(sess *vpcv1.VpcV1, waitGro // InitResources ... func (g *InstanceGroupGenerator) InitResources() error { - apiKey := os.Getenv("IBMCLOUD_API_KEY") + apiKey := os.Getenv("IC_API_KEY") if apiKey == "" { return fmt.Errorf("no API key set") } diff --git a/providers/ibm/satellite.go b/providers/ibm/satellite.go new file mode 100644 index 0000000000..be0fbc0eb9 --- /dev/null +++ b/providers/ibm/satellite.go @@ -0,0 +1,141 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ibm + +import ( + "fmt" + "os" + "strings" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/session" + "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + + "github.com/IBM/go-sdk-core/v3/core" +) + +type SatelliteGenerator struct { + IBMService +} + +func (g SatelliteGenerator) loadLocations(locID, locName string) terraformutils.Resource { + resource := terraformutils.NewResource( + locID, + normalizeResourceName(locName, false), + "ibm_satellite_location", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{}) + + // Remove parameters + resource.IgnoreKeys = append(resource.IgnoreKeys, + "^labels$", + ) + + return resource +} + +func (g SatelliteGenerator) loadAssignHostControlPlane(locID, hostID string, labels []string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( + fmt.Sprintf("%s/%s", locID, hostID), + normalizeResourceName("ibm_satellite_host", true), + "ibm_satellite_host", + "ibm", + map[string]string{}, + []string{}, + map[string]interface{}{ + "labels": labels, + "depends_on": dependsOn, + }) + return resource +} + +func (g *SatelliteGenerator) InitResources() error { + bmxConfig := &bluemix.Config{ + BluemixAPIKey: os.Getenv("IC_API_KEY"), + } + + sess, err := session.New(bmxConfig) + if err != nil { + return err + } + + err = authenticateAPIKey(sess) + if err != nil { + return err + } + + bluemixToken := "" + if strings.HasPrefix(sess.Config.IAMAccessToken, "Bearer") { + bluemixToken = sess.Config.IAMAccessToken[7:len(sess.Config.IAMAccessToken)] + } else { + bluemixToken = sess.Config.IAMAccessToken + } + + containerEndpoint := kubernetesserviceapiv1.DefaultServiceURL + kubernetesServiceV1Options := &kubernetesserviceapiv1.KubernetesServiceApiV1Options{ + URL: envFallBack([]string{"IBMCLOUD_SATELLITE_API_ENDPOINT"}, containerEndpoint), + Authenticator: &core.BearerTokenAuthenticator{ + BearerToken: bluemixToken, + }, + } + + satelliteClient, err := kubernetesserviceapiv1.NewKubernetesServiceApiV1(kubernetesServiceV1Options) + if err != nil { + return err + } + + getSatLocOpts := &kubernetesserviceapiv1.GetSatelliteLocationsOptions{} + locations, _, err := satelliteClient.GetSatelliteLocations(getSatLocOpts) + if err != nil { + return err + } + + for _, loc := range locations { + var locDependsOn []string + + // Location + if loc.Deployments != nil && !strings.Contains(*loc.Deployments.Message, "R0037") { + g.Resources = append(g.Resources, g.loadLocations(*loc.ID, *loc.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName + locDependsOn = append(locDependsOn, + "ibm_satellite_location."+resourceName) + + // Assign Host - Control plane + getSatHostOpts := &kubernetesserviceapiv1.GetSatelliteHostsOptions{ + Controller: loc.ID, + } + hosts, resp, err := satelliteClient.GetSatelliteHosts(getSatHostOpts) + if err != nil { + return fmt.Errorf("Error getting satellite control plane hosts %s\n%s", err, resp) + } + + for _, host := range hosts { + if *host.Assignment.ClusterName == "infrastructure" { + hostLabels := []string{} + for key, value := range host.Labels { + hostLabels = append(hostLabels, fmt.Sprintf("%s=%s", key, value)) + } + g.Resources = append(g.Resources, g.loadAssignHostControlPlane(*loc.ID, *host.ID, hostLabels, locDependsOn)) + } + } + + } + } + + return nil +} diff --git a/providers/ibm/utils.go b/providers/ibm/utils.go index 795e664f6a..b3c9e60722 100644 --- a/providers/ibm/utils.go +++ b/providers/ibm/utils.go @@ -15,17 +15,22 @@ package ibm import ( + "fmt" gohttp "net/http" "net/url" "os" "reflect" + "strconv" "strings" + bluemix "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/authentication" "github.com/IBM-Cloud/bluemix-go/http" "github.com/IBM-Cloud/bluemix-go/rest" "github.com/IBM-Cloud/bluemix-go/session" "github.com/dgrijalva/jwt-go" + + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/managementv2" ) // UserConfig ... @@ -137,3 +142,50 @@ func GetNextIAM(next interface{}) string { q := u.Query() return q.Get("pagetoken") } + +func GetResourceGroupID(apiKey, name, region string) (string, error) { + bmxConfig := &bluemix.Config{ + BluemixAPIKey: apiKey, + Region: region, + } + + sess, err := session.New(bmxConfig) + if err != nil { + return "", err + } + + err = authenticateAPIKey(sess) + if err != nil { + return "", err + } + + generation := envFallBack([]string{"Generation"}, "2") + gen, err := strconv.Atoi(generation) + if err != nil { + return "", err + } + userInfo, err := fetchUserDetails(sess, gen) + if err != nil { + return "", err + } + + accountID := userInfo.userAccount + rsManagementAPI, err := managementv2.New(sess) + if err != nil { + return "", err + } + + rsGroup := rsManagementAPI.ResourceGroup() + resourceGroupQuery := &managementv2.ResourceGroupQuery{ + AccountID: accountID, + } + grp, err := rsGroup.FindByName(resourceGroupQuery, name) + if err != nil { + return "", err + } + if len(grp) > 0 { + return grp[0].ID, nil + } + + return "", fmt.Errorf("Unable to get ID of resource group") +} diff --git a/providers/ibm/vpc_cluster.go b/providers/ibm/vpc_cluster.go index 08ccb9c363..0f04a2d7b2 100644 --- a/providers/ibm/vpc_cluster.go +++ b/providers/ibm/vpc_cluster.go @@ -29,19 +29,19 @@ type VPCClusterGenerator struct { } func (g VPCClusterGenerator) loadcluster(clustersID, clusterName string) terraformutils.Resource { - resources := terraformutils.NewSimpleResource( + resource := terraformutils.NewSimpleResource( clustersID, - clusterName, + normalizeResourceName(clusterName, false), "ibm_container_vpc_cluster", "ibm", []string{}) - return resources + return resource } -func (g VPCClusterGenerator) loadWorkerPools(clustersID, poolID string, dependsOn []string) terraformutils.Resource { - resources := terraformutils.NewResource( +func (g VPCClusterGenerator) loadWorkerPools(clustersID, poolID, poolName string, dependsOn []string) terraformutils.Resource { + resource := terraformutils.NewResource( fmt.Sprintf("%s/%s", clustersID, poolID), - poolID, + normalizeResourceName(poolName, true), "ibm_container_vpc_worker_pool", "ibm", map[string]string{}, @@ -49,7 +49,7 @@ func (g VPCClusterGenerator) loadWorkerPools(clustersID, poolID string, dependsO map[string]interface{}{ "depends_on": dependsOn, }) - return resources + return resource } func (g *VPCClusterGenerator) InitResources() error { @@ -72,6 +72,7 @@ func (g *VPCClusterGenerator) InitResources() error { for _, cs := range clusters { g.Resources = append(g.Resources, g.loadcluster(cs.ID, cs.Name)) + resourceName := g.Resources[len(g.Resources)-1:][0].ResourceName workerPools, err := client.WorkerPools().ListWorkerPools(cs.ID, containerv2.ClusterTargetHeader{}) if err != nil { return err @@ -81,8 +82,8 @@ func (g *VPCClusterGenerator) InitResources() error { if pool.PoolName != "default" { var dependsOn []string dependsOn = append(dependsOn, - "ibm_container_vpc_cluster."+terraformutils.TfSanitize(cs.Name)) - g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, dependsOn)) + "ibm_container_vpc_cluster."+resourceName) + g.Resources = append(g.Resources, g.loadWorkerPools(cs.ID, pool.ID, pool.PoolName, dependsOn)) } } From 096688b082130c46d957c553364b2be42e30a360 Mon Sep 17 00:00:00 2001 From: Samuel Barabas Date: Mon, 18 Oct 2021 09:52:33 +0200 Subject: [PATCH 250/276] Vault Readme was accidentally naming Datadog (#1088) --- docs/vault.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/vault.md b/docs/vault.md index 6568849ace..84c4c33dfe 100644 --- a/docs/vault.md +++ b/docs/vault.md @@ -7,7 +7,7 @@ Example: ./terraformer import vault --resources=policy --filter=policy=id1:id2:id4 --token=YOUR_VAULT_TOKEN // or VAULT_TOKEN in env --address=YOUR_VAULT_ADDRESS // or VAULT_ADDR in env ``` -List of supported Datadog services: +List of supported Vault resources: * `ad_secret_backend` * `ad_secret_backend` @@ -84,4 +84,4 @@ List of supported Datadog services: * `token_auth_backend_role` * `token_auth_backend_role` -[1]: https://github.com/GoogleCloudPlatform/terraformer/blob/master/README.md#filtering \ No newline at end of file +[1]: https://github.com/GoogleCloudPlatform/terraformer/blob/master/README.md#filtering From 6bf7e73eb6dbe66045c0f1a0b154d771f46a573b Mon Sep 17 00:00:00 2001 From: Florian Veaux Date: Thu, 21 Oct 2021 11:01:50 +0200 Subject: [PATCH 251/276] Bump datadog-api-client to 1.4.0 (#1090) * Bump datadog-api-version to 1.4.0 * Fix up go.sum --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 69cd98f931..8ac958f8fa 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Azure/azure-storage-blob-go v0.10.0 github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Azure/go-autorest/autorest v0.11.20 - github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 + github.com/DataDog/datadog-api-client-go v1.4.0 github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 github.com/IBM/go-sdk-core/v3 v3.3.1 github.com/IBM/go-sdk-core/v4 v4.9.0 @@ -304,7 +304,7 @@ require ( golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/mod v0.4.1 // indirect golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect - golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect diff --git a/go.sum b/go.sum index 9ae7676240..6bef42e918 100644 --- a/go.sum +++ b/go.sum @@ -96,6 +96,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 h1:VwdZv6Mm4d7Jx9qawTNM6FlShdlE1d/J+64X3Izd574= github.com/DataDog/datadog-api-client-go v1.0.0-beta.20/go.mod h1:T4YUFSUXoBbhxY5qq5V/1llk5U1o6vTjYFS3dk3uH74= +github.com/DataDog/datadog-api-client-go v1.4.0 h1:EpiKfVg8aUdZB8ovvqIqiVC8Ox4kpcemNIIJ/5TZsXo= +github.com/DataDog/datadog-api-client-go v1.4.0/go.mod h1:QzaQF1cDO1/BIQG1fz14VrY+6RECUGkiwzDCtVbfP5c= github.com/DataDog/datadog-go v4.4.0+incompatible h1:R7WqXWP4fIOAqWJtUKmSfuc7eDsBT58k9AY5WSHVosk= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= @@ -1406,6 +1408,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From a5082c5e461c5b236db884e759e6d8b5356ec5bd Mon Sep 17 00:00:00 2001 From: davidferdinand Date: Thu, 21 Oct 2021 15:34:37 +0100 Subject: [PATCH 252/276] Pd-RuleSet-Rules (#1097) * update packed and fix rules * go mod tidy --- go.mod | 10 +++++++--- go.sum | 14 ++++++++++---- providers/pagerduty/ruleset.go | 11 ++++++++--- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 8ac958f8fa..41d6d3c2e7 100644 --- a/go.mod +++ b/go.mod @@ -127,7 +127,7 @@ require ( github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/terraform v0.12.31 github.com/hashicorp/vault v0.10.4 - github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 + github.com/heimweh/go-pagerduty v0.0.0-20210930203304-530eff2acdc6 github.com/heroku/heroku-go/v5 v5.1.0 github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 @@ -236,7 +236,7 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/go-cmp v0.5.6 // indirect - github.com/google/go-querystring v1.0.0 // indirect + github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/jsonapi v0.0.0-20201022225600-f822737867f6 // indirect github.com/google/uuid v1.2.0 // indirect @@ -298,7 +298,11 @@ require ( github.com/ulikunitz/xz v0.5.8 // indirect github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect - go.mongodb.org/mongo-driver v1.5.1 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.0.2 // indirect + github.com/xdg-go/stringprep v1.0.2 // indirect + github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + go.mongodb.org/mongo-driver v1.7.2 // indirect go.opencensus.io v0.22.5 // indirect golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect diff --git a/go.sum b/go.sum index 6bef42e918..543e91b871 100644 --- a/go.sum +++ b/go.sum @@ -661,8 +661,9 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-github/v35 v35.1.0 h1:KkwZnKWQ/0YryvXjZlCN/3EGRJNp6VCZPKo+RG9mG28= github.com/google/go-github/v35 v35.1.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs= github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -821,8 +822,8 @@ github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bA github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4 h1:uyHgKwTluKHt2ctmyZfdVxECwSqYflYDo+RwyZZEdR0= -github.com/heimweh/go-pagerduty v0.0.0-20210412205347-cc0e5d3c14d4/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY= +github.com/heimweh/go-pagerduty v0.0.0-20210930203304-530eff2acdc6 h1:/D0VtHEOCdotE1vSB9XznceAjIGkUieZ4BF6VKUIqNU= +github.com/heimweh/go-pagerduty v0.0.0-20210930203304-530eff2acdc6/go.mod h1:JtJGtgN0y9KOCaqFMZFaBCWskpO/KK3Ro9TwjP9ss6w= github.com/heroku/heroku-go/v5 v5.1.0 h1:3Qx1MxjzczSakhAZN4yRsvCI7kP0ldijK1XvfoYa4DE= github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZOdlm26Sr73U= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= @@ -1212,8 +1213,11 @@ github.com/xanzy/go-gitlab v0.50.2 h1:Qm/um2Jryuqusc6VmN7iZYVTQVzNynzSiuMJDnCU1w github.com/xanzy/go-gitlab v0.50.2/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= @@ -1225,6 +1229,7 @@ github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77 h1:ujojfQ github.com/yandex-cloud/go-genproto v0.0.0-20200722140432-762fe965ce77/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13 h1:llDpCOEwliajLr8eXtLPIVW0hzat4ETTakiCI+z/c6k= github.com/yandex-cloud/go-sdk v0.0.0-20200722140627-2194e5077f13/go.mod h1:LEdAMqa1v/7KYe4b13ALLkonuDxLph57ibUb50ctvJk= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1247,8 +1252,9 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= +go.mongodb.org/mongo-driver v1.7.2 h1:pFttQyIiJUHEn50YfZgC9ECjITMT44oiN36uArf/OFg= +go.mongodb.org/mongo-driver v1.7.2/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= diff --git a/providers/pagerduty/ruleset.go b/providers/pagerduty/ruleset.go index 4be5db4cf3..3ba119f532 100644 --- a/providers/pagerduty/ruleset.go +++ b/providers/pagerduty/ruleset.go @@ -43,7 +43,7 @@ func (g *RulesetGenerator) createRulesetResources(client *pagerduty.Client) erro } // golangci-lint says this function isn't used anywhere. Do we need it? Commenting it out to make the linter happy -/* + func (g *RulesetGenerator) createRulesetRuleResources(client *pagerduty.Client) error { resp, _, err := client.Rulesets.List() if err != nil { @@ -57,19 +57,23 @@ func (g *RulesetGenerator) createRulesetRuleResources(client *pagerduty.Client) } for _, rule := range rules.Rules { - g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + g.Resources = append(g.Resources, terraformutils.NewResource( rule.ID, rule.ID, "pagerduty_ruleset_rule", g.ProviderName, + map[string]string{ + "ruleset": ruleset.ID, + }, []string{}, + map[string]interface{}{}, )) } } return nil } -*/ + func (g *RulesetGenerator) InitResources() error { client, err := g.Client() if err != nil { @@ -78,6 +82,7 @@ func (g *RulesetGenerator) InitResources() error { funcs := []func(*pagerduty.Client) error{ g.createRulesetResources, + g.createRulesetRuleResources, } for _, f := range funcs { From 237a30d822da979cf7b8fcf1dc4df86925729eb6 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Thu, 21 Oct 2021 17:34:57 +0300 Subject: [PATCH 253/276] Update version.go (#1098) --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index a51f7df18b..93ac2c4742 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.8.17" +const version = "v0.8.18" var versionCmd = &cobra.Command{ Use: "version", From 3282170306d0c67be6635bd925d4460aa65ff543 Mon Sep 17 00:00:00 2001 From: mc-digit <49979597+mc-digit@users.noreply.github.com> Date: Sat, 23 Oct 2021 21:35:10 +0200 Subject: [PATCH 254/276] =?UTF-8?q?Fix=20for=20Palo=20Alto=20network=20pan?= =?UTF-8?q?os=5Fipsec=5Ftunnel=5Fproxy=5Fid=5Fipv4=20resource=20#=E2=80=A6?= =?UTF-8?q?=20(#1099)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 - fixed indent --- providers/panos/firewall_networking.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go index dda1edff7e..66ac6a49b0 100644 --- a/providers/panos/firewall_networking.go +++ b/providers/panos/firewall_networking.go @@ -706,7 +706,7 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { } if r.InstanceInfo.Type == "panos_ipsec_tunnel_proxy_id_ipv4" { - r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + r.Item["ipsec_tunnel"] = "${panos_ipsec_tunnel." + normalizeResourceName(r.Item["panos_ipsec_tunnel"].(string)) + ".name}" } if r.InstanceInfo.Type == "panos_layer2_subinterface" { From f2e5cde78efc8d08fb5806d4f453f5d585d84c0a Mon Sep 17 00:00:00 2001 From: Sunil Date: Sun, 24 Oct 2021 20:37:46 +0530 Subject: [PATCH 255/276] Adding Application Gateway Support for Azure (#1102) * Adding Application Gateway Support * Fixed Indentation issue * fixed File is not -ed with (gofmt) issue --- providers/azure/application_gateway.go | 70 ++++++++++++++++++++++++++ providers/azure/azure_provider.go | 4 ++ 2 files changed, 74 insertions(+) create mode 100644 providers/azure/application_gateway.go diff --git a/providers/azure/application_gateway.go b/providers/azure/application_gateway.go new file mode 100644 index 0000000000..7172146e52 --- /dev/null +++ b/providers/azure/application_gateway.go @@ -0,0 +1,70 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package azure + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/go-autorest/autorest" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/hashicorp/go-azure-helpers/authentication" +) + +type ApplicationGatewayGenerator struct { + AzureService +} + +func (g ApplicationGatewayGenerator) createResources(ctx context.Context, iterator network.ApplicationGatewayListResultIterator) ([]terraformutils.Resource, error) { + var resources []terraformutils.Resource + for iterator.NotDone() { + applicationGateways := iterator.Value() + resources = append(resources, terraformutils.NewSimpleResource( + *applicationGateways.ID, + *applicationGateways.Name, + "azurerm_application_gateway", + g.ProviderName, + []string{})) + if err := iterator.NextWithContext(ctx); err != nil { + log.Println(err) + return resources, err + } + } + return resources, nil +} + +func (g *ApplicationGatewayGenerator) InitResources() error { + ctx := context.Background() + applicationGatewaysClient := network.NewApplicationGatewaysClient(g.Args["config"].(authentication.Config).SubscriptionID) + + applicationGatewaysClient.Authorizer = g.Args["authorizer"].(autorest.Authorizer) + + var ( + output network.ApplicationGatewayListResultIterator + err error + ) + + if rg := g.Args["resource_group"].(string); rg != "" { + output, err = applicationGatewaysClient.ListComplete(ctx, rg) + } else { + output, err = applicationGatewaysClient.ListAllComplete(ctx) + } + if err != nil { + return err + } + g.Resources, err = g.createResources(ctx, output) + return err +} diff --git a/providers/azure/azure_provider.go b/providers/azure/azure_provider.go index d77282d047..842a156af4 100644 --- a/providers/azure/azure_provider.go +++ b/providers/azure/azure_provider.go @@ -149,6 +149,9 @@ func (AzureProvider) GetResourceConnections() map[string]map[string][]string { "app_service": { "resource_group": []string{"resource_group_name", "name"}, }, + "application_gateway": { + "resource_group": []string{"resource_group_name", "name"}, + }, "cosmosdb": { "resource_group": []string{ "resource_group_name", "name", @@ -327,6 +330,7 @@ func (p *AzureProvider) GetSupportedService() map[string]terraformutils.ServiceG return map[string]terraformutils.ServiceGenerator{ "analysis": &AnalysisGenerator{}, "app_service": &AppServiceGenerator{}, + "application_gateway": &ApplicationGatewayGenerator{}, "cosmosdb": &CosmosDBGenerator{}, "container": &ContainerGenerator{}, "database": &DatabasesGenerator{}, From 8851ad9717db1a4bfa400fc00b029f33f37843fe Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 24 Oct 2021 19:23:01 +0300 Subject: [PATCH 256/276] make output of aws_lb_target_group_attachment reproducible (#1103) Currently, a time-based and non-reproducible ID is being added, which may be unnecessary if we include *tgh.Target.Id to the format of resource ID --- providers/aws/alb.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/providers/aws/alb.go b/providers/aws/alb.go index 50c295b8dd..89940f4b1b 100644 --- a/providers/aws/alb.go +++ b/providers/aws/alb.go @@ -23,7 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" - "github.com/hashicorp/terraform/helper/resource" ) var AlbAllowEmptyValues = []string{"tags.", "^condition."} @@ -178,7 +177,7 @@ func (g *AlbGenerator) loadTargetGroupTargets(svc *elasticloadbalancingv2.Client return err } for _, tgh := range targetHealths.TargetHealthDescriptions { - id := resource.PrefixedUniqueId(fmt.Sprintf("%s-", *targetGroupArn)) + id := fmt.Sprintf("%s-%s", *targetGroupArn, *tgh.Target.Id) g.Resources = append(g.Resources, terraformutils.NewResource( id, id, From 7d8b436a6e3246b5c6f0bbf2ecc8e615e42bdef3 Mon Sep 17 00:00:00 2001 From: Sunil Date: Sun, 24 Oct 2021 23:47:21 +0530 Subject: [PATCH 257/276] Update azure.md (#1104) Added recently introduced application_gateway resource details in azure readme file --- docs/azure.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/azure.md b/docs/azure.md index 8218f65617..c9e2c38b74 100644 --- a/docs/azure.md +++ b/docs/azure.md @@ -31,6 +31,8 @@ export ARM_TENANT_ID=[TENANT_ID] * `azurerm_analysis_services_server` * `app_service` * `azurerm_app_service` +* `application_gateway` + * `azurerm_application_gateway` * `container` * `azurerm_container_group` * `azurerm_container_registry` From 438a23ce8aa1e6b4942c4456a5e82e2c319d0b01 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 25 Oct 2021 00:24:39 +0300 Subject: [PATCH 258/276] make HCL output reproducible by sorting the AST nodes (#1101) * make HCL output reproducible by sorting the AST nodes * gofmt, buffer conv. fix * rename vars --- terraformutils/hcl.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/terraformutils/hcl.go b/terraformutils/hcl.go index ca970332b7..51dfd67744 100644 --- a/terraformutils/hcl.go +++ b/terraformutils/hcl.go @@ -21,6 +21,7 @@ import ( "fmt" "log" "regexp" + "sort" "strings" "github.com/hashicorp/hcl/hcl/ast" @@ -34,6 +35,25 @@ const safeChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678 var unsafeChars = regexp.MustCompile(`[^0-9A-Za-z_\-]`) +// make HCL output reproducible by sorting the AST nodes +func sortHclTree(tree interface{}) { + switch t := tree.(type) { + case []*ast.ObjectItem: + sort.Slice(t, func(i, j int) bool { + var bI, bJ bytes.Buffer + _, _ = hclPrinter.Fprint(&bI, t[i]), hclPrinter.Fprint(&bJ, t[j]) + return bI.String() < bJ.String() + }) + case []ast.Node: + sort.Slice(t, func(i, j int) bool { + var bI, bJ bytes.Buffer + _, _ = hclPrinter.Fprint(&bI, t[i]), hclPrinter.Fprint(&bJ, t[j]) + return bI.String() < bJ.String() + }) + default: + } +} + // sanitizer fixes up an invalid HCL AST, as produced by the HCL parser for JSON type astSanitizer struct{} @@ -44,6 +64,7 @@ func (v *astSanitizer) visit(n interface{}) { v.visit(t.Node) case *ast.ObjectList: var index int + sortHclTree(t.Items) for { if index == len(t.Items) { break @@ -56,7 +77,9 @@ func (v *astSanitizer) visit(n interface{}) { v.visitObjectItem(t) case *ast.LiteralType: case *ast.ListType: + sortHclTree(t.List) case *ast.ObjectType: + sortHclTree(t.List) v.visit(t.List) default: fmt.Printf(" unknown type: %T\n", n) @@ -115,6 +138,8 @@ func (v *astSanitizer) visitObjectItem(o *ast.ObjectItem) { } } } + case *ast.ListType: + sortHclTree(t.List) default: } From 2a7e6454f86fdd0441a9f604a94fd4433754816a Mon Sep 17 00:00:00 2001 From: mc-digit <49979597+mc-digit@users.noreply.github.com> Date: Wed, 27 Oct 2021 06:52:37 +0200 Subject: [PATCH 259/276] Palo networking fix (#1111) * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 - fixed indent * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 - another fixes --- providers/panos/firewall_networking.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go index 66ac6a49b0..4d5ea66a34 100644 --- a/providers/panos/firewall_networking.go +++ b/providers/panos/firewall_networking.go @@ -706,7 +706,7 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { } if r.InstanceInfo.Type == "panos_ipsec_tunnel_proxy_id_ipv4" { - r.Item["ipsec_tunnel"] = "${panos_ipsec_tunnel." + normalizeResourceName(r.Item["panos_ipsec_tunnel"].(string)) + ".name}" + r.Item["ipsec_tunnel"] = mapInterfaceNames[r.Item["ipsec_tunnel"].(string)] } if r.InstanceInfo.Type == "panos_layer2_subinterface" { From 060a4bfd10eba56792bae8df87a5a7921184dda1 Mon Sep 17 00:00:00 2001 From: rui Date: Wed, 27 Oct 2021 19:18:10 -0400 Subject: [PATCH 260/276] feat(fastly): go-fastly v5 and support tls_subscription (#1115) * deps: go-fastly v3 -> v5 Signed-off-by: Rui Chen * fastly: support tls_subscription Signed-off-by: Rui Chen * update doc --- docs/fastly.md | 2 ++ go.mod | 5 ++- go.sum | 39 +++------------------ providers/fastly/fastly_provider.go | 5 +-- providers/fastly/service_v1.go | 2 +- providers/fastly/tls_subscription.go | 52 ++++++++++++++++++++++++++++ providers/fastly/user.go | 2 +- 7 files changed, 65 insertions(+), 42 deletions(-) create mode 100644 providers/fastly/tls_subscription.go diff --git a/docs/fastly.md b/docs/fastly.md index 3be52a788f..8a26316ac8 100644 --- a/docs/fastly.md +++ b/docs/fastly.md @@ -17,3 +17,5 @@ List of supported Fastly resources: * `fastly_service_v1` * `user` * `fastly_user_v1` +* `tls_subscription` + * `fastly_tls_subscription` diff --git a/go.mod b/go.mod index 41d6d3c2e7..4e06340a17 100644 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/duosecurity/duo_api_golang v0.0.0-20201112143038-0e07e9f869e3 // indirect github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect - github.com/fastly/go-fastly/v3 v3.12.0 + github.com/fastly/go-fastly/v5 v5.1.1 github.com/fatih/structs v1.1.0 // indirect github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d // indirect github.com/google/go-github/v35 v35.1.0 @@ -193,6 +193,7 @@ require ( github.com/Masterminds/goutils v1.1.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/sprig v2.22.0+incompatible // indirect + github.com/Microsoft/go-winio v0.5.1 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect @@ -255,7 +256,6 @@ require ( github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl/v2 v2.8.2 // indirect github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 // indirect - github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.12 // indirect @@ -271,7 +271,6 @@ require ( github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d // indirect github.com/mattn/go-isatty v0.0.10 // indirect github.com/mitchellh/cli v1.1.2 // indirect - github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.0.4 // indirect diff --git a/go.sum b/go.sum index 543e91b871..943bd28bde 100644 --- a/go.sum +++ b/go.sum @@ -94,13 +94,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.20 h1:VwdZv6Mm4d7Jx9qawTNM6FlShdlE1d/J+64X3Izd574= -github.com/DataDog/datadog-api-client-go v1.0.0-beta.20/go.mod h1:T4YUFSUXoBbhxY5qq5V/1llk5U1o6vTjYFS3dk3uH74= github.com/DataDog/datadog-api-client-go v1.4.0 h1:EpiKfVg8aUdZB8ovvqIqiVC8Ox4kpcemNIIJ/5TZsXo= github.com/DataDog/datadog-api-client-go v1.4.0/go.mod h1:QzaQF1cDO1/BIQG1fz14VrY+6RECUGkiwzDCtVbfP5c= -github.com/DataDog/datadog-go v4.4.0+incompatible h1:R7WqXWP4fIOAqWJtUKmSfuc7eDsBT58k9AY5WSHVosk= -github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55 h1:sUpBb2/GC8L6UOKDnbEZLRTxQB2RQgMv1mxbnOHOQW4= github.com/IBM-Cloud/bluemix-go v0.0.0-20210203095940-db28d5e07b55/go.mod h1:kqTYO0mts71aa8PVwviaKlCKYud/NbEkFIqU8aHH3/g= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62 h1:MOkcr6qQGk4tY542ZJ1DggVh2WUP72EEyLB79llFVH8= @@ -134,8 +129,9 @@ github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= +github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= @@ -206,7 +202,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aslakhellesoy/gox v1.0.100/go.mod h1:AJl542QsKKG96COVsv0N74HHzVQgDIQPceVUh1aeU2M= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= @@ -442,10 +437,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/crewjam/httperr v0.0.0-20190612203328-a946449404da/go.mod h1:+rmNIXRvYMqLQeR4DHyTvs6y0MEMymTz4vyFpFkKTPs= github.com/crewjam/saml v0.4.5 h1:H9u+6CZAESUKHxMyxUbVn0IawYvKZn4nt3d4ccV4O/M= github.com/crewjam/saml v0.4.5/go.mod h1:qCJQpUtZte9R1ZjUBcW8qtCNlinbO363ooNl02S68bk= -github.com/cucumber/gherkin-go/v13 v13.0.0 h1:d09AwPZldyOFlCADAIZQMt7T+VHCrGdp5106+BCIfZU= -github.com/cucumber/gherkin-go/v13 v13.0.0/go.mod h1:pzMEPEIPcPOBDkE8HaWC+Ck6eDBtBmIWVksUkSin/2E= -github.com/cucumber/messages-go/v12 v12.0.0 h1:ZlZYZrYDDc35zCe0HK2y95GUcxHHqr8yB9kdrXCjnzU= -github.com/cucumber/messages-go/v12 v12.0.0/go.mod h1:5zuJu21U6rB+BBqyGoQr839a4h4GUElPnSozdHyhCOQ= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/dave/jennifer v1.4.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -496,8 +487,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y 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/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fastly/go-fastly/v3 v3.12.0 h1:rF+SF34yYcX2eig7aOXiDKdT/ipdfnxKHiNfsbnsR4s= -github.com/fastly/go-fastly/v3 v3.12.0/go.mod h1:KOaCWsmkIKSASPzADl8PT/bTQIghOw/eEaxlHOu3jMA= +github.com/fastly/go-fastly/v5 v5.1.1 h1:ch5NYZHU38SCSxx216gCZ83222kgww4pjKZ6//xTJjU= +github.com/fastly/go-fastly/v5 v5.1.1/go.mod h1:Hr7UTc2laOUk+jnocgJFIjpE/jqoxR0Oftt0AIeLSzo= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= @@ -514,9 +505,6 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-bdd/assert v0.0.0-20190820124234-20d47a68475d/go.mod h1:dOoqt7g2I/fpR7/Pyz0P19J3xjDj5lsHn3v9EaFLRjM= -github.com/go-bdd/gobdd v1.1.3 h1:eirGvZ9gMz6clOo2k6O7+Ys3iHAaFZoRQXVwV76B3JI= -github.com/go-bdd/gobdd v1.1.3/go.mod h1:Q3mXpW/Qm9GJCPLxFCTXdTtRBdHzcTfrbeLlaqAPtXM= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= @@ -600,7 +588,6 @@ github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= @@ -685,7 +672,6 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210125172800-10e9aeb4a998/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -778,7 +764,6 @@ github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnO github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= @@ -889,7 +874,6 @@ github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -954,8 +938,6 @@ github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee h1:7Ac2RNGC8DAwDNd5uZyuYLoJOlVXyBGbO1VtFboDamk= -github.com/mcuadros/go-lookup v0.0.0-20200831155250-80f87a4fa5ee/go.mod h1:yd3I5pyIO5TrBH7+Ym94u8qp9xc6NTHAqESeI8kOJY8= github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 h1:YH424zrwLTlyHSH/GzLMJeu5zhYVZSx5RQxGKm1h96s= github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqKSQK1vIfQ+yVaFcGjDySHvym6FM1cNYnwzbrY= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -963,7 +945,6 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -1059,7 +1040,6 @@ github.com/opencontainers/runc v1.0.1 h1:G18PGckGdAm3yVQRWDVQ1rLSLntiniKJ0cNRT2T github.com/opencontainers/runc v1.0.1/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -1076,8 +1056,6 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1183,8 +1161,6 @@ github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DX github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= -github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y= @@ -1412,7 +1388,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1462,7 +1437,6 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1509,7 +1483,6 @@ golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1693,8 +1666,6 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/DataDog/dd-trace-go.v1 v1.30.0-rc.1.0.20210420124628-f63633f38e8f h1:LmMng8lsMr7BkXin76L6+LsUFr1GSnmySvO5LaR6rhc= -gopkg.in/DataDog/dd-trace-go.v1 v1.30.0-rc.1.0.20210420124628-f63633f38e8f/go.mod h1:I3nUNop4UZaHSj2C2OBCHezmsQIHczbUps8nHgw/HXs= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1740,8 +1711,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/providers/fastly/fastly_provider.go b/providers/fastly/fastly_provider.go index 7963f3d806..acbbd475a6 100644 --- a/providers/fastly/fastly_provider.go +++ b/providers/fastly/fastly_provider.go @@ -61,8 +61,9 @@ func (FastlyProvider) GetResourceConnections() map[string]map[string][]string { func (p *FastlyProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { return map[string]terraformutils.ServiceGenerator{ - "service_v1": &ServiceV1Generator{}, - "user": &UserGenerator{}, + "service_v1": &ServiceV1Generator{}, + "tls_subscription": &TLSSubscriptionGenerator{}, + "user": &UserGenerator{}, } } diff --git a/providers/fastly/service_v1.go b/providers/fastly/service_v1.go index 25906bd9ac..0e803da061 100644 --- a/providers/fastly/service_v1.go +++ b/providers/fastly/service_v1.go @@ -16,7 +16,7 @@ package fastly import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/fastly/go-fastly/v3/fastly" + "github.com/fastly/go-fastly/v5/fastly" ) type ServiceV1Generator struct { diff --git a/providers/fastly/tls_subscription.go b/providers/fastly/tls_subscription.go new file mode 100644 index 0000000000..4a469ac4dd --- /dev/null +++ b/providers/fastly/tls_subscription.go @@ -0,0 +1,52 @@ +// Copyright 2019 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package fastly + +import ( + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/fastly/go-fastly/v5/fastly" +) + +type TLSSubscriptionGenerator struct { + FastlyService +} + +func (g *TLSSubscriptionGenerator) loadSubscriptions(client *fastly.Client) ([]*fastly.TLSSubscription, error) { + subscriptions, err := client.ListTLSSubscriptions(&fastly.ListTLSSubscriptionsInput{}) + if err != nil { + return nil, err + } + for _, subscription := range subscriptions { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + subscription.ID, + subscription.ID, + "fastly_tls_subscription", + "fastly", + []string{})) + } + return subscriptions, nil +} + +func (g *TLSSubscriptionGenerator) InitResources() error { + client, err := fastly.NewClient(g.Args["api_key"].(string)) + if err != nil { + return err + } + if _, err := g.loadSubscriptions(client); err != nil { + return err + } + + return nil +} diff --git a/providers/fastly/user.go b/providers/fastly/user.go index 3fc225c7fa..b2b7350262 100644 --- a/providers/fastly/user.go +++ b/providers/fastly/user.go @@ -16,7 +16,7 @@ package fastly import ( "github.com/GoogleCloudPlatform/terraformer/terraformutils" - "github.com/fastly/go-fastly/v3/fastly" + "github.com/fastly/go-fastly/v5/fastly" ) type UserGenerator struct { From 6ebab3c075845b0e861ab49a1081ea81178954e5 Mon Sep 17 00:00:00 2001 From: rui Date: Fri, 29 Oct 2021 03:27:53 -0400 Subject: [PATCH 261/276] fastly: support `fastly_service_compute` (#1117) --- docs/fastly.md | 1 + providers/fastly/service_v1.go | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/fastly.md b/docs/fastly.md index 8a26316ac8..d18bfb0a9a 100644 --- a/docs/fastly.md +++ b/docs/fastly.md @@ -12,6 +12,7 @@ List of supported Fastly resources: * `service_v1` * `fastly_service_acl_entries_v1` + * `fastly_service_compute` * `fastly_service_dictionary_items_v1` * `fastly_service_dynamic_snippet_content_v1` * `fastly_service_v1` diff --git a/providers/fastly/service_v1.go b/providers/fastly/service_v1.go index 0e803da061..ab96b33a1a 100644 --- a/providers/fastly/service_v1.go +++ b/providers/fastly/service_v1.go @@ -19,6 +19,13 @@ import ( "github.com/fastly/go-fastly/v5/fastly" ) +const ( + // ServiceTypeVCL is the type for VCL services. + ServiceTypeVCL = "vcl" + // ServiceTypeWasm is the type for Wasm services. + ServiceTypeWasm = "wasm" +) + type ServiceV1Generator struct { FastlyService } @@ -29,12 +36,21 @@ func (g *ServiceV1Generator) loadServices(client *fastly.Client) ([]*fastly.Serv return nil, err } for _, service := range services { - g.Resources = append(g.Resources, terraformutils.NewSimpleResource( - service.ID, - service.ID, - "fastly_service_v1", - "fastly", - []string{})) + if service.Type == ServiceTypeVCL { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + service.ID, + service.ID, + "fastly_service_v1", + "fastly", + []string{})) + } else if service.Type == ServiceTypeWasm { + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + service.ID, + service.ID, + "fastly_service_compute", + "fastly", + []string{})) + } } return services, nil } From c18e9ef70a63a9e980c41979aa7041ba5cb3ca75 Mon Sep 17 00:00:00 2001 From: Paul O'Connor <465717+pauloconnor@users.noreply.github.com> Date: Fri, 29 Oct 2021 19:13:49 +0100 Subject: [PATCH 262/276] aws: import rds clusters (#1118) --- docs/aws.md | 1 + go.mod | 6 ++-- go.sum | 8 +++++ providers/aws/rds.go | 72 ++++++++++++++++++++++++++++++-------------- 4 files changed, 60 insertions(+), 27 deletions(-) diff --git a/docs/aws.md b/docs/aws.md index 68236e1165..c8faccd9b4 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -220,6 +220,7 @@ In that case terraformer will not know with which region resources are associate * `aws_qldb_ledger` * `rds` * `aws_db_instance` + * `aws_db_cluster` * `aws_db_parameter_group` * `aws_db_subnet_group` * `aws_db_option_group` diff --git a/go.mod b/go.mod index 4e06340a17..dd9efea3fa 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go-v2 v1.9.0 + github.com/aws/aws-sdk-go-v2 v1.10.0 github.com/aws/aws-sdk-go-v2/config v1.1.4 github.com/aws/aws-sdk-go-v2/credentials v1.1.4 github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 @@ -81,7 +81,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/opsworks v1.2.2 github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 - github.com/aws/aws-sdk-go-v2/service/rds v1.2.1 + github.com/aws/aws-sdk-go-v2/service/rds v1.10.0 github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1 github.com/aws/aws-sdk-go-v2/service/route53 v1.3.0 github.com/aws/aws-sdk-go-v2/service/s3 v1.4.0 @@ -205,10 +205,8 @@ require ( github.com/aws/aws-sdk-go v1.37.0 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 // indirect - github.com/aws/smithy-go v1.8.0 // indirect github.com/beevik/etree v1.1.0 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect diff --git a/go.sum b/go.sum index 943bd28bde..ce1a9df232 100644 --- a/go.sum +++ b/go.sum @@ -214,6 +214,8 @@ github.com/aws/aws-sdk-go-v2 v1.3.2/go.mod h1:7OaACgj2SX3XGWnrIjGlJM22h6yD6MEWKv github.com/aws/aws-sdk-go-v2 v1.4.0/go.mod h1:tI4KhsR5VkzlUa2DZAdwx7wCAYGwkZZ1H31PYrBFx1w= github.com/aws/aws-sdk-go-v2 v1.9.0 h1:+S+dSqQCN3MSU5vJRu1HqHrq00cJn6heIMU7X9hcsoo= github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2 v1.10.0 h1:+dCJ5W2HiZNa4UtaIc5ljKNulm0dK0vS5dxb5LdDOAA= +github.com/aws/aws-sdk-go-v2 v1.10.0/go.mod h1:U/EyyVvKtzmFeQQcca7eBotKdlpcP2zzU6bXBYcf7CE= github.com/aws/aws-sdk-go-v2/config v1.1.4 h1:2hjdDldmJJjb+rFieQySfOFt4WwxKZJVTEB6RBI74T4= github.com/aws/aws-sdk-go-v2/config v1.1.4/go.mod h1:op05ummoVoAqctpA80jVt/+hvEtLfuKmDyx0bIuvfbE= github.com/aws/aws-sdk-go-v2/credentials v1.1.4 h1:whYYw2srG+zUQzUw4LhML83f+xd22Vm7gv0I7aJglc8= @@ -309,6 +311,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3/go.mod h1:g github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5/go.mod h1:MW0O/RpmVpS6MWKn6W03XEJmqXlG7+d3iaYLzkd2fAc= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 h1:VNJ5NLBteVXEwE2F1zEXVmyIH58mZ6kIQGJoC7C+vkg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0 h1:/T5wKsw/po118HEDvnSE8YU7TESxvZbYM2rnn+Oi7Kk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0/go.mod h1:X5/JuOxPLU/ogICgDTtnpfaQzdQJO0yKDcpoxWLLJ8Y= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 h1:wCzfVBrF1QRQFacZn1ywE/o2p92FzfpDNI2aCpIv+sY= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1/go.mod h1:6A0VfJAnYwhcXzt7KsixOdFlITEH5NFl4QeYxlZ5TtQ= github.com/aws/aws-sdk-go-v2/service/iot v1.2.0 h1:OTrzh5ew69Vd6x1zruCQ7B/dtcxwCQ5ohPJWwfkydKQ= @@ -333,6 +337,8 @@ github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 h1:mQUBlaWu2q7RftA5O8psLn2wQTIJ github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3/go.mod h1:PgBTgxJV+wffbLmlJB/zO0/lD8+mEbUzEK0LvPkbxXM= github.com/aws/aws-sdk-go-v2/service/rds v1.2.1 h1:nh6V70gwG0bE6Ocz34rg5VZvmthKuDSa785CBpvY2g8= github.com/aws/aws-sdk-go-v2/service/rds v1.2.1/go.mod h1:QQ6pD2d3AUbZblcKzZ5aJ58mMMfcofx2j8KAXcHe8rg= +github.com/aws/aws-sdk-go-v2/service/rds v1.10.0 h1:VgbyR1VctdsZ+EUWW+/EwHip1SdcW4MVcntV8u8NpkI= +github.com/aws/aws-sdk-go-v2/service/rds v1.10.0/go.mod h1:FE9JK93YvpyMx4MKwkQfBsW3BZmAop7xSxKk2ey3unM= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1 h1:36JI8JwGQEH5JcRXdpWucey2jr+mSLZWEvLWZLo73PI= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1/go.mod h1:fS4Gj1TYWWpQB0qHsijLygpI6zUFkEwoHSf8ajXFTqQ= github.com/aws/aws-sdk-go-v2/service/route53 v1.3.0 h1:uwKwx0iSdZyIwQmsMPtAoBjlRC1lFUAhx2c6HGWjfPM= @@ -375,6 +381,8 @@ github.com/aws/smithy-go v1.3.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAm github.com/aws/smithy-go v1.4.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.8.1 h1:9Y6qxtzgEODaLNGN+oN2QvcHvKUe4jsH8w4M+8LXzGk= +github.com/aws/smithy-go v1.8.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= diff --git a/providers/aws/rds.go b/providers/aws/rds.go index b97fa90794..e60168c46e 100644 --- a/providers/aws/rds.go +++ b/providers/aws/rds.go @@ -29,6 +29,27 @@ type RDSGenerator struct { AWSService } +func (g *RDSGenerator) loadDBClusters(svc *rds.Client) error { + p := rds.NewDescribeDBClustersPaginator(svc, &rds.DescribeDBClustersInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, cluster := range page.DBClusters { + resourceName := StringValue(cluster.DBClusterIdentifier) + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + resourceName, + resourceName, + "aws_rds_cluster", + "aws", + RDSAllowEmptyValues, + )) + } + } + return nil +} + func (g *RDSGenerator) loadDBInstances(svc *rds.Client) error { p := rds.NewDescribeDBInstancesPaginator(svc, &rds.DescribeDBInstancesInput{}) for p.HasMorePages() { @@ -151,6 +172,9 @@ func (g *RDSGenerator) InitResources() error { } svc := rds.NewFromConfig(config) + if err := g.loadDBClusters(svc); err != nil { + return err + } if err := g.loadDBInstances(svc); err != nil { return err } @@ -173,34 +197,36 @@ func (g *RDSGenerator) InitResources() error { func (g *RDSGenerator) PostConvertHook() error { for i, r := range g.Resources { - if r.InstanceInfo.Type != "aws_db_instance" { - continue - } - for _, parameterGroup := range g.Resources { - if parameterGroup.InstanceInfo.Type != "aws_db_parameter_group" { - continue + if (r.InstanceInfo.Type == "aws_db_instance" || r.InstanceInfo.Type == "aws_rds_cluster") { + + for _, parameterGroup := range g.Resources { + if parameterGroup.InstanceInfo.Type != "aws_db_parameter_group" { + continue + } + if parameterGroup.InstanceState.Attributes["name"] == r.InstanceState.Attributes["parameter_group_name"] { + g.Resources[i].Item["parameter_group_name"] = "${aws_db_parameter_group." + parameterGroup.ResourceName + ".name}" + } } - if parameterGroup.InstanceState.Attributes["name"] == r.InstanceState.Attributes["parameter_group_name"] { - g.Resources[i].Item["parameter_group_name"] = "${aws_db_parameter_group." + parameterGroup.ResourceName + ".name}" - } - } - for _, subnet := range g.Resources { - if subnet.InstanceInfo.Type != "aws_db_subnet_group" { - continue - } - if subnet.InstanceState.Attributes["name"] == r.InstanceState.Attributes["db_subnet_group_name"] { - g.Resources[i].Item["db_subnet_group_name"] = "${aws_db_subnet_group." + subnet.ResourceName + ".name}" + for _, subnet := range g.Resources { + if subnet.InstanceInfo.Type != "aws_db_subnet_group" { + continue + } + if subnet.InstanceState.Attributes["name"] == r.InstanceState.Attributes["db_subnet_group_name"] { + g.Resources[i].Item["db_subnet_group_name"] = "${aws_db_subnet_group." + subnet.ResourceName + ".name}" + } } - } - for _, optionGroup := range g.Resources { - if optionGroup.InstanceInfo.Type != "aws_db_option_group" { - continue - } - if optionGroup.InstanceState.Attributes["name"] == r.InstanceState.Attributes["option_group_name"] { - g.Resources[i].Item["option_group_name"] = "${aws_db_option_group." + optionGroup.ResourceName + ".name}" + for _, optionGroup := range g.Resources { + if optionGroup.InstanceInfo.Type != "aws_db_option_group" { + continue + } + if optionGroup.InstanceState.Attributes["name"] == r.InstanceState.Attributes["option_group_name"] { + g.Resources[i].Item["option_group_name"] = "${aws_db_option_group." + optionGroup.ResourceName + ".name}" + } } + } else { + continue } } return nil From 6afd207ba5bf24acab45a7145be1281bcba2f188 Mon Sep 17 00:00:00 2001 From: mc-digit <49979597+mc-digit@users.noreply.github.com> Date: Sat, 30 Oct 2021 20:04:24 +0200 Subject: [PATCH 263/276] Another try to fix palo alto issue #1085 ;) (#1114) * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 - fixed indent * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 - another fixes * Fix for Palo Alto network panos_ipsec_tunnel_proxy_id_ipv4 resource #issue: #1085 - another try --- providers/panos/firewall_networking.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go index 4d5ea66a34..c5bc5202c0 100644 --- a/providers/panos/firewall_networking.go +++ b/providers/panos/firewall_networking.go @@ -706,7 +706,9 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { } if r.InstanceInfo.Type == "panos_ipsec_tunnel_proxy_id_ipv4" { - r.Item["ipsec_tunnel"] = mapInterfaceNames[r.Item["ipsec_tunnel"].(string)] + if _, ok := mapInterfaceNames[r.Item["ipsec_tunnel"].(string)]; ok { + r.Item["ipsec_tunnel"] = mapInterfaceNames[r.Item["ipsec_tunnel"].(string)] + } } if r.InstanceInfo.Type == "panos_layer2_subinterface" { From 93a7ce09bd0d392002405187de7a43651e352c3a Mon Sep 17 00:00:00 2001 From: Sunil Date: Mon, 8 Nov 2021 20:55:19 +0530 Subject: [PATCH 264/276] Added more examples to import ec2 instances based on Instance Id and Name (#1121) * Update aws.md Added few more examples to import ec2 instance based on name and id * Update aws.md Added more examples- how to import ec2 instance based on instance name and id? * Update aws.md * Update aws.md * Update test.yml To Fix Go updates issue --- .github/workflows/test.yml | 2 ++ docs/aws.md | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6fa5a0298f..575784e093 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,5 +20,7 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.17 + - name: Go Mod Tidy + run: go mod tidy - name: Test run: go build -v && go test ./... diff --git a/docs/aws.md b/docs/aws.md index c8faccd9b4..9be8f03782 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -338,6 +338,16 @@ terraformer import aws --resources=ec2_instance,ebs --filter=Type=ec2_instance;N ``` Will work as same as example above with a change the filter will be applicable only to `ec2_instance` resources. +Few more examples - How to import ec2 instance based on instance name and id +``` +terraformer import aws --resources=ec2_instance --filter="Name=tags.Name;Value=Terraformer" --regions=us-east-1 +``` +This command imports ec2 instance having name as Terraformer. +``` +terraformer import aws --resources=ec2_instance --filter="Name=id;Value=i-0xxxxxxxxx" --regions=us-east-1 +``` +This command imports ec2 instance having insatnce-id as i-0xxxxxxxxx. + Due to fact API Gateway generates a lot of resources, it's possible to issue a filtering query to retrieve resources related to a given REST API by tags. To fetch resources related to a REST API resource with a tag `STAGE` and value `dev`, add parameter `--filter="Type=api_gateway_rest_api;Name=tags.STAGE;Value=dev"`. #### SQS queues retrieval From 2b552b8ae62eca6480405b27986211ef66bf9b1e Mon Sep 17 00:00:00 2001 From: rui Date: Tue, 9 Nov 2021 00:41:40 -0500 Subject: [PATCH 265/276] fastly: support fastly_tls_activation (#1132) * go-fastly 5.1.2 * fastly: support fastly_tls_activation --- go.mod | 5 +++-- go.sum | 11 ++-------- providers/fastly/tls_subscription.go | 30 ++++++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index dd9efea3fa..782312d60e 100644 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884 github.com/duosecurity/duo_api_golang v0.0.0-20201112143038-0e07e9f869e3 // indirect github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect - github.com/fastly/go-fastly/v5 v5.1.1 + github.com/fastly/go-fastly/v5 v5.1.2 github.com/fatih/structs v1.1.0 // indirect github.com/gocql/gocql v0.0.0-20210707082121-9a3953d1826d // indirect github.com/google/go-github/v35 v35.1.0 @@ -195,7 +195,6 @@ require ( github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/Microsoft/go-winio v0.5.1 // indirect github.com/agext/levenshtein v1.2.2 // indirect - github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect @@ -205,8 +204,10 @@ require ( github.com/aws/aws-sdk-go v1.37.0 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 // indirect + github.com/aws/smithy-go v1.8.1 // indirect github.com/beevik/etree v1.1.0 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect diff --git a/go.sum b/go.sum index ce1a9df232..68b0da0f95 100644 --- a/go.sum +++ b/go.sum @@ -158,8 +158,6 @@ github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9 h1:fJ4XPqxuZfm11zauw9XX7c30P8xwDyucdWu8H6Htrxs= -github.com/ajg/form v0.0.0-20160802194845-cc2954064ec9/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -212,7 +210,6 @@ github.com/aws/aws-sdk-go-v2 v1.3.0/go.mod h1:hTQc/9pYq5bfFACIUY9tc/2SYWd9Vnmw+t github.com/aws/aws-sdk-go-v2 v1.3.1/go.mod h1:5SmWRTjN6uTRFNCc7rR69xHsdcUJnthmaRHGDsYhpTE= github.com/aws/aws-sdk-go-v2 v1.3.2/go.mod h1:7OaACgj2SX3XGWnrIjGlJM22h6yD6MEWKvm7levnnM8= github.com/aws/aws-sdk-go-v2 v1.4.0/go.mod h1:tI4KhsR5VkzlUa2DZAdwx7wCAYGwkZZ1H31PYrBFx1w= -github.com/aws/aws-sdk-go-v2 v1.9.0 h1:+S+dSqQCN3MSU5vJRu1HqHrq00cJn6heIMU7X9hcsoo= github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.10.0 h1:+dCJ5W2HiZNa4UtaIc5ljKNulm0dK0vS5dxb5LdDOAA= github.com/aws/aws-sdk-go-v2 v1.10.0/go.mod h1:U/EyyVvKtzmFeQQcca7eBotKdlpcP2zzU6bXBYcf7CE= @@ -309,7 +306,6 @@ github.com/aws/aws-sdk-go-v2/service/iam v1.3.0/go.mod h1:gPUYT7MBEb30j9eAsJ17LN github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 h1:iLFz4nrWkXMTFeVn0n99wRyc4Xib4SlDbtAM3h2z8P8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3/go.mod h1:g3Xw4tO/W+ae4EMzkxB6nGnJ48cLM4i1Z61WmD+IKtY= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5/go.mod h1:MW0O/RpmVpS6MWKn6W03XEJmqXlG7+d3iaYLzkd2fAc= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 h1:VNJ5NLBteVXEwE2F1zEXVmyIH58mZ6kIQGJoC7C+vkg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0 h1:/T5wKsw/po118HEDvnSE8YU7TESxvZbYM2rnn+Oi7Kk= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0/go.mod h1:X5/JuOxPLU/ogICgDTtnpfaQzdQJO0yKDcpoxWLLJ8Y= @@ -335,8 +331,6 @@ github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 h1:TvDVD1mBXP60NIHrqbP github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1/go.mod h1:iy7PhC7Wxk3aRePrvaUU7ngXjcAedbTBeKYAYVhnvfI= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 h1:mQUBlaWu2q7RftA5O8psLn2wQTIJAQEX0eIp3dZOtxQ= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3/go.mod h1:PgBTgxJV+wffbLmlJB/zO0/lD8+mEbUzEK0LvPkbxXM= -github.com/aws/aws-sdk-go-v2/service/rds v1.2.1 h1:nh6V70gwG0bE6Ocz34rg5VZvmthKuDSa785CBpvY2g8= -github.com/aws/aws-sdk-go-v2/service/rds v1.2.1/go.mod h1:QQ6pD2d3AUbZblcKzZ5aJ58mMMfcofx2j8KAXcHe8rg= github.com/aws/aws-sdk-go-v2/service/rds v1.10.0 h1:VgbyR1VctdsZ+EUWW+/EwHip1SdcW4MVcntV8u8NpkI= github.com/aws/aws-sdk-go-v2/service/rds v1.10.0/go.mod h1:FE9JK93YvpyMx4MKwkQfBsW3BZmAop7xSxKk2ey3unM= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1 h1:36JI8JwGQEH5JcRXdpWucey2jr+mSLZWEvLWZLo73PI= @@ -379,7 +373,6 @@ github.com/aws/smithy-go v1.2.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAm github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.3.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.4.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.8.1 h1:9Y6qxtzgEODaLNGN+oN2QvcHvKUe4jsH8w4M+8LXzGk= github.com/aws/smithy-go v1.8.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= @@ -495,8 +488,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y 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/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fastly/go-fastly/v5 v5.1.1 h1:ch5NYZHU38SCSxx216gCZ83222kgww4pjKZ6//xTJjU= -github.com/fastly/go-fastly/v5 v5.1.1/go.mod h1:Hr7UTc2laOUk+jnocgJFIjpE/jqoxR0Oftt0AIeLSzo= +github.com/fastly/go-fastly/v5 v5.1.2 h1:QzOc35dfeoMlNgTkbHBGCiwkfnZzDBDptH3/zTqh80Q= +github.com/fastly/go-fastly/v5 v5.1.2/go.mod h1:4WKmXkCyvjq6+XlE9zrCBsFyoQngQGQjVkpr0LjAXoY= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= diff --git a/providers/fastly/tls_subscription.go b/providers/fastly/tls_subscription.go index 4a469ac4dd..26e703766e 100644 --- a/providers/fastly/tls_subscription.go +++ b/providers/fastly/tls_subscription.go @@ -15,6 +15,8 @@ package fastly import ( + "log" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" "github.com/fastly/go-fastly/v5/fastly" ) @@ -23,7 +25,7 @@ type TLSSubscriptionGenerator struct { FastlyService } -func (g *TLSSubscriptionGenerator) loadSubscriptions(client *fastly.Client) ([]*fastly.TLSSubscription, error) { +func (g *TLSSubscriptionGenerator) loadTLSSubscriptions(client *fastly.Client) ([]*fastly.TLSSubscription, error) { subscriptions, err := client.ListTLSSubscriptions(&fastly.ListTLSSubscriptionsInput{}) if err != nil { return nil, err @@ -39,12 +41,36 @@ func (g *TLSSubscriptionGenerator) loadSubscriptions(client *fastly.Client) ([]* return subscriptions, nil } +func (g *TLSSubscriptionGenerator) loadTLSActivations(client *fastly.Client) ([]*fastly.TLSActivation, error) { + activations, err := client.ListTLSActivations(&fastly.ListTLSActivationsInput{}) + if err != nil { + return nil, err + } + for _, activation := range activations { + log.Println("certicate: ", activation.ID) + + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + activation.ID, + activation.ID, + "fastly_tls_activation", + "fastly", + []string{}, + )) + } + return activations, nil +} + func (g *TLSSubscriptionGenerator) InitResources() error { client, err := fastly.NewClient(g.Args["api_key"].(string)) if err != nil { return err } - if _, err := g.loadSubscriptions(client); err != nil { + + if _, err := g.loadTLSSubscriptions(client); err != nil { + return err + } + + if _, err := g.loadTLSActivations(client); err != nil { return err } From 789423f2a3beb089a8615b3498134506375280dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20M=C3=BChle?= Date: Tue, 9 Nov 2021 06:42:36 +0100 Subject: [PATCH 266/276] Add "Opsgenie" as further provider (#1124) --- README.md | 2 + cmd/provider_cmd_opsgenie.go | 33 ++++++++++++ cmd/root.go | 1 + docs/opsgenie.md | 14 +++++ go.mod | 1 + go.sum | 3 ++ providers/opsgenie/opsgenie_provider.go | 70 +++++++++++++++++++++++++ providers/opsgenie/opsgenie_service.go | 21 ++++++++ providers/opsgenie/team.go | 50 ++++++++++++++++++ providers/opsgenie/user.go | 68 ++++++++++++++++++++++++ 10 files changed, 263 insertions(+) create mode 100644 cmd/provider_cmd_opsgenie.go create mode 100644 docs/opsgenie.md create mode 100644 providers/opsgenie/opsgenie_provider.go create mode 100644 providers/opsgenie/opsgenie_service.go create mode 100644 providers/opsgenie/team.go create mode 100644 providers/opsgenie/user.go diff --git a/README.md b/README.md index 32d4c70162..28a643e1db 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * [Datadog](/docs/datadog.md) * [New Relic](/docs/relic.md) * [PagerDuty](/docs/pagerduty.md) + * [Opsgenie](/docs/opsgenie.md) * Community * [Keycloak](/docs/keycloak.md) * [Logz.io](/docs/logz.md) @@ -277,6 +278,7 @@ Links to download Terraform Providers: * Datadog provider >2.1.0 - [here](https://releases.hashicorp.com/terraform-provider-datadog/) * New Relic provider >2.0.0 - [here](https://releases.hashicorp.com/terraform-provider-newrelic/) * Pagerduty >=1.9 - [here](https://releases.hashicorp.com/terraform-provider-pagerduty/) + * Opsgenie >= 0.6.0 [here](https://releases.hashicorp.com/terraform-provider-opsgenie/) * Community * Keycloak provider >=1.19.0 - [here](https://github.com/mrparkers/terraform-provider-keycloak/) * Logz.io provider >=1.1.1 - [here](https://github.com/jonboydell/logzio_terraform_provider/) diff --git a/cmd/provider_cmd_opsgenie.go b/cmd/provider_cmd_opsgenie.go new file mode 100644 index 0000000000..1e2c60e591 --- /dev/null +++ b/cmd/provider_cmd_opsgenie.go @@ -0,0 +1,33 @@ +package cmd + +import ( + "github.com/spf13/cobra" + + opsgenie_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/opsgenie" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +func newCmdOpsgenieImporter(options ImportOptions) *cobra.Command { + var apiKey string + cmd := &cobra.Command{ + Use: "opsgenie", + Short: "Import current state to Terraform configuration from Opsgenie", + Long: "Import current state to Terraform configuration from Opsgenie", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newOpsgenieProvider() + err := Import(provider, options, []string{apiKey}) + if err != nil { + return err + } + return nil + }, + } + cmd.AddCommand(listCmd(newOpsgenieProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "user,team", "") + cmd.PersistentFlags().StringVarP(&apiKey, "api-key", "", "", "YOUR_OPSGENIE_API_KEY or env param OPSGENIE_API_KEY") + return cmd +} + +func newOpsgenieProvider() terraformutils.ProviderGenerator { + return &opsgenie_terraforming.OpsgenieProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index 730ae16894..d5617731a6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -71,6 +71,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command newCmdNewRelicImporter, newCmdGrafanaImporter, newCmdPagerDutyImporter, + newCmdOpsgenieImporter, // Community newCmdKeycloakImporter, newCmdLogzioImporter, diff --git a/docs/opsgenie.md b/docs/opsgenie.md new file mode 100644 index 0000000000..3c16b17355 --- /dev/null +++ b/docs/opsgenie.md @@ -0,0 +1,14 @@ +### Use with Opsgenie + +Example: + +``` + terraformer import opsgenie --resources=team,user --api-key=YOUR_API_KEY // or OPSGENIE_API_KEY in env +``` + +List of supported Opsgenie services: + +* `team` + * `opsgenie_team` +* `user` + * `opsgenie_user` diff --git a/go.mod b/go.mod index 782312d60e..2494d6ccc6 100644 --- a/go.mod +++ b/go.mod @@ -283,6 +283,7 @@ require ( github.com/oklog/run v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.8 // indirect github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 // indirect github.com/pborman/uuid v1.2.0 // indirect github.com/pelletier/go-toml v1.7.0 // indirect diff --git a/go.sum b/go.sum index 68b0da0f95..a02145d7b5 100644 --- a/go.sum +++ b/go.sum @@ -745,6 +745,7 @@ github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/go-retryablehttp v0.5.1/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= @@ -1041,6 +1042,8 @@ github.com/opencontainers/runc v1.0.1 h1:G18PGckGdAm3yVQRWDVQ1rLSLntiniKJ0cNRT2T github.com/opencontainers/runc v1.0.1/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= +github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.8 h1:qF/rRi8GSU2mjBXfJIyMj9GGmjedsV3Gm1uYbiGlCRk= +github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.8/go.mod h1:4OjcxgwdXzezqytxN534MooNmrxRD50geWZxTD7845s= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= diff --git a/providers/opsgenie/opsgenie_provider.go b/providers/opsgenie/opsgenie_provider.go new file mode 100644 index 0000000000..fa4f46284b --- /dev/null +++ b/providers/opsgenie/opsgenie_provider.go @@ -0,0 +1,70 @@ +package opsgenie + +import ( + "errors" + "os" + + "github.com/zclconf/go-cty/cty" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type OpsgenieProvider struct { //nolint + terraformutils.Provider + + APIKey string +} + +func (p *OpsgenieProvider) Init(args []string) error { + if apiKey := os.Getenv("OPSGENIE_API_KEY"); apiKey != "" { + p.APIKey = os.Getenv("OPSGENIE_API_KEY") + } + if args[0] != "" { + p.APIKey = args[0] + } + if p.APIKey == "" { + return errors.New("required API Key missing") + } + + return nil +} + +func (p *OpsgenieProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New(p.GetName() + ": " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "api-key": p.APIKey, + }) + return nil +} + +func (p *OpsgenieProvider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "api_key": cty.StringVal(p.APIKey), + }) +} + +func (p *OpsgenieProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{} +} + +func (p *OpsgenieProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} + +func (p *OpsgenieProvider) GetName() string { + return "opsgenie" +} + +func (p *OpsgenieProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "user": &UserGenerator{}, + "team": &TeamGenerator{}, + } +} diff --git a/providers/opsgenie/opsgenie_service.go b/providers/opsgenie/opsgenie_service.go new file mode 100644 index 0000000000..3b02bf16f3 --- /dev/null +++ b/providers/opsgenie/opsgenie_service.go @@ -0,0 +1,21 @@ +package opsgenie + +import ( + "github.com/opsgenie/opsgenie-go-sdk-v2/client" + "github.com/opsgenie/opsgenie-go-sdk-v2/team" + "github.com/opsgenie/opsgenie-go-sdk-v2/user" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type OpsgenieService struct { //nolint + terraformutils.Service +} + +func (s *OpsgenieService) UserClient() (*user.Client, error) { + return user.NewClient(&client.Config{ApiKey: s.GetArgs()["api-key"].(string)}) +} + +func (s *OpsgenieService) TeamClient() (*team.Client, error) { + return team.NewClient(&client.Config{ApiKey: s.GetArgs()["api-key"].(string)}) +} diff --git a/providers/opsgenie/team.go b/providers/opsgenie/team.go new file mode 100644 index 0000000000..f91ab9e6b0 --- /dev/null +++ b/providers/opsgenie/team.go @@ -0,0 +1,50 @@ +package opsgenie + +import ( + "context" + "time" + + "github.com/opsgenie/opsgenie-go-sdk-v2/team" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type TeamGenerator struct { + OpsgenieService +} + +func (g *TeamGenerator) InitResources() error { + client, err := g.TeamClient() + if err != nil { + return err + } + + ctx, cancelFunc := context.WithTimeout(context.Background(), 2*time.Second) + defer cancelFunc() + + result, err := client.List(ctx, &team.ListTeamRequest{}) + if err != nil { + return err + } + + g.Resources = g.createResources(result.Teams) + return nil +} + +func (g *TeamGenerator) createResources(teams []team.ListedTeams) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, t := range teams { + resources = append(resources, terraformutils.NewResource( + t.Id, + t.Name, + "opsgenie_team", + g.ProviderName, + map[string]string{}, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} diff --git a/providers/opsgenie/user.go b/providers/opsgenie/user.go new file mode 100644 index 0000000000..3a21c406d6 --- /dev/null +++ b/providers/opsgenie/user.go @@ -0,0 +1,68 @@ +package opsgenie + +import ( + "context" + "fmt" + "time" + + "github.com/opsgenie/opsgenie-go-sdk-v2/user" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" +) + +type UserGenerator struct { + OpsgenieService +} + +func (g *UserGenerator) InitResources() error { + client, err := g.UserClient() + if err != nil { + return err + } + + limit := 50 + offset := 0 + + var users []user.User + + for { + result, err := func(limit, offset int) (*user.ListResult, error) { + ctx, cancelFunc := context.WithTimeout(context.Background(), 2*time.Second) + defer cancelFunc() + + return client.List(ctx, &user.ListRequest{Limit: limit, Offset: offset}) + }(limit, offset) + + if err != nil { + return err + } + + users = append(users, result.Users...) + offset += limit + + if offset >= result.TotalCount { + break + } + } + + g.Resources = g.createResources(users) + return nil +} + +func (g *UserGenerator) createResources(users []user.User) []terraformutils.Resource { + var resources []terraformutils.Resource + + for _, u := range users { + resources = append(resources, terraformutils.NewResource( + u.Id, + fmt.Sprintf("%s-%s", u.Id, u.Username), + "opsgenie_user", + g.ProviderName, + map[string]string{}, + []string{}, + map[string]interface{}{}, + )) + } + + return resources +} From 1746214f96765ee93bdc77962c42dc87c0365293 Mon Sep 17 00:00:00 2001 From: Gompei Date: Tue, 9 Nov 2021 14:43:22 +0900 Subject: [PATCH 267/276] Add "Mackerel" as further provider (#1125) --- README.md | 2 + cmd/provider_cmd_mackerel.go | 46 +++++++++++ cmd/root.go | 1 + docs/mackerel.md | 30 +++++++ go.mod | 1 + go.sum | 3 + providers/mackerel/alert_group_setting.go | 58 +++++++++++++ providers/mackerel/aws_integration.go | 58 +++++++++++++ providers/mackerel/channel.go | 75 +++++++++++++++++ providers/mackerel/downtime.go | 58 +++++++++++++ providers/mackerel/mackerel_provider.go | 99 +++++++++++++++++++++++ providers/mackerel/mackerel_service.go | 21 +++++ providers/mackerel/monitor.go | 58 +++++++++++++ providers/mackerel/notification_group.go | 58 +++++++++++++ providers/mackerel/role.go | 71 ++++++++++++++++ providers/mackerel/service.go | 58 +++++++++++++ 16 files changed, 697 insertions(+) create mode 100644 cmd/provider_cmd_mackerel.go create mode 100644 docs/mackerel.md create mode 100644 providers/mackerel/alert_group_setting.go create mode 100644 providers/mackerel/aws_integration.go create mode 100644 providers/mackerel/channel.go create mode 100644 providers/mackerel/downtime.go create mode 100644 providers/mackerel/mackerel_provider.go create mode 100644 providers/mackerel/mackerel_service.go create mode 100644 providers/mackerel/monitor.go create mode 100644 providers/mackerel/notification_group.go create mode 100644 providers/mackerel/role.go create mode 100644 providers/mackerel/service.go diff --git a/README.md b/README.md index 28a643e1db..1215ed7537 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ A CLI tool that generates `tf`/`json` and `tfstate` files based on existing infr * Monitoring & System Management * [Datadog](/docs/datadog.md) * [New Relic](/docs/relic.md) + * [Mackerel](/docs/mackerel.md) * [PagerDuty](/docs/pagerduty.md) * [Opsgenie](/docs/opsgenie.md) * Community @@ -277,6 +278,7 @@ Links to download Terraform Providers: * Monitoring & System Management * Datadog provider >2.1.0 - [here](https://releases.hashicorp.com/terraform-provider-datadog/) * New Relic provider >2.0.0 - [here](https://releases.hashicorp.com/terraform-provider-newrelic/) + * Mackerel provider > 0.0.6 - [here](https://github.com/mackerelio-labs/terraform-provider-mackerel) * Pagerduty >=1.9 - [here](https://releases.hashicorp.com/terraform-provider-pagerduty/) * Opsgenie >= 0.6.0 [here](https://releases.hashicorp.com/terraform-provider-opsgenie/) * Community diff --git a/cmd/provider_cmd_mackerel.go b/cmd/provider_cmd_mackerel.go new file mode 100644 index 0000000000..1d84b1c270 --- /dev/null +++ b/cmd/provider_cmd_mackerel.go @@ -0,0 +1,46 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + mackerel_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/mackerel" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/spf13/cobra" +) + +func newCmdMackerelImporter(options ImportOptions) *cobra.Command { + var apiKey string + cmd := &cobra.Command{ + Use: "mackerel", + Short: "Import current state to Terraform configuration from Mackerel", + Long: "Import current state to Terraform configuration from Mackerel", + RunE: func(cmd *cobra.Command, args []string) error { + provider := newMackerelProvider() + err := Import(provider, options, []string{apiKey}) + if err != nil { + return err + } + return nil + }, + } + cmd.AddCommand(listCmd(newMackerelProvider())) + baseProviderFlags(cmd.PersistentFlags(), &options, "service,role,aws_integration", "aws_integration=id1:id2:id4") + cmd.PersistentFlags().StringVarP(&apiKey, "api-key", "", "", "YOUR_MACKEREL_API_KEY or env param MACKEREL_API_KEY") + return cmd +} + +func newMackerelProvider() terraformutils.ProviderGenerator { + return &mackerel_terraforming.MackerelProvider{} +} diff --git a/cmd/root.go b/cmd/root.go index d5617731a6..c729f5c739 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -69,6 +69,7 @@ func providerImporterSubcommands() []func(options ImportOptions) *cobra.Command // Monitoring & System Management newCmdDatadogImporter, newCmdNewRelicImporter, + newCmdMackerelImporter, newCmdGrafanaImporter, newCmdPagerDutyImporter, newCmdOpsgenieImporter, diff --git a/docs/mackerel.md b/docs/mackerel.md new file mode 100644 index 0000000000..24f653d365 --- /dev/null +++ b/docs/mackerel.md @@ -0,0 +1,30 @@ +### Use with Mackerel + +Example: + +```bash + ./terraformer import mackerel --resources=service --api-key=YOUR_MACKEREL_API_KEY // or MACKEREL_API_KEY in env --app-key=YOUR_MACKEREL_API_KEY + ./terraformer import mackerel --resources=service --filter=service=name1:name2:name4 --api-key=YOUR_MACKEREL_API_KEY // or MACKEREL_API_KEY in env --app-key=YOUR_MACKEREL_API_KEY + ./terraformer import mackerel --resources=aws_integration --filter=aws_integration=id1:id2:id4 --api-key=YOUR_MACKEREL_API_KEY // or MACKEREL_API_KEY in env --app-key=YOUR_MACKEREL_API_KEY +``` + +List of supported Mackerel services: + +* `alert_group_setting` + * `mackerel_alert_group_setting` +* `aws_integration` + * `mackerel_aws_integration` + * Sensitive field `secret_key` is not generated and needs to be manually set + * Sensitive field `external_id` is not generated and needs to be manually set +* `channel` + * `mackerel_channel` +* `downtime` + * `mackerel_downtime` +* `monitor` + * `mackerel_monitor` +* `notification_group` + * `mackerel_notification_group` +* `role` + * `mackerel_role` +* `service` + * `mackerel_service` \ No newline at end of file diff --git a/go.mod b/go.mod index 2494d6ccc6..43a7f82281 100644 --- a/go.mod +++ b/go.mod @@ -174,6 +174,7 @@ require ( github.com/IBM/go-sdk-core v1.1.0 github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/mackerelio/mackerel-client-go v0.19.0 github.com/okta/terraform-provider-okta v0.0.0-20210924173942-a5a664459d3b github.com/zclconf/go-cty-yaml v1.0.2 // indirect ) diff --git a/go.sum b/go.sum index a02145d7b5..16a646c835 100644 --- a/go.sum +++ b/go.sum @@ -912,6 +912,8 @@ github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3 github.com/linode/linodego v0.24.1 h1:3s7/F54z9XZfefzrFqnHMD9DIEYVyOddPm+gyTEFFzc= github.com/linode/linodego v0.24.1/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= +github.com/mackerelio/mackerel-client-go v0.19.0 h1:DkYVD07fmklFTMKLaHcjtkU53Nt+nhvXNUSEeKfRSZs= +github.com/mackerelio/mackerel-client-go v0.19.0/go.mod h1:/GNOj+y1eFsd3CK8c6IQ/uS38/GT0+NWImk5YGJs5Lk= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -1531,6 +1533,7 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200612022331-742c5eb664c2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200624163319-25775e59acb7/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/providers/mackerel/alert_group_setting.go b/providers/mackerel/alert_group_setting.go new file mode 100644 index 0000000000..16199e856c --- /dev/null +++ b/providers/mackerel/alert_group_setting.go @@ -0,0 +1,58 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// AlertGroupSettingGenerator ... +type AlertGroupSettingGenerator struct { + MackerelService +} + +func (g *AlertGroupSettingGenerator) createResources(alertGroupSettings []*mackerel.AlertGroupSetting) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, alertGroupSetting := range alertGroupSettings { + resources = append(resources, g.createResource(alertGroupSetting.ID)) + } + return resources +} + +func (g *AlertGroupSettingGenerator) createResource(alertGroupSettingID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + alertGroupSettingID, + fmt.Sprintf("alert_group_setting_%s", alertGroupSettingID), + "mackerel_alert_group_setting", + "mackerel", + []string{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each alert group setting create 1 TerraformResource. +// Need Alert Group Setting ID as ID for terraform resource +func (g *AlertGroupSettingGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + alertGroupSettings, err := client.FindAlertGroupSettings() + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(alertGroupSettings)...) + return nil +} diff --git a/providers/mackerel/aws_integration.go b/providers/mackerel/aws_integration.go new file mode 100644 index 0000000000..313d937a00 --- /dev/null +++ b/providers/mackerel/aws_integration.go @@ -0,0 +1,58 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// AWSIntegrationGenerator ... +type AWSIntegrationGenerator struct { + MackerelService +} + +func (g *AWSIntegrationGenerator) createResources(awsIntegrations []*mackerel.AWSIntegration) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, awsIntegration := range awsIntegrations { + resources = append(resources, g.createResource(awsIntegration.ID)) + } + return resources +} + +func (g *AWSIntegrationGenerator) createResource(awsIntegrationID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + awsIntegrationID, + fmt.Sprintf("aws_integration_%s", awsIntegrationID), + "mackerel_aws_integration", + "mackerel", + []string{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each aws integration create 1 TerraformResource. +// Need AWS Integration ID as ID for terraform resource +func (g *AWSIntegrationGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + awsIntegrations, err := client.FindAWSIntegrations() + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(awsIntegrations)...) + return nil +} diff --git a/providers/mackerel/channel.go b/providers/mackerel/channel.go new file mode 100644 index 0000000000..9c4abafd4b --- /dev/null +++ b/providers/mackerel/channel.go @@ -0,0 +1,75 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// ChannelGenerator ... +type ChannelGenerator struct { + MackerelService +} + +func (g *ChannelGenerator) createResources(channels []*mackerel.Channel) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, channel := range channels { + if channel.Type != "email" && channel.Type != "slack" && channel.Type != "webhook" { + continue + } + + if channel.Type == "email" { + if channel.Events != nil { + events := *channel.Events + for _, event := range events { + if event != "alert" && event != "alertGroup" { + continue + } + } + } else { + continue + } + } + + resources = append(resources, g.createResource(channel.ID)) + } + return resources +} + +func (g *ChannelGenerator) createResource(channelID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + channelID, + fmt.Sprintf("channel_%s", channelID), + "mackerel_channel", + "mackerel", + []string{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each channel create 1 TerraformResource. +// Need Channel ID as ID for terraform resource +func (g *ChannelGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + channels, err := client.FindChannels() + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(channels)...) + return nil +} diff --git a/providers/mackerel/downtime.go b/providers/mackerel/downtime.go new file mode 100644 index 0000000000..b800a87b2e --- /dev/null +++ b/providers/mackerel/downtime.go @@ -0,0 +1,58 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// DowntimeGenerator ... +type DowntimeGenerator struct { + MackerelService +} + +func (g *DowntimeGenerator) createResources(downtimes []*mackerel.Downtime) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, downtime := range downtimes { + resources = append(resources, g.createResource(downtime.ID)) + } + return resources +} + +func (g *DowntimeGenerator) createResource(downtimeID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + downtimeID, + fmt.Sprintf("downtime_%s", downtimeID), + "mackerel_downtime", + "mackerel", + []string{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each downtime create 1 TerraformResource. +// Need Downtime ID as ID for terraform resource +func (g *DowntimeGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + downtimes, err := client.FindDowntimes() + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(downtimes)...) + return nil +} diff --git a/providers/mackerel/mackerel_provider.go b/providers/mackerel/mackerel_provider.go new file mode 100644 index 0000000000..1ff057dc1c --- /dev/null +++ b/providers/mackerel/mackerel_provider.go @@ -0,0 +1,99 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "errors" + "os" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + mackerel "github.com/mackerelio/mackerel-client-go" + "github.com/zclconf/go-cty/cty" +) + +type MackerelProvider struct { //nolint + terraformutils.Provider + apiKey string + mackerelClient *mackerel.Client +} + +// Init check env params and initialize API Client +func (p *MackerelProvider) Init(args []string) error { + if args[0] != "" { + p.apiKey = args[0] + } else { + if apiKey := os.Getenv("MACKEREL_API_KEY"); apiKey != "" { + p.apiKey = apiKey + } else { + return errors.New("api-key requirement") + } + } + // Initialize the Mackerel API client + p.mackerelClient = mackerel.NewClient(p.apiKey) + return nil +} + +// InitService ... +func (p *MackerelProvider) InitService(serviceName string, verbose bool) error { + var isSupported bool + if _, isSupported = p.GetSupportedService()[serviceName]; !isSupported { + return errors.New(p.GetName() + ": " + serviceName + " not supported service") + } + p.Service = p.GetSupportedService()[serviceName] + p.Service.SetName(serviceName) + p.Service.SetVerbose(verbose) + p.Service.SetProviderName(p.GetName()) + p.Service.SetArgs(map[string]interface{}{ + "api-key": p.apiKey, + "mackerelClient": p.mackerelClient, + }) + return nil +} + +// GetName return string of provider name for Mackerel +func (p *MackerelProvider) GetName() string { + return "mackerel" +} + +// GetConfig return map of provider config for Mackerel +func (p *MackerelProvider) GetConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "api_key": cty.StringVal(p.apiKey), + }) +} + +// GetSupportedService return map of support service for Mackerel +func (p *MackerelProvider) GetSupportedService() map[string]terraformutils.ServiceGenerator { + return map[string]terraformutils.ServiceGenerator{ + "alert_group_setting": &AlertGroupSettingGenerator{}, + "aws_integration": &AWSIntegrationGenerator{}, + "channel": &ChannelGenerator{}, + "downtime": &DowntimeGenerator{}, + "monitor": &MonitorGenerator{}, + "notification_group": &NotificationGroupGenerator{}, + "role": &RoleGenerator{}, + "service": &ServiceGenerator{}, + } +} + +// GetProviderData return map of provider data for Mackerel +func (p MackerelProvider) GetProviderData(arg ...string) map[string]interface{} { + return map[string]interface{}{} +} + +// GetResourceConnections return map of resource connections for Mackerel +func (p *MackerelProvider) GetResourceConnections() map[string]map[string][]string { + return map[string]map[string][]string{} +} diff --git a/providers/mackerel/mackerel_service.go b/providers/mackerel/mackerel_service.go new file mode 100644 index 0000000000..d1dfcec0a7 --- /dev/null +++ b/providers/mackerel/mackerel_service.go @@ -0,0 +1,21 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import "github.com/GoogleCloudPlatform/terraformer/terraformutils" + +type MackerelService struct { // nolint + terraformutils.Service +} diff --git a/providers/mackerel/monitor.go b/providers/mackerel/monitor.go new file mode 100644 index 0000000000..787938262e --- /dev/null +++ b/providers/mackerel/monitor.go @@ -0,0 +1,58 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// MonitorGenerator ... +type MonitorGenerator struct { + MackerelService +} + +func (g *MonitorGenerator) createResources(monitors []mackerel.Monitor) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, monitor := range monitors { + resources = append(resources, g.createResource(monitor.MonitorID())) + } + return resources +} + +func (g *MonitorGenerator) createResource(monitorID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + monitorID, + fmt.Sprintf("monitor_%s", monitorID), + "mackerel_monitor", + "mackerel", + []string{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each monitor create 1 TerraformResource. +// Need Monitor ID as ID for terraform resource +func (g *MonitorGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + monitors, err := client.FindMonitors() + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(monitors)...) + return nil +} diff --git a/providers/mackerel/notification_group.go b/providers/mackerel/notification_group.go new file mode 100644 index 0000000000..53fd72f82d --- /dev/null +++ b/providers/mackerel/notification_group.go @@ -0,0 +1,58 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// NotificationGroupGenerator ... +type NotificationGroupGenerator struct { + MackerelService +} + +func (g *NotificationGroupGenerator) createResources(notificationGroups []*mackerel.NotificationGroup) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, notificationGroup := range notificationGroups { + resources = append(resources, g.createResource(notificationGroup.ID)) + } + return resources +} + +func (g *NotificationGroupGenerator) createResource(notificationGroupID string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + notificationGroupID, + fmt.Sprintf("notification_group_%s", notificationGroupID), + "mackerel_notification_group", + "mackerel", + []string{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each notification group create 1 TerraformResource. +// Need Notification Group ID as ID for terraform resource +func (g *NotificationGroupGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + notificationGroups, err := client.FindNotificationGroups() + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(notificationGroups)...) + return nil +} diff --git a/providers/mackerel/role.go b/providers/mackerel/role.go new file mode 100644 index 0000000000..2d6f6f2a20 --- /dev/null +++ b/providers/mackerel/role.go @@ -0,0 +1,71 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// RoleGenerator ... +type RoleGenerator struct { + MackerelService +} + +func (g *RoleGenerator) createResources(serviceName string, roles []*mackerel.Role) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, role := range roles { + resources = append(resources, g.createResource(serviceName, role.Name)) + } + return resources +} + +func (g *RoleGenerator) createResource(serviceName string, roleName string) terraformutils.Resource { + return terraformutils.NewResource( + fmt.Sprintf("%s:%s", serviceName, roleName), + fmt.Sprintf("role_%s_%s", serviceName, roleName), + "mackerel_role", + "mackerel", + map[string]string{ + "service": serviceName, + "name": roleName, + }, + []string{}, + map[string]interface{}{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each role create 1 TerraformResource. +// Need Service Name And Role Name as ID for terraform resource +func (g *RoleGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + + services, err := client.FindServices() + if err != nil { + return err + } + + for _, service := range services { + roles, err := client.FindRoles(service.Name) + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(service.Name, roles)...) + } + return nil +} diff --git a/providers/mackerel/service.go b/providers/mackerel/service.go new file mode 100644 index 0000000000..153f2f3a62 --- /dev/null +++ b/providers/mackerel/service.go @@ -0,0 +1,58 @@ +// Copyright 2021 The Terraformer Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mackerel + +import ( + "fmt" + + "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/mackerelio/mackerel-client-go" +) + +// ServiceGenerator ... +type ServiceGenerator struct { + MackerelService +} + +func (g *ServiceGenerator) createResources(services []*mackerel.Service) []terraformutils.Resource { + resources := []terraformutils.Resource{} + for _, service := range services { + resources = append(resources, g.createResource(service.Name)) + } + return resources +} + +func (g *ServiceGenerator) createResource(serviceName string) terraformutils.Resource { + return terraformutils.NewSimpleResource( + serviceName, + fmt.Sprintf("service_%s", serviceName), + "mackerel_service", + "mackerel", + []string{}, + ) +} + +// InitResources Generate TerraformResources from Mackerel API, +// from each service create 1 TerraformResource. +// Need Service Name as ID for terraform resource +func (g *ServiceGenerator) InitResources() error { + client := g.Args["mackerelClient"].(*mackerel.Client) + services, err := client.FindServices() + if err != nil { + return err + } + g.Resources = append(g.Resources, g.createResources(services)...) + return nil +} From 77bac928a801074d0f7ca3a25722dce7adb458a8 Mon Sep 17 00:00:00 2001 From: Sunil Date: Wed, 10 Nov 2021 10:34:50 +0530 Subject: [PATCH 268/276] Update azure_service.go for fixing #1126Azure|| route_table ||[ERR]: duplicate resource found: azurerm_route.tfer-- (#1134) * Update azure_service.go Added Duplicate check method to avoid error having same name in different Resource group or at sub level * fixed duplicate issue * fixed duplicate issue --- providers/azure/azure_service.go | 34 ++++++++++++++++++++++++++++---- providers/azure/helper.go | 10 ++++++++++ providers/azure/route_table.go | 4 ++-- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/providers/azure/azure_service.go b/providers/azure/azure_service.go index b1e1af14b1..9cb9cddb29 100644 --- a/providers/azure/azure_service.go +++ b/providers/azure/azure_service.go @@ -15,12 +15,10 @@ package azure import ( - "strings" - "github.com/Azure/go-autorest/autorest" - "github.com/hashicorp/go-azure-helpers/authentication" - "github.com/GoogleCloudPlatform/terraformer/terraformutils" + "github.com/hashicorp/go-azure-helpers/authentication" + "strings" ) type AzureService struct { //nolint @@ -39,6 +37,34 @@ func (az *AzureService) AppendSimpleResource(id string, resourceName string, res az.Resources = append(az.Resources, newResource) } +func (az *AzureService) AppendSimpleResourceWithDuplicateCheck(id string, resourceName string, resourceType string) { + tferexist, _ := az.DuplicateCheck(id, resourceName, resourceType) + if !tferexist { + resourceName = resourceName + "_" + GenerateRandomString(6) + } + newResource := terraformutils.NewSimpleResource(id, resourceName, resourceType, az.ProviderName, []string{}) + az.Resources = append(az.Resources, newResource) +} + +// This method checks if same resource name(tfer) exists with +// same id +func (az *AzureService) DuplicateCheck(id string, resourceName string, resourceType string) (bool, bool) { + var tferexist, idexist bool + tferName := terraformutils.TfSanitize(resourceName) + for _, resource := range az.Resources { + if tferName == resource.ResourceName { + if id == resource.InstanceState.ID { + tferexist = true + idexist = true + } else { + tferexist = true + idexist = false + } + } + } + return tferexist, idexist +} + func (az *AzureService) appendSimpleAssociation(id string, linkedResourceName string, resourceName *string, resourceType string, attributes map[string]string) { var resourceName2 string if resourceName != nil { diff --git a/providers/azure/helper.go b/providers/azure/helper.go index 161864e332..14c05a8ebc 100644 --- a/providers/azure/helper.go +++ b/providers/azure/helper.go @@ -16,6 +16,7 @@ package azure import ( "fmt" + "math/rand" "net/url" "strings" ) @@ -107,6 +108,15 @@ func ParseAzureResourceID(id string) (*ResourceID, error) { return idObj, nil } +func GenerateRandomString(strlen int) string { + var lettersToUsed = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") + RandomSlice := make([]rune, strlen) + for index := range RandomSlice { + RandomSlice[index] = lettersToUsed[rand.Intn(len(lettersToUsed))] + } + return string(RandomSlice) +} + func asHereDoc(json string) string { return fmt.Sprintf(`< Date: Wed, 10 Nov 2021 00:05:03 -0500 Subject: [PATCH 269/276] aws: bump rds dep version and support db_proxy (#1131) Signed-off-by: Rui Chen --- docs/aws.md | 1 + go.mod | 12 +++++++----- go.sum | 20 ++++++++++++-------- providers/aws/rds.go | 26 +++++++++++++++++++++++++- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/docs/aws.md b/docs/aws.md index 9be8f03782..ffc966d808 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -220,6 +220,7 @@ In that case terraformer will not know with which region resources are associate * `aws_qldb_ledger` * `rds` * `aws_db_instance` + * `aws_db_proxy` * `aws_db_cluster` * `aws_db_parameter_group` * `aws_db_subnet_group` diff --git a/go.mod b/go.mod index 43a7f82281..4dd91b8fe5 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247 github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 - github.com/aws/aws-sdk-go-v2 v1.10.0 + github.com/aws/aws-sdk-go-v2 v1.11.0 github.com/aws/aws-sdk-go-v2/config v1.1.4 github.com/aws/aws-sdk-go-v2/credentials v1.1.4 github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 @@ -81,7 +81,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/opsworks v1.2.2 github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 - github.com/aws/aws-sdk-go-v2/service/rds v1.10.0 + github.com/aws/aws-sdk-go-v2/service/rds v1.11.0 github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1 github.com/aws/aws-sdk-go-v2/service/route53 v1.3.0 github.com/aws/aws-sdk-go-v2/service/s3 v1.4.0 @@ -143,6 +143,7 @@ require ( github.com/okta/okta-sdk-golang/v2 v2.6.3-0.20210923165359-20aeac44ab01 github.com/opencontainers/image-spec v1.0.1 // indirect github.com/opencontainers/runc v1.0.1 // indirect + github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.8 github.com/ory/dockertest v3.3.5+incompatible // indirect github.com/packethost/packngo v0.9.0 github.com/paultyng/go-newrelic/v4 v4.10.0 @@ -204,11 +205,13 @@ require ( github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect github.com/aws/aws-sdk-go v1.37.0 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 // indirect - github.com/aws/smithy-go v1.8.1 // indirect + github.com/aws/smithy-go v1.9.0 // indirect github.com/beevik/etree v1.1.0 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect @@ -284,7 +287,6 @@ require ( github.com/oklog/run v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.8 // indirect github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 // indirect github.com/pborman/uuid v1.2.0 // indirect github.com/pelletier/go-toml v1.7.0 // indirect diff --git a/go.sum b/go.sum index 16a646c835..9336436b63 100644 --- a/go.sum +++ b/go.sum @@ -211,14 +211,18 @@ github.com/aws/aws-sdk-go-v2 v1.3.1/go.mod h1:5SmWRTjN6uTRFNCc7rR69xHsdcUJnthmaR github.com/aws/aws-sdk-go-v2 v1.3.2/go.mod h1:7OaACgj2SX3XGWnrIjGlJM22h6yD6MEWKvm7levnnM8= github.com/aws/aws-sdk-go-v2 v1.4.0/go.mod h1:tI4KhsR5VkzlUa2DZAdwx7wCAYGwkZZ1H31PYrBFx1w= github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2 v1.10.0 h1:+dCJ5W2HiZNa4UtaIc5ljKNulm0dK0vS5dxb5LdDOAA= -github.com/aws/aws-sdk-go-v2 v1.10.0/go.mod h1:U/EyyVvKtzmFeQQcca7eBotKdlpcP2zzU6bXBYcf7CE= +github.com/aws/aws-sdk-go-v2 v1.11.0 h1:HxyD62DyNhCfiFGUHqJ/xITD6rAjJ7Dm/2nLxLmO4Ag= +github.com/aws/aws-sdk-go-v2 v1.11.0/go.mod h1:SQfA+m2ltnu1cA0soUkj4dRSsmITiVQUJvBIZjzfPyQ= github.com/aws/aws-sdk-go-v2/config v1.1.4 h1:2hjdDldmJJjb+rFieQySfOFt4WwxKZJVTEB6RBI74T4= github.com/aws/aws-sdk-go-v2/config v1.1.4/go.mod h1:op05ummoVoAqctpA80jVt/+hvEtLfuKmDyx0bIuvfbE= github.com/aws/aws-sdk-go-v2/credentials v1.1.4 h1:whYYw2srG+zUQzUw4LhML83f+xd22Vm7gv0I7aJglc8= github.com/aws/aws-sdk-go-v2/credentials v1.1.4/go.mod h1:UQwsT2w2XelrWoVV2v/zL2uce1RxmVCiHaZsoKLamZg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 h1:5gCrezE41xYQHWDsDkJD9nT22tUH3s+Zrvs4c3v2FGc= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5/go.mod h1:z/NKNlYxMzphl7TzjV+ctUebHF4CFNGGlSvmV/NKcJU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.0 h1:zY8cNmbBXt3pzjgWgdIbzpQ6qxoCwt+Nx9JbrAf2mbY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.0/go.mod h1:NO3Q5ZTTQtO2xIg2+xTXYDiT7knSejfeDm7WGDaOo0U= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.0 h1:Z3aR/OXBnkYK9zXkNkfitHX6SmUBzSsx8VMHbH4Lvhw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.0/go.mod h1:anlUzBoEWglcUxUQwZA7HQOEVEnQALVZsizAapB2hq8= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 h1:d95cddM3yTm4qffj3P6EnP+TzX1SSkWaQypXSgT/hpA= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2/go.mod h1:BQV0agm+JEhqR+2RT5e1XTFIDcAAV0eW6z2trp+iduw= github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.2.0 h1:G7NSCbvUWDp4B0ny7tjHfuZvadphb7M66/1cYN9AnAg= @@ -307,8 +311,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 h1:iLFz4nrW github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3/go.mod h1:g3Xw4tO/W+ae4EMzkxB6nGnJ48cLM4i1Z61WmD+IKtY= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.5/go.mod h1:MW0O/RpmVpS6MWKn6W03XEJmqXlG7+d3iaYLzkd2fAc= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0 h1:/T5wKsw/po118HEDvnSE8YU7TESxvZbYM2rnn+Oi7Kk= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0/go.mod h1:X5/JuOxPLU/ogICgDTtnpfaQzdQJO0yKDcpoxWLLJ8Y= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.0 h1:qGZWS/WgiFY+Zgad2u0gwBHpJxz6Ne401JE7iQI1nKs= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.0/go.mod h1:Mq6AEc+oEjCUlBuLiK5YwW4shSOAKCQ3tXN0sQeYoBA= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 h1:wCzfVBrF1QRQFacZn1ywE/o2p92FzfpDNI2aCpIv+sY= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1/go.mod h1:6A0VfJAnYwhcXzt7KsixOdFlITEH5NFl4QeYxlZ5TtQ= github.com/aws/aws-sdk-go-v2/service/iot v1.2.0 h1:OTrzh5ew69Vd6x1zruCQ7B/dtcxwCQ5ohPJWwfkydKQ= @@ -331,8 +335,8 @@ github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1 h1:TvDVD1mBXP60NIHrqbP github.com/aws/aws-sdk-go-v2/service/organizations v1.2.1/go.mod h1:iy7PhC7Wxk3aRePrvaUU7ngXjcAedbTBeKYAYVhnvfI= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3 h1:mQUBlaWu2q7RftA5O8psLn2wQTIJAQEX0eIp3dZOtxQ= github.com/aws/aws-sdk-go-v2/service/qldb v1.1.3/go.mod h1:PgBTgxJV+wffbLmlJB/zO0/lD8+mEbUzEK0LvPkbxXM= -github.com/aws/aws-sdk-go-v2/service/rds v1.10.0 h1:VgbyR1VctdsZ+EUWW+/EwHip1SdcW4MVcntV8u8NpkI= -github.com/aws/aws-sdk-go-v2/service/rds v1.10.0/go.mod h1:FE9JK93YvpyMx4MKwkQfBsW3BZmAop7xSxKk2ey3unM= +github.com/aws/aws-sdk-go-v2/service/rds v1.11.0 h1:sFjF9JiGSFnBrcXgOM3Fm95SSOrAMywiyTb1bjO0oTE= +github.com/aws/aws-sdk-go-v2/service/rds v1.11.0/go.mod h1:CD31RSZUKoDEo7ZewGGutgOeqZvlZ4v8Skoyeizjt/o= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1 h1:36JI8JwGQEH5JcRXdpWucey2jr+mSLZWEvLWZLo73PI= github.com/aws/aws-sdk-go-v2/service/resourcegroups v1.2.1/go.mod h1:fS4Gj1TYWWpQB0qHsijLygpI6zUFkEwoHSf8ajXFTqQ= github.com/aws/aws-sdk-go-v2/service/route53 v1.3.0 h1:uwKwx0iSdZyIwQmsMPtAoBjlRC1lFUAhx2c6HGWjfPM= @@ -374,8 +378,8 @@ github.com/aws/smithy-go v1.3.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAm github.com/aws/smithy-go v1.3.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.4.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.8.1 h1:9Y6qxtzgEODaLNGN+oN2QvcHvKUe4jsH8w4M+8LXzGk= -github.com/aws/smithy-go v1.8.1/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.9.0 h1:c7FUdEqrQA1/UVKKCNDFQPNKGp4FQg3YW4Ck5SLTG58= +github.com/aws/smithy-go v1.9.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= diff --git a/providers/aws/rds.go b/providers/aws/rds.go index e60168c46e..38416d56c2 100644 --- a/providers/aws/rds.go +++ b/providers/aws/rds.go @@ -50,6 +50,27 @@ func (g *RDSGenerator) loadDBClusters(svc *rds.Client) error { return nil } +func (g *RDSGenerator) loadDBProxies(svc *rds.Client) error { + p := rds.NewDescribeDBProxiesPaginator(svc, &rds.DescribeDBProxiesInput{}) + for p.HasMorePages() { + page, err := p.NextPage(context.TODO()) + if err != nil { + return err + } + for _, db := range page.DBProxies { + resourceName := StringValue(db.DBProxyName) + g.Resources = append(g.Resources, terraformutils.NewSimpleResource( + resourceName, + resourceName, + "aws_db_proxy", + "aws", + RDSAllowEmptyValues, + )) + } + } + return nil + +} func (g *RDSGenerator) loadDBInstances(svc *rds.Client) error { p := rds.NewDescribeDBInstancesPaginator(svc, &rds.DescribeDBInstancesInput{}) for p.HasMorePages() { @@ -178,6 +199,9 @@ func (g *RDSGenerator) InitResources() error { if err := g.loadDBInstances(svc); err != nil { return err } + if err := g.loadDBProxies(svc); err != nil { + return err + } if err := g.loadDBParameterGroups(svc); err != nil { return err } @@ -197,7 +221,7 @@ func (g *RDSGenerator) InitResources() error { func (g *RDSGenerator) PostConvertHook() error { for i, r := range g.Resources { - if (r.InstanceInfo.Type == "aws_db_instance" || r.InstanceInfo.Type == "aws_rds_cluster") { + if r.InstanceInfo.Type == "aws_db_instance" || r.InstanceInfo.Type == "aws_rds_cluster" { for _, parameterGroup := range g.Resources { if parameterGroup.InstanceInfo.Type != "aws_db_parameter_group" { From 11cf110af0b6f838799e8a96b2bde3d06d25a9da Mon Sep 17 00:00:00 2001 From: Sunil Date: Wed, 10 Nov 2021 13:32:26 +0530 Subject: [PATCH 270/276] Fixed issue #1127 - [ERR]: duplicate resource found: azurerm_network_security_group.tfer (#1138) * Update azure_service.go Added Duplicate check method to avoid error having same name in different Resource group or at sub level * fixed duplicate issue * fixed duplicate issue * fixed duplicate resource for nsg --- providers/azure/network_security_group.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/azure/network_security_group.go b/providers/azure/network_security_group.go index 9743d0bac4..447ee3ec39 100644 --- a/providers/azure/network_security_group.go +++ b/providers/azure/network_security_group.go @@ -55,7 +55,7 @@ func (az *NetworkSecurityGroupGenerator) listResources() ([]network.SecurityGrou } func (az *NetworkSecurityGroupGenerator) appendResource(resource *network.SecurityGroup) { - az.AppendSimpleResource(*resource.ID, *resource.Name, "azurerm_network_security_group") + az.AppendSimpleResourceWithDuplicateCheck(*resource.ID, *resource.Name, "azurerm_network_security_group") } func (az *NetworkSecurityGroupGenerator) appendRules(parent *network.SecurityGroup, resourceGroupID *ResourceID) error { @@ -69,7 +69,7 @@ func (az *NetworkSecurityGroupGenerator) appendRules(parent *network.SecurityGro } for iterator.NotDone() { item := iterator.Value() - az.AppendSimpleResource(*item.ID, *item.Name, "azurerm_network_security_rule") + az.AppendSimpleResourceWithDuplicateCheck(*item.ID, *item.Name, "azurerm_network_security_rule") if err := iterator.NextWithContext(ctx); err != nil { log.Println(err) return err From 80131a31de7174b922f856be18475bd586c0303f Mon Sep 17 00:00:00 2001 From: Sunil Date: Mon, 22 Nov 2021 14:36:26 +0530 Subject: [PATCH 271/276] Fixing Issue #1135 - Azure || virtual_network || [ERR]: duplicate resource found: azurerm_virtual_network.tfer-- (#1140) * Update azure_service.go Added Duplicate check method to avoid error having same name in different Resource group or at sub level * fixed duplicate issue * fixed duplicate issue * fixed duplicate resource for nsg * fixed virtual network duplicate resource issue * Update virtual_network.go --- providers/azure/virtual_network.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/providers/azure/virtual_network.go b/providers/azure/virtual_network.go index 0d75fe2981..8abe5eac82 100644 --- a/providers/azure/virtual_network.go +++ b/providers/azure/virtual_network.go @@ -32,6 +32,13 @@ func (g VirtualNetworkGenerator) createResources(ctx context.Context, iterator n var resources []terraformutils.Resource for iterator.NotDone() { virtualNetwork := iterator.Value() + tferName := terraformutils.TfSanitize(*virtualNetwork.Name) + for _, resource := range resources { + if tferName == resource.ResourceName { + *virtualNetwork.Name = *virtualNetwork.Name + "_" + *virtualNetwork.ID + } + } + resources = append(resources, terraformutils.NewSimpleResource( *virtualNetwork.ID, *virtualNetwork.Name, From 6aba9e07261de2adbf60fb8578ebcc2866e08c79 Mon Sep 17 00:00:00 2001 From: Pierre Erraud Date: Mon, 22 Nov 2021 10:06:51 +0100 Subject: [PATCH 272/276] feat: improve PANOS provider reliability (#1139) --- providers/panos/firewall_networking.go | 128 +++++++++++++--------- providers/panos/firewall_objects.go | 42 ++++--- providers/panos/helpers.go | 9 ++ providers/panos/panorama_networking.go | 146 +++++++++++++++---------- providers/panos/panorama_objects.go | 42 ++++--- providers/panos/panorama_plugins.go | 4 +- providers/panos/panos_service.go | 8 +- 7 files changed, 241 insertions(+), 138 deletions(-) diff --git a/providers/panos/firewall_networking.go b/providers/panos/firewall_networking.go index c5bc5202c0..5a66465c7d 100644 --- a/providers/panos/firewall_networking.go +++ b/providers/panos/firewall_networking.go @@ -608,46 +608,48 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { mapIPSECCryptoProfileNames := map[string]string{} for _, r := range g.Resources { - if r.InstanceInfo.Type == "panos_aggregate_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" - } + if _, ok := r.Item["name"]; ok { + if r.InstanceInfo.Type == "panos_aggregate_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } - if r.InstanceInfo.Type == "panos_ethernet_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" - } + if r.InstanceInfo.Type == "panos_ethernet_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } - if r.InstanceInfo.Type == "panos_layer2_subinterface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_layer2_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_layer3_subinterface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_layer3_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_loopback_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_loopback_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_tunnel_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_tunnel_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_vlan_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_vlan_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_ike_crypto_profile" { - mapIKECryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_ike_crypto_profile" { + mapIKECryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_ike_gateway" { - mapIKEGatewayNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_ike_gateway" { + mapIKEGatewayNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_ipsec_crypto_profile" { - mapIPSECCryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + if r.InstanceInfo.Type == "panos_ipsec_crypto_profile" { + mapIPSECCryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } } } @@ -655,7 +657,9 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { if r.InstanceInfo.Type == "panos_bgp" || r.InstanceInfo.Type == "panos_redistribution_profile_ipv4" || r.InstanceInfo.Type == "panos_static_route_ipv4" { - r.Item["virtual_router"] = "${panos_virtual_router." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".name}" + if _, ok := r.Item["virtual_router"]; ok { + r.Item["virtual_router"] = "${panos_virtual_router." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".name}" + } } if r.InstanceInfo.Type == "panos_bgp_aggregate" || @@ -666,60 +670,80 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { r.InstanceInfo.Type == "panos_bgp_import_rule_group" || r.InstanceInfo.Type == "panos_bgp_peer_group" || r.InstanceInfo.Type == "panos_bgp_redist_rule" { - r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + if _, ok := r.Item["virtual_router"]; ok { + r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } } if r.InstanceInfo.Type == "panos_bgp_aggregate_advertise_filter" || r.InstanceInfo.Type == "panos_bgp_aggregate_suppress_filter" { - r.Item["virtual_router"] = "${panos_bgp_aggregate." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" - r.Item["bgp_aggregate"] = "${panos_bgp_aggregate." + normalizeResourceName(r.Item["bgp_aggregate"].(string)) + ".name}" + if _, ok := r.Item["virtual_router"]; ok { + r.Item["virtual_router"] = "${panos_bgp_aggregate." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + if _, ok := r.Item["bgp_aggregate"]; ok { + r.Item["bgp_aggregate"] = "${panos_bgp_aggregate." + normalizeResourceName(r.Item["bgp_aggregate"].(string)) + ".name}" + } } if r.InstanceInfo.Type == "panos_bgp_peer" { - r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" - r.Item["peer_as"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".as_number}" + if _, ok := r.Item["virtual_router"]; ok { + r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + r.Item["peer_as"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".as_number}" + } } if r.InstanceInfo.Type == "panos_bgp_conditional_adv_advertise_filter" || r.InstanceInfo.Type == "panos_bgp_conditional_adv_non_exist_filter" { - r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" - r.Item["bgp_conditional_adv"] = "${panos_bgp_conditional_adv." + normalizeResourceName(r.Item["panos_bgp_conditional_adv"].(string)) + ".name}" + if _, ok := r.Item["virtual_router"]; ok { + r.Item["virtual_router"] = "${panos_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + if _, ok := r.Item["panos_bgp_conditional_adv"]; ok { + r.Item["bgp_conditional_adv"] = "${panos_bgp_conditional_adv." + normalizeResourceName(r.Item["panos_bgp_conditional_adv"].(string)) + ".name}" + } } if r.InstanceInfo.Type == "panos_gre_tunnel" { - r.Item["interface"] = mapInterfaceNames[r.Item["interface"].(string)] - r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + if mapExists(mapInterfaceNames, r.Item, "interface") { + r.Item["interface"] = mapInterfaceNames[r.Item["interface"].(string)] + } + if mapExists(mapInterfaceNames, r.Item, "tunnel_interface") { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } } if r.InstanceInfo.Type == "panos_ike_gateway" { - if _, ok := r.Item["ikev1_crypto_profile"]; ok { + if mapExists(mapIKECryptoProfileNames, r.Item, "ikev1_crypto_profile") { r.Item["ikev1_crypto_profile"] = mapIKECryptoProfileNames[r.Item["ikev1_crypto_profile"].(string)] } } if r.InstanceInfo.Type == "panos_ipsec_tunnel" { - r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] - r.Item["ak_ike_gateway"] = mapIKEGatewayNames[r.Item["ak_ike_gateway"].(string)] - if _, ok := r.Item["ak_ipsec_crypto_profile"]; ok { + if mapExists(mapInterfaceNames, r.Item, "tunnel_interface") { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } + if mapExists(mapIKEGatewayNames, r.Item, "ak_ike_gateway") { + r.Item["ak_ike_gateway"] = mapIKEGatewayNames[r.Item["ak_ike_gateway"].(string)] + } + if mapExists(mapIPSECCryptoProfileNames, r.Item, "ak_ipsec_crypto_profile") { r.Item["ak_ipsec_crypto_profile"] = mapIPSECCryptoProfileNames[r.Item["ak_ipsec_crypto_profile"].(string)] } } if r.InstanceInfo.Type == "panos_ipsec_tunnel_proxy_id_ipv4" { - if _, ok := mapInterfaceNames[r.Item["ipsec_tunnel"].(string)]; ok { + if mapExists(mapInterfaceNames, r.Item, "ipsec_tunnel") { r.Item["ipsec_tunnel"] = mapInterfaceNames[r.Item["ipsec_tunnel"].(string)] } } if r.InstanceInfo.Type == "panos_layer2_subinterface" { - if _, ok := mapInterfaceModes[r.Item["parent_interface"].(string)]; ok { + if mapExists(mapInterfaceModes, r.Item, "parent_interface") { r.Item["parent_mode"] = mapInterfaceModes[r.Item["parent_interface"].(string)] } } if r.InstanceInfo.Type == "panos_layer2_subinterface" || r.InstanceInfo.Type == "panos_layer3_subinterface" { - if _, ok := mapInterfaceNames[r.Item["parent_interface"].(string)]; ok { + if mapExists(mapInterfaceNames, r.Item, "parent_interface") { r.Item["parent_interface"] = mapInterfaceNames[r.Item["parent_interface"].(string)] } } @@ -767,9 +791,11 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { if _, ok := r.Item["interfaces"]; ok { interfaces := make([]string, len(r.Item["interfaces"].([]interface{}))) for k, eth := range r.Item["interfaces"].([]interface{}) { - if name, ok := mapInterfaceNames[eth.(string)]; ok { + if name, ok2 := mapInterfaceNames[eth.(string)]; ok2 { interfaces[k] = name + continue } + interfaces[k] = eth.(string) } r.Item["interfaces"] = interfaces @@ -777,7 +803,9 @@ func (g *FirewallNetworkingGenerator) PostConvertHook() error { } if r.InstanceInfo.Type == "panos_vlan" { - r.Item["vlan_interface"] = mapInterfaceNames[r.Item["vlan_interface"].(string)] + if mapExists(mapInterfaceNames, r.Item, "vlan_interface") { + r.Item["vlan_interface"] = mapInterfaceNames[r.Item["vlan_interface"].(string)] + } } } diff --git a/providers/panos/firewall_objects.go b/providers/panos/firewall_objects.go index ce29adf852..7d5eff664b 100644 --- a/providers/panos/firewall_objects.go +++ b/providers/panos/firewall_objects.go @@ -259,16 +259,18 @@ func (g *FirewallObjectsGenerator) PostConvertHook() error { mapServiceObjectIDs := map[string]string{} for _, r := range g.Resources { - if r.InstanceInfo.Type == "panos_address_object" { - mapAddressObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if _, ok := r.Item["name"]; ok { + if r.InstanceInfo.Type == "panos_address_object" { + mapAddressObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_application_object" { - mapApplicationObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_application_object" { + mapApplicationObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_service_object" { - mapServiceObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + if r.InstanceInfo.Type == "panos_service_object" { + mapServiceObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } } } @@ -277,7 +279,11 @@ func (g *FirewallObjectsGenerator) PostConvertHook() error { if _, ok := r.Item["static_addresses"]; ok { staticAddresses := make([]string, len(r.Item["static_addresses"].([]interface{}))) for k, staticAddress := range r.Item["static_addresses"].([]interface{}) { - staticAddresses[k] = mapAddressObjectIDs[staticAddress.(string)] + if _, ok2 := mapAddressObjectIDs[staticAddress.(string)]; ok2 { + staticAddresses[k] = mapAddressObjectIDs[staticAddress.(string)] + continue + } + staticAddresses[k] = staticAddress.(string) } r.Item["static_addresses"] = staticAddresses @@ -288,7 +294,7 @@ func (g *FirewallObjectsGenerator) PostConvertHook() error { if _, ok := r.Item["applications"]; ok { applications := make([]string, len(r.Item["applications"].([]interface{}))) for k, application := range r.Item["applications"].([]interface{}) { - if _, ok := mapApplicationObjectIDs[application.(string)]; ok { + if _, ok2 := mapApplicationObjectIDs[application.(string)]; ok2 { applications[k] = mapApplicationObjectIDs[application.(string)] continue } @@ -300,12 +306,18 @@ func (g *FirewallObjectsGenerator) PostConvertHook() error { } if r.InstanceInfo.Type == "panos_service_group" { - services := make([]string, len(r.Item["services"].([]interface{}))) - for k, service := range r.Item["services"].([]interface{}) { - services[k] = mapServiceObjectIDs[service.(string)] - } + if _, ok := r.Item["services"]; ok { + services := make([]string, len(r.Item["services"].([]interface{}))) + for k, service := range r.Item["services"].([]interface{}) { + if _, ok2 := mapServiceObjectIDs[service.(string)]; ok2 { + services[k] = mapServiceObjectIDs[service.(string)] + continue + } + services[k] = service.(string) + } - r.Item["services"] = services + r.Item["services"] = services + } } } diff --git a/providers/panos/helpers.go b/providers/panos/helpers.go index ead6433bd8..6b672fa388 100644 --- a/providers/panos/helpers.go +++ b/providers/panos/helpers.go @@ -159,3 +159,12 @@ func contains(s []string, e string) bool { } return false } + +func mapExists(mapString map[string]string, item map[string]interface{}, element string) bool { + if _, ok := item[element]; ok { + if _, ok2 := mapString[item[element].(string)]; ok2 { + return true + } + } + return false +} diff --git a/providers/panos/panorama_networking.go b/providers/panos/panorama_networking.go index 13ca32e504..f38aee5846 100644 --- a/providers/panos/panorama_networking.go +++ b/providers/panos/panorama_networking.go @@ -747,46 +747,48 @@ func (g *PanoramaNetworkingGenerator) PostConvertHook() error { mapIPSECCryptoProfileNames := map[string]string{} for _, r := range g.Resources { - if r.InstanceInfo.Type == "panos_panorama_aggregate_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" - } + if _, ok := r.Item["name"]; ok { + if r.InstanceInfo.Type == "panos_panorama_aggregate_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } - if r.InstanceInfo.Type == "panos_panorama_ethernet_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" - } + if r.InstanceInfo.Type == "panos_panorama_ethernet_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + mapInterfaceModes[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".mode}" + } - if r.InstanceInfo.Type == "panos_panorama_layer2_subinterface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_layer2_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_layer3_subinterface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_layer3_subinterface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_loopback_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_loopback_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_tunnel_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_tunnel_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_vlan_interface" { - mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_vlan_interface" { + mapInterfaceNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_ike_crypto_profile" { - mapIKECryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_ike_crypto_profile" { + mapIKECryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_ike_gateway" { - mapIKEGatewayNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_ike_gateway" { + mapIKEGatewayNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_ipsec_crypto_profile" { - mapIPSECCryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + if r.InstanceInfo.Type == "panos_panorama_ipsec_crypto_profile" { + mapIPSECCryptoProfileNames[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } } } @@ -794,8 +796,10 @@ func (g *PanoramaNetworkingGenerator) PostConvertHook() error { if r.InstanceInfo.Type == "panos_panorama_bgp" || r.InstanceInfo.Type == "panos_panorama_redistribution_profile_ipv4" || r.InstanceInfo.Type == "panos_panorama_static_route_ipv4" { - if r.Item["virtual_router"].(string) != "default" { - r.Item["virtual_router"] = "${panos_panorama_virtual_router." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".name}" + if _, ok := r.Item["virtual_router"]; ok { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_virtual_router." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".name}" + } } } @@ -807,65 +811,91 @@ func (g *PanoramaNetworkingGenerator) PostConvertHook() error { r.InstanceInfo.Type == "panos_panorama_bgp_import_rule_group" || r.InstanceInfo.Type == "panos_panorama_bgp_peer_group" || r.InstanceInfo.Type == "panos_panorama_bgp_redist_rule" { - if r.Item["virtual_router"].(string) != "default" { - r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + if _, ok := r.Item["virtual_router"]; ok { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } } } if r.InstanceInfo.Type == "panos_panorama_bgp_aggregate_advertise_filter" || r.InstanceInfo.Type == "panos_panorama_bgp_aggregate_suppress_filter" { - if r.Item["virtual_router"].(string) != "default" { - r.Item["virtual_router"] = "${panos_panorama_bgp_aggregate." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + if _, ok := r.Item["virtual_router"]; ok { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp_aggregate." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + } + if _, ok := r.Item["bgp_aggregate"]; ok { + r.Item["bgp_aggregate"] = "${panos_panorama_bgp_aggregate." + normalizeResourceName(r.Item["bgp_aggregate"].(string)) + ".name}" } - r.Item["bgp_aggregate"] = "${panos_panorama_bgp_aggregate." + normalizeResourceName(r.Item["bgp_aggregate"].(string)) + ".name}" } if r.InstanceInfo.Type == "panos_panorama_bgp_peer" { - if r.Item["virtual_router"].(string) != "default" { - r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" - r.Item["peer_as"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".as_number}" + if _, ok := r.Item["virtual_router"]; ok { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + r.Item["peer_as"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".as_number}" + } + } + if _, ok := r.Item["panos_bgp_peer_group"]; ok { + r.Item["bgp_peer_group"] = "${panos_panorama_bgp_peer_group." + normalizeResourceName(r.Item["panos_bgp_peer_group"].(string)) + ".name}" } - r.Item["bgp_peer_group"] = "${panos_panorama_bgp_peer_group." + normalizeResourceName(r.Item["panos_bgp_peer_group"].(string)) + ".name}" } if r.InstanceInfo.Type == "panos_panorama_bgp_conditional_adv_advertise_filter" || r.InstanceInfo.Type == "panos_panorama_bgp_conditional_adv_non_exist_filter" { - if r.Item["virtual_router"].(string) != "default" { - r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + if _, ok := r.Item["virtual_router"]; ok { + if r.Item["virtual_router"].(string) != "default" { + r.Item["virtual_router"] = "${panos_panorama_bgp." + normalizeResourceName(r.Item["virtual_router"].(string)) + ".virtual_router}" + } + } + if _, ok := r.Item["panos_bgp_conditional_adv"]; ok { + r.Item["bgp_conditional_adv"] = "${panos_panorama_bgp_conditional_adv." + normalizeResourceName(r.Item["panos_bgp_conditional_adv"].(string)) + ".name}" } - r.Item["bgp_conditional_adv"] = "${panos_panorama_bgp_conditional_adv." + normalizeResourceName(r.Item["panos_bgp_conditional_adv"].(string)) + ".name}" } if r.InstanceInfo.Type == "panos_panorama_gre_tunnel" { - r.Item["interface"] = mapInterfaceNames[r.Item["interface"].(string)] - r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + if mapExists(mapInterfaceNames, r.Item, "interface") { + r.Item["interface"] = mapInterfaceNames[r.Item["interface"].(string)] + } + if mapExists(mapInterfaceNames, r.Item, "tunnel_interface") { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } } if r.InstanceInfo.Type == "panos_panorama_ike_gateway" { - if _, ok := r.Item["ikev1_crypto_profile"]; ok { + if mapExists(mapIKECryptoProfileNames, r.Item, "ikev1_crypto_profile") { r.Item["ikev1_crypto_profile"] = mapIKECryptoProfileNames[r.Item["ikev1_crypto_profile"].(string)] } } if r.InstanceInfo.Type == "panos_panorama_ipsec_tunnel" { - r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] - r.Item["ak_ike_gateway"] = mapIKEGatewayNames[r.Item["ak_ike_gateway"].(string)] - r.Item["ak_ipsec_crypto_profile"] = mapIPSECCryptoProfileNames[r.Item["ak_ipsec_crypto_profile"].(string)] + if mapExists(mapInterfaceNames, r.Item, "tunnel_interface") { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } + if mapExists(mapIKEGatewayNames, r.Item, "ak_ike_gateway") { + r.Item["ak_ike_gateway"] = mapIKEGatewayNames[r.Item["ak_ike_gateway"].(string)] + } + if mapExists(mapIPSECCryptoProfileNames, r.Item, "ak_ipsec_crypto_profile") { + r.Item["ak_ipsec_crypto_profile"] = mapIPSECCryptoProfileNames[r.Item["ak_ipsec_crypto_profile"].(string)] + } } if r.InstanceInfo.Type == "panos_panorama_ipsec_tunnel_proxy_id_ipv4" { - r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + if mapExists(mapInterfaceNames, r.Item, "tunnel_interface") { + r.Item["tunnel_interface"] = mapInterfaceNames[r.Item["tunnel_interface"].(string)] + } } if r.InstanceInfo.Type == "panos_panorama_layer2_subinterface" { - if _, ok := mapInterfaceModes[r.Item["parent_interface"].(string)]; ok { + if mapExists(mapInterfaceModes, r.Item, "parent_interface") { r.Item["parent_mode"] = mapInterfaceModes[r.Item["parent_interface"].(string)] } } if r.InstanceInfo.Type == "panos_panorama_layer2_subinterface" || r.InstanceInfo.Type == "panos_panorama_layer3_subinterface" { - if _, ok := mapInterfaceNames[r.Item["parent_interface"].(string)]; ok { + if mapExists(mapInterfaceNames, r.Item, "parent_interface") { r.Item["parent_interface"] = mapInterfaceNames[r.Item["parent_interface"].(string)] } } @@ -913,9 +943,11 @@ func (g *PanoramaNetworkingGenerator) PostConvertHook() error { if _, ok := r.Item["interfaces"]; ok { interfaces := make([]string, len(r.Item["interfaces"].([]interface{}))) for k, eth := range r.Item["interfaces"].([]interface{}) { - if name, ok := mapInterfaceNames[eth.(string)]; ok { + if name, ok2 := mapInterfaceNames[eth.(string)]; ok2 { interfaces[k] = name + continue } + interfaces[k] = eth.(string) } r.Item["interfaces"] = interfaces @@ -923,7 +955,9 @@ func (g *PanoramaNetworkingGenerator) PostConvertHook() error { } if r.InstanceInfo.Type == "panos_panorama_vlan" { - r.Item["vlan_interface"] = mapInterfaceNames[r.Item["vlan_interface"].(string)] + if mapExists(mapInterfaceNames, r.Item, "vlan_interface") { + r.Item["vlan_interface"] = mapInterfaceNames[r.Item["vlan_interface"].(string)] + } } } diff --git a/providers/panos/panorama_objects.go b/providers/panos/panorama_objects.go index 3829c8a28e..7993435e1f 100644 --- a/providers/panos/panorama_objects.go +++ b/providers/panos/panorama_objects.go @@ -236,16 +236,18 @@ func (g *PanoramaObjectsGenerator) PostConvertHook() error { mapServiceObjectIDs := map[string]string{} for _, r := range g.Resources { - if r.InstanceInfo.Type == "panos_address_object" { - mapAddressObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if _, ok := r.Item["name"]; ok { + if r.InstanceInfo.Type == "panos_address_object" { + mapAddressObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_application_object" { - mapApplicationObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" - } + if r.InstanceInfo.Type == "panos_panorama_application_object" { + mapApplicationObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } - if r.InstanceInfo.Type == "panos_panorama_service_object" { - mapServiceObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + if r.InstanceInfo.Type == "panos_panorama_service_object" { + mapServiceObjectIDs[r.Item["name"].(string)] = "${" + r.InstanceInfo.Type + "." + r.ResourceName + ".name}" + } } } @@ -254,7 +256,11 @@ func (g *PanoramaObjectsGenerator) PostConvertHook() error { if _, ok := r.Item["static_addresses"]; ok { staticAddresses := make([]string, len(r.Item["static_addresses"].([]interface{}))) for k, staticAddress := range r.Item["static_addresses"].([]interface{}) { - staticAddresses[k] = mapAddressObjectIDs[staticAddress.(string)] + if _, ok2 := mapAddressObjectIDs[staticAddress.(string)]; ok2 { + staticAddresses[k] = mapAddressObjectIDs[staticAddress.(string)] + continue + } + staticAddresses[k] = staticAddress.(string) } r.Item["static_addresses"] = staticAddresses @@ -265,7 +271,7 @@ func (g *PanoramaObjectsGenerator) PostConvertHook() error { if _, ok := r.Item["applications"]; ok { applications := make([]string, len(r.Item["applications"].([]interface{}))) for k, application := range r.Item["applications"].([]interface{}) { - if _, ok := mapApplicationObjectIDs[application.(string)]; ok { + if _, ok2 := mapApplicationObjectIDs[application.(string)]; ok2 { applications[k] = mapApplicationObjectIDs[application.(string)] continue } @@ -277,12 +283,18 @@ func (g *PanoramaObjectsGenerator) PostConvertHook() error { } if r.InstanceInfo.Type == "panos_panorama_service_group" { - services := make([]string, len(r.Item["services"].([]interface{}))) - for k, service := range r.Item["services"].([]interface{}) { - services[k] = mapServiceObjectIDs[service.(string)] - } + if _, ok := r.Item["services"]; ok { + services := make([]string, len(r.Item["services"].([]interface{}))) + for k, service := range r.Item["services"].([]interface{}) { + if _, ok2 := mapServiceObjectIDs[service.(string)]; ok2 { + services[k] = mapServiceObjectIDs[service.(string)] + continue + } + services[k] = service.(string) + } - r.Item["services"] = services + r.Item["services"] = services + } } } diff --git a/providers/panos/panorama_plugins.go b/providers/panos/panorama_plugins.go index 0b8a694dd3..946ec082c7 100644 --- a/providers/panos/panorama_plugins.go +++ b/providers/panos/panorama_plugins.go @@ -105,7 +105,9 @@ func (g *PanoramaPluginsGenerator) PostConvertHook() error { for _, r := range g.Resources { if r.InstanceInfo.Type == "panos_panorama_gke_cluster" { - r.Item["gke_cluster_group"] = mapGKEClusterGroupNames[r.Item["gke_cluster_group"].(string)] + if mapExists(mapGKEClusterGroupNames, r.Item, "gke_cluster_group") { + r.Item["gke_cluster_group"] = mapGKEClusterGroupNames[r.Item["gke_cluster_group"].(string)] + } } } diff --git a/providers/panos/panos_service.go b/providers/panos/panos_service.go index fa2bd3a81e..1496e8a746 100644 --- a/providers/panos/panos_service.go +++ b/providers/panos/panos_service.go @@ -15,6 +15,8 @@ package panos import ( + "errors" + "github.com/GoogleCloudPlatform/terraformer/terraformutils" ) @@ -25,7 +27,11 @@ type PanosService struct { //nolint } func (p *PanosService) Initialize() error { - p.vsys = p.Args["vsys"].(string) + if _, ok := p.Args["vsys"].(string); ok { + p.vsys = p.Args["vsys"].(string) + } else { + return errors.New(p.GetName() + ": " + "vsys name not parsable") + } c, err := Initialize() if err != nil { From b40ff967f4c4085c8986e9550ac8534245b66521 Mon Sep 17 00:00:00 2001 From: Sunil Date: Mon, 22 Nov 2021 14:53:03 +0530 Subject: [PATCH 273/276] Added one more example in azure.md file (#1155) * Update azure_service.go Added Duplicate check method to avoid error having same name in different Resource group or at sub level * fixed duplicate issue * fixed duplicate issue * fixed duplicate resource for nsg * fixed virtual network duplicate resource issue * Update virtual_network.go * Update azure.md Added example to get details for specific Resource Group --- docs/azure.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/azure.md b/docs/azure.md index c9e2c38b74..8192a71e43 100644 --- a/docs/azure.md +++ b/docs/azure.md @@ -23,8 +23,10 @@ export ARM_TENANT_ID=[TENANT_ID] ./terraformer import azure -r resource_group ./terraformer import azure -R my_resource_group -r virtual_network,resource_group +./terraformer import azure -r resource_group --filter=resource_group=/subscriptions//resourceGroups/ ``` + ## List of supported Azure resources * `analysis` From 061ca2f29c45d89c0632d6b83e14b05e93f71f3d Mon Sep 17 00:00:00 2001 From: nimrodkor Date: Mon, 22 Nov 2021 17:44:45 +0200 Subject: [PATCH 274/276] Add UT to PRs to develop --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 575784e093..43e2ffb13d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - master + - develop jobs: test: From df717d609c72c414f69f754cc5039a790d69b121 Mon Sep 17 00:00:00 2001 From: nimrodkor Date: Mon, 22 Nov 2021 17:54:01 +0200 Subject: [PATCH 275/276] Fix go mod --- go.mod | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ go.sum | 69 ++-------------------------- 2 files changed, 148 insertions(+), 64 deletions(-) diff --git a/go.mod b/go.mod index 6db6d62b5f..6b5b43ba17 100644 --- a/go.mod +++ b/go.mod @@ -181,8 +181,151 @@ require ( ) require ( + github.com/Azure/azure-pipeline-go v0.2.2 // indirect + github.com/Azure/go-autorest v14.2.0+incompatible // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect + github.com/Azure/go-autorest/autorest/azure/cli v0.2.0 // indirect + github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect + github.com/Azure/go-autorest/logger v0.2.1 // indirect + github.com/Azure/go-autorest/tracing v0.6.0 // indirect + github.com/BurntSushi/toml v0.3.1 // indirect + github.com/IBM/go-sdk-core/v5 v5.5.1 // indirect github.com/Microsoft/go-winio v0.5.1 // indirect + github.com/agext/levenshtein v1.2.2 // indirect + github.com/apparentlymart/go-cidr v1.1.0 // indirect + github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc // indirect + github.com/armon/go-radix v1.0.0 // indirect + github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect + github.com/aws/aws-sdk-go v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.2.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.1.4 // indirect + github.com/aws/smithy-go v1.9.0 // indirect + github.com/beevik/etree v1.1.0 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/blang/semver v3.5.1+incompatible // indirect + github.com/bmatcuk/doublestar v1.1.5 // indirect + github.com/cenkalti/backoff/v4 v4.1.1 // indirect + github.com/crewjam/saml v0.4.5 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dghubble/sling v1.1.0 // indirect + github.com/dimchansky/utfbom v1.1.0 // indirect + github.com/docker/go-units v0.4.0 // indirect + github.com/fatih/color v1.7.0 // indirect + github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/go-logr/logr v0.4.0 // indirect + github.com/go-openapi/errors v0.19.8 // indirect + github.com/go-openapi/strfmt v0.20.1 // indirect + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect + github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 // indirect + github.com/go-routeros/routeros v0.0.0-20210123142807-2a44d57c6730 // indirect + github.com/go-stack/stack v1.8.0 // indirect github.com/gofrs/uuid v3.2.0+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.3 // indirect + github.com/google/go-cmp v0.5.6 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/google/jsonapi v0.0.0-20201022225600-f822737867f6 // indirect + github.com/google/uuid v1.2.0 // indirect + github.com/googleapis/gax-go/v2 v2.0.5 // indirect + github.com/googleapis/gnostic v0.4.1 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-getter v1.5.3 // indirect + github.com/hashicorp/go-multierror v1.0.0 // indirect + github.com/hashicorp/go-retryablehttp v0.7.0 // indirect + github.com/hashicorp/go-rootcerts v1.0.0 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-sockaddr v1.0.0 // indirect + github.com/hashicorp/go-uuid v1.0.1 // indirect + github.com/hashicorp/go-version v1.3.0 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/hcl/v2 v2.8.2 // indirect + github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 // indirect + github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/imdario/mergo v0.3.8 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jonboulle/clockwork v0.2.1 // indirect + github.com/json-iterator/go v1.1.10 // indirect + github.com/jstemmer/go-junit-report v0.9.1 // indirect + github.com/kelseyhightower/envconfig v1.4.0 // indirect + github.com/klauspost/compress v1.11.2 // indirect + github.com/leodido/go-urn v1.2.0 // indirect + github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e // indirect + github.com/mattn/go-colorable v0.1.4 // indirect + github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d // indirect + github.com/mattn/go-isatty v0.0.10 // indirect + github.com/mitchellh/cli v1.0.0 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-testing-interface v1.0.4 // indirect + github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/mitchellh/hashstructure v1.0.0 // indirect + github.com/mitchellh/mapstructure v1.3.3 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/mozillazg/go-httpheader v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 // indirect + github.com/pborman/uuid v1.2.0 // indirect + github.com/pelletier/go-toml v1.7.0 // indirect + github.com/posener/complete v1.2.1 // indirect + github.com/russellhaering/goxmldsig v1.1.0 // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect + github.com/ulikunitz/xz v0.5.8 // indirect + github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect + github.com/vmihailenco/tagparser v0.1.1 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.0.2 // indirect + github.com/xdg-go/stringprep v1.0.2 // indirect + github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + go.mongodb.org/mongo-driver v1.7.2 // indirect + go.opencensus.io v0.22.5 // indirect + golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect + golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect + golang.org/x/mod v0.4.1 // indirect + golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect + golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect + golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect + golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect + golang.org/x/tools v0.1.0 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/grpc v1.35.0 // indirect + google.golang.org/protobuf v1.26.0 // indirect + gopkg.in/go-playground/assert.v1 v1.2.1 // indirect + gopkg.in/go-playground/validator.v9 v9.31.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/ini.v1 v1.62.0 // indirect + gopkg.in/square/go-jose.v2 v2.5.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + k8s.io/api v0.21.0 // indirect + k8s.io/klog/v2 v2.8.0 // indirect + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.1.0 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect ) replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5 diff --git a/go.sum b/go.sum index 9336436b63..04ef6c5a42 100644 --- a/go.sum +++ b/go.sum @@ -12,7 +12,6 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= @@ -122,14 +121,6 @@ github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/Jeffail/gabs/v2 v2.1.0 h1:6dV9GGOjoQgzWTQEltZPXlJdFloxvIq7DwqgxMCbq30= github.com/Jeffail/gabs/v2 v2.1.0/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= -github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= @@ -141,7 +132,6 @@ github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGr github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PaloAltoNetworks/pango v0.6.0 h1:QKe17XsICz2P1S6sKpaH1w8zr/4Q3jYsYVq7bQTjfv8= github.com/PaloAltoNetworks/pango v0.6.0/go.mod h1:xpwEKL6CHhniRcqKYTjIiGBzPd3QIyto3sz2ynsP1qg= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= @@ -151,7 +141,6 @@ github.com/SermoDigital/jose v0.9.1 h1:atYaHPD3lPICcbK1owly3aPm0iaJGSGPi0WD4vLzn github.com/SermoDigital/jose v0.9.1/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -167,8 +156,6 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247/go.mod h1:9CMdKNL3ynIGPpfTcdwT github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= -github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= @@ -179,7 +166,6 @@ github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/Y github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= @@ -196,7 +182,6 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= @@ -484,7 +469,6 @@ github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -498,7 +482,6 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= @@ -509,12 +492,6 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -723,7 +700,6 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= @@ -732,7 +708,6 @@ github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9 github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= @@ -799,12 +774,8 @@ github.com/hashicorp/terraform v0.12.31/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhk github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= -github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= -github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2bHu4fjRB1H6Ag4U= github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.1/go.mod h1:o3pdss6ynDZW9FfiZ+rETUH5LEVufrXdhwLU+5OiRo0= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= @@ -820,27 +791,21 @@ github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZ github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570/go.mod h1:4X9u5iNUePRrRDdwjok6skjlQBXTcNfWa4C3uS1+5SQ= github.com/jarcoal/httpmock v1.0.5 h1:cHtVEcTxRSX4J0je7mWPfc9BpDpqzXSJ5HbymZmyHck= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= github.com/jarcoal/httpmock v1.0.7/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jefferai/jsonx v1.0.1 h1:GvWkLWihoLqDG0BSP45TUQJH9qsINX50PVrFULgpc/I= github.com/jefferai/jsonx v1.0.1/go.mod h1:yFo3l2fcm7cZVHGq3HKLXE+Pd4RWuRjNBDHksM7XekQ= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -876,7 +841,6 @@ github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaR github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -926,7 +890,6 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e h1:qqXczln0qwkVGcpQ+sQuPOVntt2FytYarXXxYSNJkgw= github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -950,9 +913,8 @@ github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 h1:YH424zrwLTlyHS github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqKSQK1vIfQ+yVaFcGjDySHvym6FM1cNYnwzbrY= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= -github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -1004,10 +966,10 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -1105,12 +1067,9 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1187,8 +1146,6 @@ github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYp github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= -github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= @@ -1198,7 +1155,6 @@ github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5 github.com/xanzy/go-gitlab v0.50.2 h1:Qm/um2Jryuqusc6VmN7iZYVTQVzNynzSiuMJDnCU1wE= github.com/xanzy/go-gitlab v0.50.2/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= @@ -1227,7 +1183,6 @@ github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= @@ -1274,12 +1229,9 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1373,7 +1325,6 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1429,7 +1380,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1463,11 +1413,8 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1541,12 +1488,10 @@ golang.org/x/tools v0.0.0-20200612022331-742c5eb664c2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200624163319-25775e59acb7/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201030143252-cf7a54d06671/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1627,7 +1572,6 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1658,7 +1602,6 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= @@ -1681,9 +1624,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -1708,7 +1650,6 @@ gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From c19e6adb5d4dc6383b59c6441bdae52dc233deb8 Mon Sep 17 00:00:00 2001 From: nimrodkor Date: Mon, 22 Nov 2021 17:56:28 +0200 Subject: [PATCH 276/276] Fix go mod --- go.mod | 10 +++++++-- go.sum | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 72 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 6b5b43ba17..4dd91b8fe5 100644 --- a/go.mod +++ b/go.mod @@ -192,6 +192,9 @@ require ( github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/BurntSushi/toml v0.3.1 // indirect github.com/IBM/go-sdk-core/v5 v5.5.1 // indirect + github.com/Masterminds/goutils v1.1.0 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/Microsoft/go-winio v0.5.1 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect @@ -257,7 +260,8 @@ require ( github.com/hashicorp/hcl/v2 v2.8.2 // indirect github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/imdario/mergo v0.3.8 // indirect + github.com/huandu/xstrings v1.3.2 // indirect + github.com/imdario/mergo v0.3.12 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jonboulle/clockwork v0.2.1 // indirect github.com/json-iterator/go v1.1.10 // indirect @@ -269,7 +273,7 @@ require ( github.com/mattn/go-colorable v0.1.4 // indirect github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d // indirect github.com/mattn/go-isatty v0.0.10 // indirect - github.com/mitchellh/cli v1.0.0 // indirect + github.com/mitchellh/cli v1.1.2 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.0.4 // indirect @@ -288,6 +292,7 @@ require ( github.com/pelletier/go-toml v1.7.0 // indirect github.com/posener/complete v1.2.1 // indirect github.com/russellhaering/goxmldsig v1.1.0 // indirect + github.com/sergi/go-diff v1.2.0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/sourcegraph/jsonrpc2 v0.0.0-20210201082850-366fbb520750 // indirect github.com/spf13/afero v1.2.2 // indirect @@ -314,6 +319,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/grpc v1.35.0 // indirect google.golang.org/protobuf v1.26.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 04ef6c5a42..9336436b63 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,7 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.71.0/go.mod h1:qZfY4Y7AEIQwG/fQYD3xrxLNkQZ0Xzf3HGeqCkA6LVM= @@ -121,6 +122,14 @@ github.com/IBM/vpc-go-sdk v0.4.1 h1:aBjdeVW3dDry+x1B2je06Ga47FgRn9QstTjMr0RxcJY= github.com/IBM/vpc-go-sdk v0.4.1/go.mod h1:QlPyV8sf1K4Si7CgEyAbmDonabnhJ7tC4owcjrTz3Ys= github.com/Jeffail/gabs/v2 v2.1.0 h1:6dV9GGOjoQgzWTQEltZPXlJdFloxvIq7DwqgxMCbq30= github.com/Jeffail/gabs/v2 v2.1.0/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= @@ -132,6 +141,7 @@ github.com/OctopusDeploy/go-octopusdeploy v1.6.0/go.mod h1:maPbD8azyb2mcNN6E4SGr github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PaloAltoNetworks/pango v0.6.0 h1:QKe17XsICz2P1S6sKpaH1w8zr/4Q3jYsYVq7bQTjfv8= github.com/PaloAltoNetworks/pango v0.6.0/go.mod h1:xpwEKL6CHhniRcqKYTjIiGBzPd3QIyto3sz2ynsP1qg= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= @@ -141,6 +151,7 @@ github.com/SermoDigital/jose v0.9.1 h1:atYaHPD3lPICcbK1owly3aPm0iaJGSGPi0WD4vLzn github.com/SermoDigital/jose v0.9.1/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -156,6 +167,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.61.1247/go.mod h1:9CMdKNL3ynIGPpfTcdwT github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= +github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/apache/openwhisk-client-go v0.0.0-20210106144548-17d556327cd3 h1:CMvrWrV6C3FOAscQwvCcRGQyQ93KLMTUXCFFS+JGgP4= @@ -166,6 +179,7 @@ github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/Y github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= @@ -182,6 +196,7 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= @@ -469,6 +484,7 @@ github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -482,6 +498,7 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= @@ -492,6 +509,12 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -700,6 +723,7 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= @@ -708,6 +732,7 @@ github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9 github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= @@ -774,8 +799,12 @@ github.com/hashicorp/terraform v0.12.31/go.mod h1:CBxNAiTW0pLap44/3GU4j7cYE2bMhk github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= +github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= +github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= github.com/hashicorp/terraform-plugin-sdk v1.6.0 h1:Um5hsAL7kKsfTHtan8lybY/d03F2bHu4fjRB1H6Ag4U= github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.1/go.mod h1:o3pdss6ynDZW9FfiZ+rETUH5LEVufrXdhwLU+5OiRo0= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= @@ -791,21 +820,27 @@ github.com/heroku/heroku-go/v5 v5.1.0/go.mod h1:d+1QrZyjbnQJG1f8xIoVvMQRFLt3XRVZ github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/interagent/schematic v0.0.0-20180830170528-b5e8ba7aa570/go.mod h1:4X9u5iNUePRrRDdwjok6skjlQBXTcNfWa4C3uS1+5SQ= github.com/jarcoal/httpmock v1.0.5 h1:cHtVEcTxRSX4J0je7mWPfc9BpDpqzXSJ5HbymZmyHck= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= github.com/jarcoal/httpmock v1.0.7/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jefferai/jsonx v1.0.1 h1:GvWkLWihoLqDG0BSP45TUQJH9qsINX50PVrFULgpc/I= github.com/jefferai/jsonx v1.0.1/go.mod h1:yFo3l2fcm7cZVHGq3HKLXE+Pd4RWuRjNBDHksM7XekQ= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -841,6 +876,7 @@ github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaR github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -890,6 +926,7 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e h1:qqXczln0qwkVGcpQ+sQuPOVntt2FytYarXXxYSNJkgw= github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -913,8 +950,9 @@ github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 h1:YH424zrwLTlyHS github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqKSQK1vIfQ+yVaFcGjDySHvym6FM1cNYnwzbrY= github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -966,10 +1004,10 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicksnyder/go-i18n v1.10.1 h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc= github.com/nicksnyder/go-i18n v1.10.1/go.mod h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/ns1/ns1-go v2.4.0+incompatible h1:WYLNc1preJKfVVJL0zCOXfePlREOwrpJrDhJNn1nnLI= github.com/ns1/ns1-go v2.4.0+incompatible/go.mod h1:+5cGIDXMoO+J3+C8FJ8J0xkyiTdgCvDA+JXQ7f1cPKs= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -1067,9 +1105,12 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1146,6 +1187,8 @@ github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYp github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= @@ -1155,6 +1198,7 @@ github.com/vultr/govultr v0.5.0/go.mod h1:wZZXZbYbqyY1n3AldoeYNZK4Wnmmoq6dNFkvd5 github.com/xanzy/go-gitlab v0.50.2 h1:Qm/um2Jryuqusc6VmN7iZYVTQVzNynzSiuMJDnCU1wE= github.com/xanzy/go-gitlab v0.50.2/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= @@ -1183,6 +1227,7 @@ github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= @@ -1229,9 +1274,12 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1325,6 +1373,7 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1380,6 +1429,7 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1413,8 +1463,11 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1488,10 +1541,12 @@ golang.org/x/tools v0.0.0-20200612022331-742c5eb664c2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200624163319-25775e59acb7/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201030143252-cf7a54d06671/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201105220310-78b158585360/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1572,6 +1627,7 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1602,6 +1658,7 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= @@ -1624,8 +1681,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -1650,6 +1708,7 @@ gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=