├── .gitattributes ├── .github ├── CODE_OF_CONDUCT.md ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── bug.yml │ └── enhancement.yml ├── PULL_REQUEST_TEMPLATE.md ├── SUPPORT.md ├── dependabot.yml ├── labels.yml ├── release.yml └── workflows │ ├── codeql.yml │ ├── integration_tests.yml │ ├── integration_tests_pr.yml │ ├── labeler.yml │ ├── nightly_smoke_tests.yml │ ├── pull_request.yml │ ├── release-notify-slack.yml │ ├── release.yml │ ├── stale.yml │ └── unit-tests.yml ├── .gitignore ├── .gitmodules ├── .golangci.yml ├── .goreleaser.yml ├── .markdownlint.yml ├── CHANGELOG.md ├── CODEOWNERS ├── CONTRIBUTING.md ├── EARLY_ACCESS.md ├── LICENSE ├── Makefile ├── README.md ├── docs ├── data-sources │ ├── account.md │ ├── account_availabilities.md │ ├── account_availability.md │ ├── account_login.md │ ├── account_logins.md │ ├── account_settings.md │ ├── child_account.md │ ├── child_accounts.md │ ├── database_backups.md │ ├── database_engines.md │ ├── database_mysql.md │ ├── database_mysql_backups.md │ ├── database_mysql_config.md │ ├── database_mysql_v2.md │ ├── database_postgresql.md │ ├── database_postgresql_config.md │ ├── database_postgresql_v2.md │ ├── databases.md │ ├── domain.md │ ├── domain_record.md │ ├── domain_zonefile.md │ ├── domains.md │ ├── firewall.md │ ├── firewalls.md │ ├── image.md │ ├── images.md │ ├── instance_backups.md │ ├── instance_networking.md │ ├── instance_type.md │ ├── instance_types.md │ ├── instances.md │ ├── ipv6_range.md │ ├── ipv6_ranges.md │ ├── kernel.md │ ├── kernels.md │ ├── lke_cluster.md │ ├── lke_clusters.md │ ├── lke_types.md │ ├── lke_version.md │ ├── lke_versions.md │ ├── network_transfer_prices.md │ ├── networking_ip.md │ ├── networking_ips.md │ ├── nodebalancer.md │ ├── nodebalancer_config.md │ ├── nodebalancer_configs.md │ ├── nodebalancer_node.md │ ├── nodebalancer_types.md │ ├── nodebalancers.md │ ├── object_storage_bucket.md │ ├── object_storage_cluster.md │ ├── object_storage_endpoints.md │ ├── object_storage_quota.md │ ├── object_storage_quotas.md │ ├── placement_group.md │ ├── placement_groups.md │ ├── profile.md │ ├── region.md │ ├── regions.md │ ├── sshkey.md │ ├── sshkeys.md │ ├── stackscript.md │ ├── stackscripts.md │ ├── user.md │ ├── users.md │ ├── vlans.md │ ├── volume.md │ ├── volume_types.md │ ├── volumes.md │ ├── vpc.md │ ├── vpc_ips.md │ ├── vpc_subnet.md │ ├── vpc_subnets.md │ └── vpcs.md ├── guides │ └── migrate_to_instance_config_and_disk_resources.md ├── index.md └── resources │ ├── account_settings.md │ ├── database_access_controls.md │ ├── database_mysql.md │ ├── database_mysql_v2.md │ ├── database_postgresql.md │ ├── database_postgresql_v2.md │ ├── domain.md │ ├── domain_record.md │ ├── firewall.md │ ├── firewall_device.md │ ├── image.md │ ├── instance.md │ ├── instance_config.md │ ├── instance_disk.md │ ├── instance_ip.md │ ├── instance_shared_ips.md │ ├── ipv6_range.md │ ├── lke_cluster.md │ ├── lke_node_pool.md │ ├── networking_ip.md │ ├── networking_ip_assignment.md │ ├── nodebalancer.md │ ├── nodebalancer_config.md │ ├── nodebalancer_node.md │ ├── object_storage_bucket.md │ ├── object_storage_key.md │ ├── object_storage_object.md │ ├── placement_group.md │ ├── placement_group_assignment.md │ ├── rdns.md │ ├── sshkey.md │ ├── stackscript.md │ ├── token.md │ ├── user.md │ ├── volume.md │ ├── vpc.md │ └── vpc_subnet.md ├── examples ├── lke_echo_server │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── providers.tf │ └── variable.tf ├── mysql_adminer │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variable.tf ├── nginx │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variable.tf └── obj_static_site │ ├── README.md │ ├── index.html │ ├── main.tf │ ├── outputs.tf │ └── variable.tf ├── go.mod ├── go.sum ├── linode ├── acceptance │ ├── database.go │ ├── instance.go │ ├── provider_factories.go │ ├── sweepers.go │ ├── test_retry.go │ ├── tmpl │ │ ├── e2e_test_firewall.gotf │ │ ├── provider_no_poll.gotf │ │ └── template.go │ ├── util.go │ └── util_test.go ├── account │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── accountavailabilities │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_filter_by_region.gotf │ │ └── template.go ├── accountavailability │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── accountlogin │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── accountlogins │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_filter_by_ip.gotf │ │ ├── data_filter_by_restricted.gotf │ │ ├── data_filter_by_status.gotf │ │ ├── data_filter_by_username.gotf │ │ └── template.go ├── accountsettings │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_model.go │ ├── framework_model_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── template.go │ │ └── updates.gotf ├── backup │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_model_unit_test.go │ ├── framework_models.go │ └── framework_schema_datasource.go ├── childaccount │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── childaccounts │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── databaseaccesscontrols │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── mysql.gotf │ │ ├── postgresql.gotf │ │ └── template.go ├── databasebackups │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── databaseengines │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_all.gotf │ │ ├── data_by_engine.gotf │ │ └── template.go ├── databasemysql │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── complex.gotf │ │ ├── complex_updates.gotf │ │ ├── data_basic.gotf │ │ └── template.go ├── databasemysqlbackups │ ├── datasource.go │ ├── datasource_test.go │ ├── schema_datasource.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── databasemysqlconfig │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── databasemysqlv2 │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── complex.gotf │ │ ├── data.gotf │ │ ├── data_engine_config.gotf │ │ ├── engine_config.gotf │ │ ├── engine_config_nullable_field.gotf │ │ ├── fork.gotf │ │ ├── suspension.gotf │ │ └── template.go ├── databasepostgresql │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── complex.gotf │ │ ├── complex_updates.gotf │ │ ├── data_basic.gotf │ │ └── template.go ├── databasepostgresqlconfig │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── databasepostgresqlv2 │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── framework_schema_datasource.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── complex.gotf │ │ ├── data.gotf │ │ ├── data_engine_config.gotf │ │ ├── engine_config.gotf │ │ ├── engine_config_update.gotf │ │ ├── fork.gotf │ │ ├── suspension.gotf │ │ └── template.go ├── databases │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── by_engine.gotf │ │ ├── by_label.gotf │ │ └── template.go ├── domain │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_schema_datasource.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── data_byid.gotf │ │ ├── ips.gotf │ │ ├── ips_update.gotf │ │ ├── rounded_sec.gotf │ │ ├── template.go │ │ ├── updates.gotf │ │ └── zero_sec.gotf ├── domainrecord │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── a_noname.gotf │ │ ├── aaaa_noname.gotf │ │ ├── basic.gotf │ │ ├── caa_noname.gotf │ │ ├── data_basic.gotf │ │ ├── data_caa.gotf │ │ ├── data_id.gotf │ │ ├── data_srv.gotf │ │ ├── srv.gotf │ │ ├── template.go │ │ ├── ttl.gotf │ │ ├── updates.gotf │ │ └── with_domain.gotf ├── domains │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema.go │ └── tmpl │ │ ├── data_api_filter.gotf │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_filter.gotf │ │ └── template.go ├── domainzonefile │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_datasource_unit_test.go │ └── tmpl │ │ ├── basic.gotf │ │ └── template.go ├── firewall │ ├── firewall_helpers_unit_test.go │ ├── framework_datasource.go │ ├── framework_datasource_test.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_test.go │ ├── framework_schema_datasource.go │ ├── framework_schema_resource.go │ ├── helpers.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── inst.gotf │ │ ├── minimum.gotf │ │ ├── multiple_rules.gotf │ │ ├── nb.gotf │ │ ├── no_device.gotf │ │ ├── no_ipv6.gotf │ │ ├── no_rules.gotf │ │ ├── template.go │ │ └── updates.gotf ├── firewalldevice │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── detached.gotf │ │ ├── firewall.gotf │ │ ├── instance.gotf │ │ ├── template.go │ │ └── with_nodebalancer.gotf ├── firewalls │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema.go │ └── tmpl │ │ ├── data_all.gotf │ │ ├── data_base.gotf │ │ ├── data_filter.gotf │ │ └── template.go ├── framework_provider.go ├── framework_provider_config.go ├── framework_provider_test.go ├── helper │ ├── base_pricing_types.go │ ├── batch.go │ ├── compare.go │ ├── config.go │ ├── constant.go │ ├── conversion.go │ ├── customdiffs │ │ ├── caseinsensitiveset.go │ │ ├── caseinsensitiveset_test.go │ │ └── computedwithdefault.go │ ├── customtypes │ │ ├── ip.go │ │ ├── ip_test.go │ │ └── scopes.go │ ├── database.go │ ├── database_test.go │ ├── default_value.go │ ├── domain.go │ ├── earlyaccess.go │ ├── earlyaccess_test.go │ ├── events.go │ ├── expand.go │ ├── filepath.go │ ├── filepath_test.go │ ├── filter.go │ ├── filter_test.go │ ├── framework_conversion.go │ ├── framework_converter.go │ ├── framework_data.go │ ├── framework_datasource_base.go │ ├── framework_import.go │ ├── framework_provider_model.go │ ├── framework_resource_base.go │ ├── framework_schema.go │ ├── framework_util.go │ ├── frameworkfilter │ │ ├── api_filter.go │ │ ├── api_filter_test.go │ │ ├── filter.go │ │ ├── filter_test.go │ │ ├── latest.go │ │ ├── latest_test.go │ │ ├── local_filter.go │ │ ├── local_filter_test.go │ │ ├── struct.go │ │ ├── struct_test.go │ │ ├── validators.go │ │ └── validators_test.go │ ├── http.go │ ├── instance.go │ ├── instance_helpers_test.go │ ├── iterator.go │ ├── logging.go │ ├── normalize.go │ ├── normalize_test.go │ ├── objects.go │ ├── planmodifiers │ │ ├── caseinsensitiveset.go │ │ └── caseinsensitiveset_test.go │ ├── regex.go │ ├── regex_test.go │ ├── resource_datasource_config.go │ ├── retry.go │ ├── sdkv2_cty.go │ ├── sdkv2_cty_test.go │ ├── sdkv2_validators.go │ ├── sdkv2_validators_test.go │ ├── statecheck.go │ ├── stateupgrade │ │ ├── rfc3339.go │ │ └── rfc3339_test.go │ ├── unit │ │ └── framework_util.go │ └── version.go ├── image │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_schema_datasource.go │ ├── framework_schema_resource.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── data_replicate.gotf │ │ ├── no_replica_regions.gotf │ │ ├── replicate.gotf │ │ ├── template.go │ │ ├── updates.gotf │ │ └── upload.gotf ├── images │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_clientfilter.gotf │ │ ├── data_latest.gotf │ │ ├── data_latest_empty.gotf │ │ ├── data_order.gotf │ │ ├── data_substring.gotf │ │ └── template.go ├── instance │ ├── datasource.go │ ├── datasource_test.go │ ├── expand.go │ ├── expand_unit_test.go │ ├── flatten.go │ ├── flatten_unit_test.go │ ├── helpers.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_datasource.go │ ├── schema_resource.go │ └── tmpl │ │ ├── template.go │ │ └── templates │ │ ├── authorized_keys_empty.gotf │ │ ├── authorized_users.gotf │ │ ├── basic.gotf │ │ ├── config_interfaces.gotf │ │ ├── config_interfaces_multiple.gotf │ │ ├── config_interfaces_update.gotf │ │ ├── config_interfaces_update_empty.gotf │ │ ├── config_interfaces_update_no_reboot.gotf │ │ ├── config_updates.gotf │ │ ├── configs_all_updated.gotf │ │ ├── data_basic.gotf │ │ ├── data_clientfilter.gotf │ │ ├── data_multiple.gotf │ │ ├── data_multiple_base.gotf │ │ ├── data_multiple_order.gotf │ │ ├── data_multiple_regex.gotf │ │ ├── data_with_block_storage_encryption.gotf │ │ ├── data_with_pg.gotf │ │ ├── disk.gotf │ │ ├── disk_authorized_keys_empty.gotf │ │ ├── disk_boot_image.gotf │ │ ├── disk_config.gotf │ │ ├── disk_config_expanded.gotf │ │ ├── disk_config_multiple.gotf │ │ ├── disk_config_reordered.gotf │ │ ├── disk_config_resized.gotf │ │ ├── disk_config_resized_expanded.gotf │ │ ├── disk_encryption.gotf │ │ ├── disk_multiple.gotf │ │ ├── disk_stackscript.gotf │ │ ├── firewall_on_creation.gotf │ │ ├── full_disk.gotf │ │ ├── instance_with_reserved_ip.gotf │ │ ├── interfaces.gotf │ │ ├── interfaces_update.gotf │ │ ├── interfaces_update_empty.gotf │ │ ├── ipv4_sharing.gotf │ │ ├── ipv4_sharing_allocation.gotf │ │ ├── ipv4_sharing_bad_input.gotf │ │ ├── ipv4_sharing_empty.gotf │ │ ├── many_linodes.gotf │ │ ├── multiple_configs.gotf │ │ ├── no_image.gotf │ │ ├── power_state.gotf │ │ ├── power_state_config.gotf │ │ ├── power_state_interface.gotf │ │ ├── power_state_noimage.gotf │ │ ├── private_image.gotf │ │ ├── private_networking.gotf │ │ ├── public_interface.gotf │ │ ├── public_vpc_interface.gotf │ │ ├── raw_disk.gotf │ │ ├── raw_disk_deleted.gotf │ │ ├── raw_disk_expanded.gotf │ │ ├── stackscript.gotf │ │ ├── tag.gotf │ │ ├── tag_update.gotf │ │ ├── tag_update_case_change.gotf │ │ ├── tag_volume.gotf │ │ ├── type_change_disk.gotf │ │ ├── type_change_disk_explicit.gotf │ │ ├── type_change_disk_none.gotf │ │ ├── type_change_warm.gotf │ │ ├── updates.gotf │ │ ├── userdata.gotf │ │ ├── volume_config.gotf │ │ ├── vpc_interface.gotf │ │ ├── vpc_public_interface.gotf │ │ ├── vpu.gotf │ │ ├── watchdog_disabled.gotf │ │ ├── with_config.gotf │ │ ├── with_pg.gotf │ │ ├── with_swapsize.gotf │ │ └── with_type.gotf ├── instanceconfig │ ├── helper.go │ ├── helper_test.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── booted.gotf │ │ ├── booted_swap.gotf │ │ ├── complex.gotf │ │ ├── complex_updates.gotf │ │ ├── device_block.gotf │ │ ├── device_named_block.gotf │ │ ├── empty_instance.gotf │ │ ├── instance_disk.gotf │ │ ├── instance_disk_with_swap.gotf │ │ ├── provisioner.gotf │ │ ├── template.go │ │ ├── vpc.gotf │ │ ├── vpc_interface.gotf │ │ ├── vpc_interface_only.gotf │ │ ├── vpc_interface_removed.gotf │ │ ├── vpc_interface_swapped.gotf │ │ └── vpc_interface_updated.gotf ├── instancedisk │ ├── framework_model.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── helper.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── booted_resize.gotf │ │ ├── complex.gotf │ │ └── template.go ├── instanceip │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── no_boot.gotf │ │ └── template.go ├── instancenetworking │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_basic_reserved.gotf │ │ ├── data_vpc.gotf │ │ └── template.go ├── instancereservedipassignment │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── AddReservedIPToInstance.gotf │ │ └── template.go ├── instancesharedips │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── configs.gotf │ │ └── template.go ├── instancetype │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── instancetypes │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_by_class.gotf │ │ ├── data_regex.gotf │ │ ├── data_substring.gotf │ │ └── template.go ├── ipv6range │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_schema_resource.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── no_id.gotf │ │ ├── race_condition.gotf │ │ ├── reassignment.gotf │ │ ├── route_target.gotf │ │ └── template.go ├── ipv6ranges │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── kernel │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── kernels │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_filter.gotf │ │ ├── data_filter_empty.gotf │ │ └── template.go ├── lke │ ├── cluster.go │ ├── cluster_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_datasource_test.go │ ├── framework_models.go │ ├── framework_resource_test.go │ ├── resource.go │ ├── schema_resource.go │ └── tmpl │ │ ├── acl_disabled_addresses_disallowed.gotf │ │ ├── apl.gotf │ │ ├── autoscaler.gotf │ │ ├── autoscaler_many_pools.gotf │ │ ├── autoscaler_no_count.gotf │ │ ├── autoscaler_updates.gotf │ │ ├── basic.gotf │ │ ├── complex_pools.gotf │ │ ├── control_plane.gotf │ │ ├── data_autoscaler.gotf │ │ ├── data_basic.gotf │ │ ├── data_control_plane.gotf │ │ ├── data_taints_labels.gotf │ │ ├── enterprise.gotf │ │ ├── many_pools.gotf │ │ ├── no_count.gotf │ │ ├── taints_labels.gotf │ │ ├── template.go │ │ └── updates.gotf ├── lkeclusters │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_filter.gotf │ │ └── template.go ├── lkenodepool │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── framework_resource_test.go │ ├── nodepool.go │ └── tmpl │ │ ├── lke_e_nodepool.gotf │ │ ├── nodepool.gotf │ │ └── template.go ├── lketypes │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── lkeversion │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_no_tier.gotf │ │ ├── data_tier.gotf │ │ └── template.go ├── lkeversions │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_no_tier.gotf │ │ ├── data_tier.gotf │ │ └── template.go ├── nb │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── data_firewalls.gotf │ │ ├── firewall.gotf │ │ ├── firewall_updates.gotf │ │ ├── template.go │ │ └── updates.gotf ├── nbconfig │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_schema_datasource.go │ ├── framework_schema_resource.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── proxy_protocol.gotf │ │ ├── ssl.gotf │ │ ├── template.go │ │ └── updates.gotf ├── nbconfigs │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_filter.gotf │ │ └── template.go ├── nbnode │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── networking.gotf │ │ ├── template.go │ │ └── updates.gotf ├── nbs │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_filter.gotf │ │ ├── data_filter_empty.gotf │ │ ├── data_order.gotf │ │ └── template.go ├── nbtypes │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── networkingip │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_model.go │ ├── framework_datasource_schema.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_model.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── reserved_assigned.gotf │ │ └── template.go ├── networkingipassignment │ ├── framework_resource.go │ ├── framework_resource_model.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── network_ip_assign.gotf │ │ └── template.go ├── networkingips │ ├── datasource_test.go │ ├── famework_datasource_schema.go │ ├── framework_datasource.go │ ├── framework_datasource_models.go │ └── tmpl │ │ ├── data_filter.gotf │ │ ├── data_list.gotf │ │ └── template.go ├── networktransferprices │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── obj │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── helpers.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── creds_configed.gotf │ │ ├── temp_keys.gotf │ │ ├── template.go │ │ └── updates.gotf ├── objbucket │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── helpers.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── access.gotf │ │ ├── basic.gotf │ │ ├── cert.gotf │ │ ├── cluster_data_basic.gotf │ │ ├── creds_configed.gotf │ │ ├── data_basic.gotf │ │ ├── endpoint_type.gotf │ │ ├── endpoint_url.gotf │ │ ├── force_delete.gotf │ │ ├── force_delete_empty.gotf │ │ ├── lifecycle.gotf │ │ ├── lifecycle_no_id.gotf │ │ ├── temp_keys.gotf │ │ ├── template.go │ │ ├── updates.gotf │ │ └── versioning.gotf ├── objcluster │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── objendpoints │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_datasource_test.go │ ├── framework_models.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── filter.gotf │ │ └── template.go ├── objkey │ ├── framework_model.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── framework_resource_test.go │ ├── helpers.go │ └── tmpl │ │ ├── all_regions.gotf │ │ ├── basic.gotf │ │ ├── limited.gotf │ │ ├── template.go │ │ └── updates.gotf ├── objquota │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── objquotas │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_model.go │ └── tmpl │ │ ├── data_filter.gotf │ │ └── template.go ├── placementgroup │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_schema_resource.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ └── template.go ├── placementgroupassignment │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ └── template.go ├── placementgroups │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── profile │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── provider.go ├── provider_test.go ├── rdns │ ├── framework_helper.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── changed.gotf │ │ ├── deleted.gotf │ │ ├── template.go │ │ ├── with_timeout.gotf │ │ └── with_timeout_updated.gotf ├── region │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── regions │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_filter_by_capabilities.gotf │ │ ├── data_filter_by_country.gotf │ │ ├── data_filter_by_status.gotf │ │ └── template.go ├── sshkey │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_resource.go │ ├── framework_resource_model.go │ ├── framework_resource_models_unit_test.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── template.go │ │ └── updates.gotf ├── sshkeys │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ └── tmpl │ │ ├── data_all.gotf │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_filter.gotf │ │ ├── data_filter_empty.gotf │ │ └── template.go ├── stackscript │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── code_change.gotf │ │ ├── data_basic.gotf │ │ └── template.go ├── stackscripts │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_clientfilter.gotf │ │ ├── data_latest.gotf │ │ ├── data_substring.gotf │ │ └── template.go ├── token │ ├── framework_model.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_resource_schema.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── recreate_new_expiry_date.gotf │ │ ├── recreate_new_scopes.gotf │ │ ├── template.go │ │ └── updates.gotf ├── user │ ├── datasource_test.go │ ├── flatten.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── resource.go │ ├── resource_test.go │ ├── schema_resource.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── data_grants.gotf │ │ ├── data_nouser.gotf │ │ ├── grants.gotf │ │ ├── grants_update.gotf │ │ └── template.go ├── users │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_base.gotf │ │ ├── data_basic.gotf │ │ ├── data_clientfilter.gotf │ │ ├── data_substring.gotf │ │ └── template.go ├── vlan │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_model.go │ ├── framework_models_unit_test.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_check_duplicate.gotf │ │ ├── data_regex.gotf │ │ └── template.go ├── volume │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_models_unit_test.go │ ├── framework_resource.go │ ├── framework_schema_datasource.go │ ├── framework_schema_resource.go │ ├── resource_test.go │ └── tmpl │ │ ├── attached.gotf │ │ ├── basic.gotf │ │ ├── cloned.gotf │ │ ├── data_basic.gotf │ │ ├── data_with_block_storage_encryption.gotf │ │ ├── reattached.gotf │ │ ├── resized.gotf │ │ ├── template.go │ │ ├── updates.gotf │ │ └── updates_tags_case_change.gotf ├── volumes │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── volumetypes │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_datasource_schema.go │ ├── framework_models.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── vpc │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_schema_datasource.go │ ├── framework_schema_resource.go │ ├── resource_test.go │ └── tmpl │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── template.go │ │ └── updates.gotf ├── vpcips │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_basic.gotf │ │ └── template.go ├── vpcs │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema_datasource.go │ └── tmpl │ │ ├── data_basic.gotf │ │ ├── data_filter_label.gotf │ │ └── template.go ├── vpcsubnet │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_resource.go │ ├── framework_schema_datasource.go │ ├── framework_schema_resource.go │ ├── resource_test.go │ └── tmpl │ │ ├── attached.gotf │ │ ├── basic.gotf │ │ ├── data_basic.gotf │ │ ├── template.go │ │ └── updates.gotf └── vpcsubnets │ ├── datasource_test.go │ ├── framework_datasource.go │ ├── framework_models.go │ ├── framework_schema_datasource.go │ └── tmpl │ ├── data_basic.gotf │ ├── data_filter_label.gotf │ └── template.go ├── main.go ├── tools ├── go.mod ├── go.sum └── tools.go └── version └── version.go /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code. 4 | 5 | Please read the full text at https://www.hashicorp.com/community-guidelines 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## 📝 Description 2 | 3 | **What does this PR do and why is this change necessary?** 4 | 5 | ## ✔️ How to Test 6 | 7 | **What are the steps to reproduce the issue or verify the changes?** 8 | 9 | **How do I run the relevant unit/integration tests?** 10 | 11 | ## 📷 Preview 12 | 13 | **If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.** -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | Terraform is a mature project with a growing community. There are active, dedicated people willing to help you through various mediums. 4 | 5 | Take a look at those mediums listed at https://www.terraform.io/community.html 6 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: 'Stale issue handler' 2 | on: 3 | workflow_dispatch: null 4 | schedule: 5 | - cron: '0 0 * * *' 6 | 7 | jobs: 8 | stale: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/stale@v9 12 | id: stale 13 | with: 14 | stale-issue-message: 'This issue is stale because it has been open 30 days with 15 | no activity. Remove stale label or comment or this will be closed in 16 | 5 days' 17 | days-before-stale: 30 18 | days-before-close: 5 19 | exempt-issue-labels: 'blocked,must,should,keep' 20 | - name: Print outputs 21 | run: echo ${{ join(steps.stale.outputs.*, ',') }} 22 | -------------------------------------------------------------------------------- /.github/workflows/unit-tests.yml: -------------------------------------------------------------------------------- 1 | name: Unit Tests 2 | on: 3 | workflow_dispatch: null 4 | push: 5 | 6 | jobs: 7 | unit_tests: 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - name: Checkout code 12 | uses: actions/checkout@v4 13 | 14 | - name: Set up Go 15 | uses: actions/setup-go@v5 16 | with: 17 | go-version: 'stable' 18 | 19 | - run: go version 20 | 21 | - name: Install deps 22 | run: make deps 23 | 24 | - name: Run unit tests 25 | run: make test-unit 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.dll 2 | *.exe 3 | .DS_Store 4 | *.backup 5 | *.log 6 | *.bak 7 | *~ 8 | .*.swp 9 | *.iml 10 | *.test 11 | 12 | # tf 13 | .terraform/ 14 | ./*.tfstate 15 | example.tf 16 | terraform.tfplan 17 | terraform.tfstate 18 | 19 | # directories 20 | bin/ 21 | modules-dev/ 22 | /pkg/ 23 | .vagrant/ 24 | 25 | # editors 26 | .vscode 27 | .idea 28 | 29 | # Test exclusions 30 | !command/test-fixtures/**/*.tfstate 31 | !command/test-fixtures/**/.terraform/ 32 | 33 | # Binary exclusions 34 | terraform-provider-linode 35 | .go-version 36 | 37 | dist/** 38 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "e2e_scripts"] 2 | path = e2e_scripts 3 | url = https://github.com/linode/dx-e2e-test-scripts 4 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | # GolangCI-Lint configuration 2 | # See https://github.com/golangci/golangci-lint#configuration 3 | 4 | run: 5 | tests: false 6 | timeout: 2m 7 | 8 | linters-settings: 9 | revive: 10 | rules: 11 | - name: unused-parameter 12 | severity: warning 13 | disabled: true 14 | errcheck: 15 | exclude-functions: 16 | - (*github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.ResourceData).Set 17 | - (*github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.ResourceDiff).SetNewComputed 18 | 19 | gomoddirectives: 20 | replace-allow-list: 21 | - github.com/linode/linodego 22 | 23 | govet: 24 | disable: 25 | - shadow 26 | dupl: 27 | threshold: 100 28 | 29 | linters: 30 | fast: false 31 | -------------------------------------------------------------------------------- /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # Configuration for markdownlint 2 | # https://github.com/DavidAnson/markdownlint#configuration 3 | default: true 4 | 5 | # Disabled Rules 6 | # https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md 7 | line-length: false 8 | fenced-code-language: false 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Release notes for this project are kept here: https://github.com/linode/terraform-provider-linode/releases 2 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @linode/dx 2 | -------------------------------------------------------------------------------- /EARLY_ACCESS.md: -------------------------------------------------------------------------------- 1 | # Early Access 2 | 3 | Some resources are made available before the feature reaches general availability. These resources are subject to change, and may not be available to all customers in all regions. Early access features can be accessed by configuring the provider to use a different version of the API. 4 | 5 | ## Configuring the API Version 6 | 7 | The `api_version` can be set on the provider block like so: 8 | 9 | ```terraform 10 | provider "linode" { 11 | api_version = "v4beta" 12 | } 13 | ``` 14 | 15 | Additionally, the version can be set with the `LINODE_API_VERSION` environment variable. 16 | -------------------------------------------------------------------------------- /examples/lke_echo_server/outputs.tf: -------------------------------------------------------------------------------- 1 | output "loadbalancer-ip" { 2 | value = local.loadbalancer_ingress.ip 3 | } 4 | 5 | output "loadbalancer-hostname" { 6 | value = local.loadbalancer_ingress.hostname 7 | } 8 | 9 | output "echo-service-endpoint" { 10 | value = "http://${local.loadbalancer_ingress.ip}/" 11 | } 12 | -------------------------------------------------------------------------------- /examples/lke_echo_server/providers.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | linode = { 4 | source = "linode/linode" 5 | } 6 | } 7 | } 8 | 9 | provider "linode" { 10 | token = var.linode_token 11 | } 12 | 13 | provider "kubernetes" { 14 | host = local.api_endpoint 15 | token = local.api_token 16 | 17 | cluster_ca_certificate = local.ca_certificate 18 | } -------------------------------------------------------------------------------- /examples/lke_echo_server/variable.tf: -------------------------------------------------------------------------------- 1 | variable "linode_token" { 2 | description = "Linode APIv4 Personal Access Token" 3 | } 4 | 5 | variable "region" { 6 | description = "The region to deploy the LKE cluster in." 7 | default = "us-east" 8 | } 9 | 10 | 11 | variable "echo_message" { 12 | description = "The message to be echoed by the echo server." 13 | default = "Provisioned using Terraform and LKE!" 14 | } 15 | 16 | variable "replica_count" { 17 | description = "The number of replicas of the echo server." 18 | default = 3 19 | } 20 | 21 | variable "pool_count" { 22 | description = "The number of instances to provision in the LKE cluster." 23 | default = 3 24 | } -------------------------------------------------------------------------------- /examples/mysql_adminer/outputs.tf: -------------------------------------------------------------------------------- 1 | output "adminer-url" { 2 | value = "http://${linode_instance.adminer.ip_address}:${var.adminer_port}/" 3 | } 4 | 5 | output "mysql-user" { 6 | value = var.mysql_user 7 | } 8 | 9 | output "mysql-vlan-ipv4" { 10 | value = replace(linode_instance.mysql.interface.1.ipam_address, "/24", "") 11 | } 12 | 13 | output "adminer-vlan-ipv4" { 14 | value = replace(linode_instance.adminer.interface.1.ipam_address, "/24", "") 15 | } -------------------------------------------------------------------------------- /examples/obj_static_site/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | :) 5 | 6 | 7 |

Provisioned by Terraform!

8 | 9 | -------------------------------------------------------------------------------- /examples/obj_static_site/outputs.tf: -------------------------------------------------------------------------------- 1 | output "website-url" { 2 | value = "http://${linode_object_storage_bucket.website.label}.website-${linode_object_storage_bucket.website.cluster}.linodeobjects.com/" 3 | } -------------------------------------------------------------------------------- /examples/obj_static_site/variable.tf: -------------------------------------------------------------------------------- 1 | variable "linode_token" { 2 | description = "Linode APIv4 Personal Access Token" 3 | } 4 | 5 | variable "cluster" { 6 | description = "The name of the Object Storage cluster to deploy to." 7 | default = "us-east-1" 8 | } 9 | 10 | variable "bucket_name" { 11 | description = "The name of the Object Storage bucket to create." 12 | type = string 13 | } -------------------------------------------------------------------------------- /linode/acceptance/tmpl/provider_no_poll.gotf: -------------------------------------------------------------------------------- 1 | {{ define "provider_no_poll" }} 2 | 3 | provider "linode" { 4 | skip_instance_delete_poll = true 5 | skip_instance_ready_poll = true 6 | } 7 | 8 | {{ end }} -------------------------------------------------------------------------------- /linode/acceptance/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | // ProviderNoPoll is used to configure the provider to disable instance 10 | // polling. 11 | func ProviderNoPoll(t testing.TB) string { 12 | return acceptance.ExecuteTemplate(t, 13 | "provider_no_poll", nil, 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /linode/account/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_data_basic" }} 2 | 3 | data "linode_account" "foo" {} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /linode/account/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct{} 10 | 11 | func DataBasic(t testing.TB) string { 12 | return acceptance.ExecuteTemplate(t, 13 | "account_data_basic", nil) 14 | } 15 | -------------------------------------------------------------------------------- /linode/accountavailabilities/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_availabilities_data_basic" }} 2 | 3 | data "linode_account_availabilities" "foobar" {} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /linode/accountavailabilities/tmpl/data_filter_by_region.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_availabilities_data_by_region" }} 2 | 3 | data "linode_account_availabilities" "foobar" { 4 | filter { 5 | name = "region" 6 | values = ["{{ .Region }}"] 7 | } 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/accountavailabilities/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Region string 11 | Unavailable string 12 | } 13 | 14 | func DataBasic(t testing.TB) string { 15 | return acceptance.ExecuteTemplate(t, 16 | "account_availabilities_data_basic", nil) 17 | } 18 | 19 | func DataFilterRegion(t testing.TB, region string) string { 20 | return acceptance.ExecuteTemplate(t, 21 | "account_availabilities_data_by_region", TemplateData{ 22 | Region: region, 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /linode/accountavailability/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_availability_data_basic" }} 2 | 3 | data "linode_account_availability" "foobar" { 4 | region = "{{.Region}}" 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/accountavailability/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Region string 11 | } 12 | 13 | func DataBasic(t testing.TB, region string) string { 14 | return acceptance.ExecuteTemplate(t, 15 | "account_availability_data_basic", TemplateData{ 16 | Region: region, 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /linode/accountlogin/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_login_data_basic" }} 2 | 3 | data "linode_account_login" "foobar" { 4 | id = "{{.ID}}" 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/accountlogin/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | ID int 11 | } 12 | 13 | func DataBasic(t testing.TB, id int) string { 14 | return acceptance.ExecuteTemplate(t, 15 | "account_login_data_basic", TemplateData{ 16 | ID: id, 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /linode/accountlogins/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_logins_data_basic" }} 2 | 3 | data "linode_account_logins" "foobar" {} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /linode/accountlogins/tmpl/data_filter_by_ip.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_logins_data_filter_by_ip" }} 2 | 3 | data "linode_account_logins" "foobar" { 4 | filter { 5 | name = "ip" 6 | values = ["{{ .IP }}"] 7 | } 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/accountlogins/tmpl/data_filter_by_restricted.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_logins_data_filter_by_restricted" }} 2 | 3 | data "linode_account_logins" "foobar" { 4 | filter { 5 | name = "restricted" 6 | values = ["{{ .Restricted }}"] 7 | } 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/accountlogins/tmpl/data_filter_by_status.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_logins_data_filter_by_status" }} 2 | 3 | data "linode_account_logins" "foobar" { 4 | filter { 5 | name = "status" 6 | values = ["{{ .Status }}"] 7 | } 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/accountlogins/tmpl/data_filter_by_username.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_logins_data_filter_by_username" }} 2 | 3 | data "linode_account_logins" "foobar" { 4 | filter { 5 | name = "username" 6 | values = ["{{ .Username }}"] 7 | } 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/accountsettings/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_settings_basic" }} 2 | 3 | resource "linode_account_settings" "foobar" {} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /linode/accountsettings/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_settings_data_basic" }} 2 | 3 | data "linode_account_settings" "foobar" {} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /linode/accountsettings/tmpl/updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "account_settings_updates" }} 2 | 3 | resource "linode_account_settings" "foobar" { 4 | longview_subscription = "{{ .LongviewSubscription }}" 5 | backups_enabled = "{{ .BackupsEnabled }}" 6 | network_helper = "{{ .NetworkHelper }}" 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/childaccount/framework_datasource_schema.go: -------------------------------------------------------------------------------- 1 | package childaccount 2 | 3 | import ( 4 | "github.com/hashicorp/terraform-plugin-framework/datasource/schema" 5 | "github.com/linode/terraform-provider-linode/v2/linode/account" 6 | ) 7 | 8 | func dataSourceSchema() *schema.Schema { 9 | result := account.DataSourceSchema() 10 | 11 | // This is a bit evil but allows us to avoid redefining the entire 12 | // account schema. 13 | result.Attributes["euuid"] = schema.StringAttribute{ 14 | Description: "The unique ID of this Account.", 15 | Required: true, 16 | } 17 | 18 | return &result 19 | } 20 | -------------------------------------------------------------------------------- /linode/childaccount/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "child_account_data_basic" }} 2 | 3 | data "linode_child_accounts" "all" {} 4 | 5 | data "linode_child_account" "foo" { 6 | depends_on = [data.linode_child_accounts.all] 7 | euuid = data.linode_child_accounts.all.child_accounts[0].euuid 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/childaccount/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct{} 10 | 11 | func DataBasic(t testing.TB) string { 12 | return acceptance.ExecuteTemplate(t, 13 | "child_account_data_basic", nil) 14 | } 15 | -------------------------------------------------------------------------------- /linode/childaccounts/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "child_accounts_data_basic" }} 2 | 3 | data "linode_child_accounts" "all" {} 4 | 5 | data "linode_child_accounts" "filter" { 6 | depends_on = [data.linode_child_accounts.all] 7 | 8 | filter { 9 | name = "email" 10 | values = [data.linode_child_accounts.all.child_accounts[0].email] 11 | } 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/childaccounts/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | func DataBasic(t testing.TB) string { 10 | return acceptance.ExecuteTemplate(t, 11 | "child_accounts_data_basic", nil) 12 | } 13 | -------------------------------------------------------------------------------- /linode/databaseaccesscontrols/tmpl/mysql.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_access_controls_mysql" }} 2 | 3 | resource "linode_database_mysql_v2" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | } 9 | 10 | resource "linode_database_access_controls" "foobar" { 11 | database_id = linode_database_mysql_v2.foobar.id 12 | database_type = "mysql" 13 | 14 | allow_list = ["{{.AllowedIP}}"] 15 | } 16 | 17 | {{ end }} 18 | -------------------------------------------------------------------------------- /linode/databaseaccesscontrols/tmpl/postgresql.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_access_controls_postgresql" }} 2 | 3 | resource "linode_database_postgresql_v2" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | } 9 | 10 | resource "linode_database_access_controls" "foobar" { 11 | database_id = linode_database_postgresql_v2.foobar.id 12 | database_type = "postgresql" 13 | 14 | allow_list = ["{{.AllowedIP}}"] 15 | } 16 | 17 | {{ end }} 18 | -------------------------------------------------------------------------------- /linode/databasebackups/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_backups_data_basic" }} 2 | 3 | resource "linode_database_postgresql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | } 9 | 10 | data "linode_database_backups" "foobar" { 11 | database_id = linode_database_postgresql.foobar.id 12 | database_type = "postgresql" 13 | 14 | filter { 15 | name = "type" 16 | values = ["snapshot"] 17 | } 18 | 19 | filter { 20 | name = "label" 21 | values = ["{{.BackupLabel}}"] 22 | } 23 | } 24 | 25 | {{ end }} -------------------------------------------------------------------------------- /linode/databasebackups/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Engine string 11 | Label string 12 | BackupLabel string 13 | Region string 14 | } 15 | 16 | func DataBasic(t testing.TB, data TemplateData) string { 17 | return acceptance.ExecuteTemplate(t, 18 | "database_backups_data_basic", data) 19 | } 20 | -------------------------------------------------------------------------------- /linode/databaseengines/tmpl/data_all.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_engines_data_all" }} 2 | 3 | data "linode_database_engines" "foobar" {} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /linode/databaseengines/tmpl/data_by_engine.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_engines_data_by_engine" }} 2 | 3 | data "linode_database_engines" "foobar" { 4 | filter { 5 | name = "engine" 6 | values = ["mysql"] 7 | } 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/databaseengines/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct{} 10 | 11 | func DataAll(t testing.TB) string { 12 | return acceptance.ExecuteTemplate(t, 13 | "database_engines_data_all", nil) 14 | } 15 | 16 | func DataByEngine(t testing.TB) string { 17 | return acceptance.ExecuteTemplate(t, 18 | "database_engines_data_by_engine", nil) 19 | } 20 | -------------------------------------------------------------------------------- /linode/databasemysql/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_basic" }} 2 | 3 | resource "linode_database_mysql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysql/tmpl/complex.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_complex" }} 2 | 3 | resource "linode_database_mysql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | 9 | allow_list = ["{{.AllowedIP}}"] 10 | cluster_size = {{.ClusterSize}} 11 | encrypted = {{.Encrypted}} 12 | replication_type = "{{.ReplicationType}}" 13 | ssl_connection = {{.SSLConnection}} 14 | 15 | updates { 16 | day_of_week = "saturday" 17 | duration = 1 18 | frequency = "monthly" 19 | hour_of_day = 22 20 | week_of_month = 2 21 | } 22 | } 23 | 24 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysql/tmpl/complex_updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_complex_updates" }} 2 | 3 | resource "linode_database_mysql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | 9 | allow_list = ["{{.AllowedIP}}"] 10 | cluster_size = {{.ClusterSize}} 11 | encrypted = {{.Encrypted}} 12 | replication_type = "{{.ReplicationType}}" 13 | ssl_connection = {{.SSLConnection}} 14 | 15 | updates { 16 | day_of_week = "wednesday" 17 | duration = 3 18 | frequency = "weekly" 19 | hour_of_day = 13 20 | } 21 | } 22 | 23 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysql/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_data_basic" }} 2 | 3 | {{ template "database_mysql_complex" . }} 4 | 5 | data "linode_database_mysql" "foobar" { 6 | database_id = linode_database_mysql.foobar.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysqlbackups/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_backups_data_basic" }} 2 | 3 | resource "linode_database_mysql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | } 9 | 10 | data "linode_database_mysql_backups" "foobar" { 11 | database_id = linode_database_mysql.foobar.id 12 | 13 | filter { 14 | name = "type" 15 | values = ["snapshot"] 16 | } 17 | 18 | filter { 19 | name = "label" 20 | values = ["{{.BackupLabel}}"] 21 | } 22 | } 23 | 24 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysqlbackups/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Engine string 11 | Label string 12 | BackupLabel string 13 | Region string 14 | } 15 | 16 | func DataBasic(t testing.TB, data TemplateData) string { 17 | return acceptance.ExecuteTemplate(t, 18 | "database_mysql_backups_data_basic", data) 19 | } 20 | -------------------------------------------------------------------------------- /linode/databasemysqlconfig/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_config_data_basic" }} 2 | 3 | data "linode_database_mysql_config" "foobar" {} 4 | 5 | {{ end }} 6 | -------------------------------------------------------------------------------- /linode/databasemysqlconfig/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | func DataBasic(t testing.TB) string { 10 | return acceptance.ExecuteTemplate(t, 11 | "database_mysql_config_data_basic", nil) 12 | } 13 | -------------------------------------------------------------------------------- /linode/databasemysqlv2/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_v2_basic" }} 2 | 3 | resource "linode_database_mysql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "g6-nanode-1" 7 | engine_id = "{{ .EngineID }}" 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysqlv2/tmpl/complex.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_v2_complex" }} 2 | 3 | resource "linode_database_mysql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "{{ .Type }}" 7 | engine_id = "{{ .EngineID }}" 8 | 9 | allow_list = ["{{ .AllowedIP }}"] 10 | cluster_size = {{ .ClusterSize }} 11 | 12 | updates = { 13 | hour_of_day = {{ .Updates.HourOfDay }} 14 | day_of_week = {{ .Updates.DayOfWeek }} 15 | frequency = "{{ .Updates.Frequency }}" 16 | duration = {{ .Updates.Duration }} 17 | } 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysqlv2/tmpl/data.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_v2_data" }} 2 | 3 | {{ template "database_mysql_v2_complex" . }} 4 | 5 | data "linode_database_mysql_v2" "foobar" { 6 | id = linode_database_mysql_v2.foobar.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysqlv2/tmpl/data_engine_config.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_v2_data_engine_config" }} 2 | 3 | {{ template "database_mysql_v2_engine_config" . }} 4 | 5 | data "linode_database_mysql_v2" "foobar" { 6 | id = linode_database_mysql_v2.foobar.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysqlv2/tmpl/engine_config_nullable_field.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_v2_engine_config_nullable_field" }} 2 | 3 | resource "linode_database_mysql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "{{ .Type }}" 7 | engine_id = "{{ .EngineID }}" 8 | 9 | engine_config_binlog_retention_period = {{ .EngineConfigBinlogRetentionPeriod }} 10 | {{- if .EngineConfigMySQLInnoDBFTServerStopwordTable }} 11 | engine_config_mysql_innodb_ft_server_stopword_table = "{{ .EngineConfigMySQLInnoDBFTServerStopwordTable }}" 12 | {{- end }} 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/databasemysqlv2/tmpl/fork.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_v2_fork" }} 2 | 3 | {{ template "database_mysql_v2_basic" . }} 4 | 5 | resource "linode_database_mysql_v2" "fork" { 6 | label = "{{.Label}}-fork" 7 | region = "{{ .Region }}" 8 | type = "{{ .Type }}" 9 | engine_id = "{{ .EngineID }}" 10 | 11 | fork_source = linode_database_mysql_v2.foobar.id 12 | } 13 | 14 | {{ end }} 15 | -------------------------------------------------------------------------------- /linode/databasemysqlv2/tmpl/suspension.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_mysql_v2_suspension" }} 2 | 3 | resource "linode_database_mysql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "{{ .Type }}" 7 | engine_id = "{{ .EngineID }}" 8 | 9 | suspended = {{ .Suspended }} 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresql/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_basic" }} 2 | 3 | resource "linode_database_postgresql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresql/tmpl/complex.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_complex" }} 2 | 3 | resource "linode_database_postgresql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | 9 | allow_list = ["{{.AllowedIP}}"] 10 | cluster_size = {{.ClusterSize}} 11 | encrypted = {{.Encrypted}} 12 | replication_type = "{{.ReplicationType}}" 13 | replication_commit_type = "{{.ReplicationCommitType}}" 14 | ssl_connection = {{.SSLConnection}} 15 | 16 | updates { 17 | day_of_week = "saturday" 18 | duration = 1 19 | frequency = "monthly" 20 | hour_of_day = 22 21 | week_of_month = 2 22 | } 23 | } 24 | 25 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresql/tmpl/complex_updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_complex_updates" }} 2 | 3 | resource "linode_database_postgresql" "foobar" { 4 | engine_id = "{{.Engine}}" 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | type = "g6-nanode-1" 8 | 9 | allow_list = ["{{.AllowedIP}}"] 10 | cluster_size = {{.ClusterSize}} 11 | encrypted = {{.Encrypted}} 12 | replication_type = "{{.ReplicationType}}" 13 | replication_commit_type = "{{.ReplicationCommitType}}" 14 | ssl_connection = {{.SSLConnection}} 15 | 16 | updates { 17 | day_of_week = "wednesday" 18 | duration = 3 19 | frequency = "weekly" 20 | hour_of_day = 13 21 | } 22 | } 23 | 24 | {{ end }} 25 | 26 | -------------------------------------------------------------------------------- /linode/databasepostgresql/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_data_basic" }} 2 | 3 | {{ template "database_postgresql_complex" . }} 4 | 5 | data "linode_database_postgresql" "foobar" { 6 | database_id = linode_database_postgresql.foobar.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresqlconfig/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_config_data_basic" }} 2 | 3 | data "linode_database_postgresql_config" "foobar" {} 4 | 5 | {{ end }} 6 | -------------------------------------------------------------------------------- /linode/databasepostgresqlconfig/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | func DataBasic(t testing.TB) string { 10 | return acceptance.ExecuteTemplate(t, 11 | "database_postgresql_config_data_basic", nil) 12 | } 13 | -------------------------------------------------------------------------------- /linode/databasepostgresqlv2/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_v2_basic" }} 2 | 3 | resource "linode_database_postgresql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "g6-nanode-1" 7 | engine_id = "{{ .EngineID }}" 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresqlv2/tmpl/complex.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_v2_complex" }} 2 | 3 | resource "linode_database_postgresql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "{{ .Type }}" 7 | engine_id = "{{ .EngineID }}" 8 | 9 | allow_list = ["{{ .AllowedIP }}"] 10 | cluster_size = {{ .ClusterSize }} 11 | 12 | updates = { 13 | hour_of_day = {{ .Updates.HourOfDay }} 14 | day_of_week = {{ .Updates.DayOfWeek }} 15 | frequency = "{{ .Updates.Frequency }}" 16 | duration = {{ .Updates.Duration }} 17 | } 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresqlv2/tmpl/data.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_v2_data" }} 2 | 3 | {{ template "database_postgresql_v2_complex" . }} 4 | 5 | data "linode_database_postgresql_v2" "foobar" { 6 | id = linode_database_postgresql_v2.foobar.id 7 | } 8 | 9 | {{ end }} 10 | -------------------------------------------------------------------------------- /linode/databasepostgresqlv2/tmpl/data_engine_config.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_v2_data_engine_config" }} 2 | 3 | {{ template "database_postgresql_v2_engine_config" . }} 4 | 5 | data "linode_database_postgresql_v2" "foobar" { 6 | id = linode_database_postgresql_v2.foobar.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresqlv2/tmpl/engine_config_update.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_v2_engine_config_update" }} 2 | 3 | resource "linode_database_postgresql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "{{ .Type }}" 7 | engine_id = "{{ .EngineID }}" 8 | 9 | engine_config_pg_autovacuum_analyze_scale_factor = {{ .EngineConfigPGAutovacuumAnalyzeScaleFactor }} 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/databasepostgresqlv2/tmpl/fork.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_v2_fork" }} 2 | 3 | {{ template "database_postgresql_v2_basic" . }} 4 | 5 | resource "linode_database_postgresql_v2" "fork" { 6 | label = "{{.Label}}-fork" 7 | region = "{{ .Region }}" 8 | type = "{{ .Type }}" 9 | engine_id = "{{ .EngineID }}" 10 | 11 | fork_source = linode_database_postgresql_v2.foobar.id 12 | } 13 | 14 | {{ end }} 15 | -------------------------------------------------------------------------------- /linode/databasepostgresqlv2/tmpl/suspension.gotf: -------------------------------------------------------------------------------- 1 | {{ define "database_postgresql_v2_suspension" }} 2 | 3 | resource "linode_database_postgresql_v2" "foobar" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | type = "{{ .Type }}" 7 | engine_id = "{{ .EngineID }}" 8 | 9 | suspended = {{ .Suspended }} 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/databases/tmpl/by_engine.gotf: -------------------------------------------------------------------------------- 1 | {{ define "databases_data_by_engine" }} 2 | 3 | {{ template "database_mysql_basic" .DB }} 4 | 5 | data "linode_databases" "foobar" { 6 | depends_on = [linode_database_mysql.foobar] 7 | 8 | filter { 9 | name = "engine" 10 | values = ["{{.Engine}}"] 11 | } 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/databases/tmpl/by_label.gotf: -------------------------------------------------------------------------------- 1 | {{ define "databases_data_by_label" }} 2 | 3 | {{ template "database_mysql_basic" .DB }} 4 | 5 | data "linode_databases" "foobar" { 6 | depends_on = [linode_database_mysql.foobar] 7 | 8 | filter { 9 | name = "label" 10 | values = ["{{.Label}}"] 11 | } 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_basic" }} 2 | 3 | resource "linode_domain" "foobar" { 4 | domain = "{{.Domain}}" 5 | type = "master" 6 | status = "active" 7 | soa_email = "example@{{.Domain}}" 8 | description = "tf-testing" 9 | tags = ["tf_test"] 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_data_basic" }} 2 | 3 | {{ template "domain_basic" . }} 4 | 5 | data "linode_domain" "foobar" { 6 | domain = "{{.Domain}}" 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/data_byid.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_data_byid" }} 2 | 3 | {{ template "domain_basic" . }} 4 | 5 | data "linode_domain" "foobar" { 6 | id = "${linode_domain.foobar.id}" 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/ips.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_ips" }} 2 | 3 | resource "linode_domain" "foobar" { 4 | domain = "{{.Domain}}" 5 | type = "master" 6 | soa_email = "example@{{.Domain}}" 7 | master_ips = ["12.34.56.78"] 8 | axfr_ips = ["87.65.43.21"] 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/ips_update.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_ips_updates" }} 2 | 3 | resource "linode_domain" "foobar" { 4 | domain = "{{.Domain}}" 5 | type = "master" 6 | soa_email = "example@{{.Domain}}" 7 | master_ips = [] 8 | axfr_ips = [] 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/rounded_sec.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_rounded_sec" }} 2 | 3 | resource "linode_domain" "foobar" { 4 | domain = "{{.Domain}}" 5 | type = "master" 6 | status = "active" 7 | soa_email = "example@{{.Domain}}" 8 | description = "tf-testing" 9 | ttl_sec = 299 10 | refresh_sec = 600 11 | retry_sec = 3601 12 | expire_sec = 2419201 13 | tags = ["tf_test"] 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_updates" }} 2 | 3 | resource "linode_domain" "foobar" { 4 | domain = "renamed-{{.Domain}}" 5 | type = "master" 6 | status = "active" 7 | soa_email = "example@{{.Domain}}" 8 | description = "tf-testing" 9 | tags = ["tf_test", "tf_test_2"] 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/domain/tmpl/zero_sec.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_zero_sec" }} 2 | 3 | resource "linode_domain" "foobar" { 4 | domain = "{{.Domain}}" 5 | type = "master" 6 | status = "active" 7 | soa_email = "example@{{.Domain}}" 8 | description = "tf-testing" 9 | ttl_sec = 0 10 | refresh_sec = 0 11 | retry_sec = 0 12 | expire_sec = 0 13 | tags = ["tf_test"] 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/a_noname.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_a_noname" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | record_type = "A" 8 | target = "192.168.1.1" 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/aaaa_noname.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_aaaa_noname" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | record_type = "AAAA" 8 | target = "2400:3f00::22" 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_basic" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | name = "{{.Record}}" 8 | record_type = "CNAME" 9 | target = "target.{{.Record}}.example" 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/caa_noname.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_caa_noname" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | record_type = "CAA" 8 | target = "target.{{.Record}}" 9 | tag = "issue" 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_data_basic" }} 2 | 3 | resource "linode_domain" "domain" { 4 | type = "master" 5 | domain = "{{.Domain.Domain}}" 6 | soa_email = "example@{{.Domain.Domain}}" 7 | } 8 | 9 | resource "linode_domain_record" "record" { 10 | domain_id = linode_domain.domain.id 11 | name = "www" 12 | record_type = "CNAME" 13 | target = "{{.Domain.Domain}}" 14 | ttl_sec = 7200 15 | } 16 | 17 | data "linode_domain_record" "record" { 18 | domain_id = linode_domain.domain.id 19 | id = linode_domain_record.record.id 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/data_caa.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_data_caa" }} 2 | 3 | resource "linode_domain" "domain" { 4 | type = "master" 5 | domain = "{{.Domain.Domain}}" 6 | soa_email = "example@{{.Domain.Domain}}" 7 | } 8 | 9 | resource "linode_domain_record" "record" { 10 | name = "caa_test" 11 | domain_id = linode_domain.domain.id 12 | record_type = "CAA" 13 | tag = "issue" 14 | target = "example.com" 15 | } 16 | 17 | data "linode_domain_record" "record" { 18 | domain_id = linode_domain.domain.id 19 | id = linode_domain_record.record.id 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/data_id.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_data_id" }} 2 | 3 | resource "linode_domain" "domain" { 4 | type = "master" 5 | domain = "{{.Domain.Domain}}" 6 | soa_email = "example@{{.Domain.Domain}}" 7 | } 8 | 9 | resource "linode_domain_record" "record" { 10 | domain_id = linode_domain.domain.id 11 | name = "www" 12 | record_type = "CNAME" 13 | target = "{{.Domain.Domain}}" 14 | } 15 | 16 | data "linode_domain_record" "record" { 17 | domain_id = linode_domain.domain.id 18 | name = linode_domain_record.record.name 19 | } 20 | 21 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/data_srv.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_data_srv" }} 2 | 3 | resource "linode_domain" "domain" { 4 | type = "master" 5 | domain = "{{.Domain.Domain}}" 6 | soa_email = "example@{{.Domain.Domain}}" 7 | } 8 | 9 | resource "linode_domain_record" "record" { 10 | domain_id = linode_domain.domain.id 11 | record_type = "SRV" 12 | target = "{{.Domain.Domain}}" 13 | port = 80 14 | protocol = "tcp" 15 | service = "sip" 16 | weight = 5 17 | priority = 10 18 | } 19 | 20 | data "linode_domain_record" "record" { 21 | domain_id = linode_domain.domain.id 22 | name = linode_domain_record.record.name 23 | } 24 | 25 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/srv.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_srv" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | record_type = "SRV" 8 | target = "{{.Target}}" 9 | service = "myservice" 10 | protocol = "tcp" 11 | port = 1001 12 | priority = 10 13 | weight = 0 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/ttl.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_ttl" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | name = "{{.Record}}" 8 | record_type = "CNAME" 9 | target = "target.{{.Record}}.example" 10 | ttl_sec = {{.TTL}} 11 | } 12 | 13 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_updates" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | name = "renamed-{{.Record}}" 8 | record_type = "CNAME" 9 | target = "target.{{.Record}}.example" 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/domainrecord/tmpl/with_domain.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_record_with_domain" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | resource "linode_domain_record" "foobar" { 6 | domain_id = linode_domain.foobar.id 7 | name = "{{.Record}}" 8 | record_type = "A" 9 | target = "0.0.0.0" 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/domains/tmpl/data_api_filter.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domains_data_api_filter" }} 2 | 3 | {{ template "domains_data_base" . }} 4 | 5 | data "linode_domains" "foo" { 6 | filter { 7 | name = "domain" 8 | values = ["{{.Domain}}"] 9 | } 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/domains/tmpl/data_base.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domains_data_base" }} 2 | 3 | resource "linode_domain" "foo" { 4 | domain = "{{.Domain}}" 5 | type = "master" 6 | status = "active" 7 | soa_email = "example@{{.Domain}}" 8 | description = "tf-testing-master" 9 | tags = ["tf_test_master"] 10 | } 11 | 12 | resource "linode_domain" "bar" { 13 | domain = "slave-{{.Domain}}" 14 | type = "slave" 15 | soa_email = "example@{{.Domain}}" 16 | description = "tf-testing-slave" 17 | tags = ["tf_test"] 18 | master_ips = ["12.34.56.78"] 19 | } 20 | 21 | {{ end }} -------------------------------------------------------------------------------- /linode/domains/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domains_data_basic" }} 2 | 3 | {{ template "domains_data_base" . }} 4 | 5 | data "linode_domains" "foo" { 6 | depends_on = [linode_domain.bar] 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/domains/tmpl/data_filter.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domains_data_filter" }} 2 | 3 | {{ template "domains_data_base" . }} 4 | 5 | data "linode_domains" "foo" { 6 | filter { 7 | name = "description" 8 | values = ["tf-testing-"] 9 | match_by = "substring" 10 | } 11 | order_by = "domain" 12 | order = "desc" 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/domains/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Domain string 11 | } 12 | 13 | func DataBasic(t testing.TB, domain string) string { 14 | return acceptance.ExecuteTemplate(t, 15 | "domains_data_basic", TemplateData{Domain: domain}) 16 | } 17 | 18 | func DataFilter(t testing.TB, domain string) string { 19 | return acceptance.ExecuteTemplate(t, 20 | "domains_data_filter", TemplateData{Domain: domain}) 21 | } 22 | 23 | func DataAPIFilter(t testing.TB, domain string) string { 24 | return acceptance.ExecuteTemplate(t, 25 | "domains_data_api_filter", TemplateData{Domain: domain}) 26 | } 27 | -------------------------------------------------------------------------------- /linode/domainzonefile/framework_datasource_schema.go: -------------------------------------------------------------------------------- 1 | package domainzonefile 2 | 3 | import ( 4 | "github.com/hashicorp/terraform-plugin-framework/datasource/schema" 5 | "github.com/hashicorp/terraform-plugin-framework/types" 6 | ) 7 | 8 | var frameworkDatasourceSchema = schema.Schema{ 9 | Attributes: map[string]schema.Attribute{ 10 | "domain_id": schema.Int64Attribute{ 11 | Description: "The domain's ID.", 12 | Required: true, 13 | }, 14 | "zone_file": schema.ListAttribute{ 15 | Description: "Lines of the zone file for the last rendered zone for this domain.", 16 | Computed: true, 17 | ElementType: types.StringType, 18 | }, 19 | "id": schema.StringAttribute{ 20 | Description: "The unique ID for this DataSource", 21 | Computed: true, 22 | }, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /linode/domainzonefile/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "domain_zonefile_basic" }} 2 | 3 | {{ template "domain_basic" .Domain }} 4 | 5 | data "linode_domain_zonefile" "foobar" { 6 | domain_id = "${linode_domain.foobar.id}" 7 | } 8 | 9 | {{ end }} 10 | -------------------------------------------------------------------------------- /linode/domainzonefile/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | domain "github.com/linode/terraform-provider-linode/v2/linode/domain/tmpl" 8 | ) 9 | 10 | type TemplateData struct { 11 | Domain domain.TemplateData 12 | 13 | Record string 14 | } 15 | 16 | func Basic(t testing.TB, domainRecord string) string { 17 | return acceptance.ExecuteTemplate(t, 18 | "domain_zonefile_basic", TemplateData{ 19 | Domain: domain.TemplateData{Domain: domainRecord}, 20 | Record: domainRecord, 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /linode/firewall/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_data_basic" }} 2 | 3 | {{ template "firewall_basic" . }} 4 | 5 | data "linode_firewall" "test" { 6 | id = linode_firewall.test.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/firewall/tmpl/inst.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_inst" }} 2 | 3 | resource "linode_instance" "{{.ID}}" { 4 | label = "{{.Prefix}}-{{.ID}}" 5 | group = "tf_test" 6 | type = "g6-nanode-1" 7 | region = "{{ .Region }}" 8 | disk { 9 | label = "disk" 10 | image = "linode/debian12" 11 | root_pass = "{{ .RootPass }}" 12 | authorized_keys = ["{{.PubKey}}"] 13 | size = 3000 14 | } 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/firewall/tmpl/minimum.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_minimum" }} 2 | 3 | resource "linode_firewall" "test" { 4 | label = "{{.Label}}" 5 | tags = ["test"] 6 | 7 | inbound { 8 | label = "tf-test-in" 9 | action = "ACCEPT" 10 | protocol = "TCP" 11 | ipv4 = ["0.0.0.0/0"] 12 | } 13 | inbound_policy = "DROP" 14 | outbound_policy = "DROP" 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/firewall/tmpl/nb.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_nb" }} 2 | 3 | resource "linode_nodebalancer" "{{.ID}}" { 4 | label = "{{.Prefix}}-{{.ID}}" 5 | region = "{{ .Region }}" 6 | } 7 | 8 | {{ end }} -------------------------------------------------------------------------------- /linode/firewall/tmpl/no_device.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_no_device" }} 2 | 3 | resource "linode_firewall" "test" { 4 | label = "{{.Label}}" 5 | tags = ["test"] 6 | 7 | inbound { 8 | label = "tf-test-in" 9 | action = "ACCEPT" 10 | protocol = "TCP" 11 | ports = "80" 12 | ipv6 = ["::/0"] 13 | } 14 | 15 | inbound_policy = "DROP" 16 | outbound { 17 | label = "tf-test-out" 18 | action = "ACCEPT" 19 | protocol = "TCP" 20 | ports = "80" 21 | ipv6 = ["::/0"] 22 | } 23 | outbound_policy = "DROP" 24 | 25 | linodes = [] 26 | } 27 | 28 | {{ end }} -------------------------------------------------------------------------------- /linode/firewall/tmpl/no_ipv6.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_no_ipv6" }} 2 | 3 | resource "linode_firewall" "test" { 4 | label = "{{.Label}}" 5 | tags = ["test"] 6 | 7 | inbound { 8 | label = "tf-test-in" 9 | action = "ACCEPT" 10 | protocol = "TCP" 11 | ports = "80" 12 | ipv4 = ["0.0.0.0/0"] 13 | ipv6 = null 14 | } 15 | 16 | inbound_policy = "DROP" 17 | outbound_policy = "DROP" 18 | 19 | linodes = [] 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/firewall/tmpl/no_rules.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_no_rules" }} 2 | 3 | resource "linode_firewall" "test" { 4 | label = "{{.Label}}" 5 | tags = ["test"] 6 | 7 | inbound_policy = "DROP" 8 | outbound_policy = "DROP" 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/firewalldevice/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_device_basic" }} 2 | 3 | {{ template "firewall_device_firewall" . }} 4 | 5 | {{ template "firewall_device_instance" . }} 6 | 7 | resource "linode_firewall_device" "foobar" { 8 | firewall_id = linode_firewall.foobar.id 9 | entity_id = linode_instance.foobar.id 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/firewalldevice/tmpl/detached.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_device_detached" }} 2 | 3 | {{ template "firewall_device_firewall" . }} 4 | 5 | {{ template "firewall_device_instance" . }} 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/firewalldevice/tmpl/firewall.gotf: -------------------------------------------------------------------------------- 1 | # Template firewall for use with firewall devices 2 | 3 | {{ define "firewall_device_firewall" }} 4 | 5 | resource "linode_firewall" "foobar" { 6 | label = "{{.Label}}" 7 | tags = ["test"] 8 | 9 | inbound { 10 | label = "tf-test-in" 11 | action = "ACCEPT" 12 | protocol = "TCP" 13 | ports = "80" 14 | ipv4 = ["0.0.0.0/0"] 15 | ipv6 = ["::/0"] 16 | } 17 | inbound_policy = "DROP" 18 | 19 | outbound { 20 | label = "tf-test-out" 21 | action = "ACCEPT" 22 | protocol = "TCP" 23 | ports = "80" 24 | ipv4 = ["0.0.0.0/0"] 25 | ipv6 = ["2001:db8::/32"] 26 | } 27 | outbound_policy = "DROP" 28 | } 29 | 30 | {{ end }} -------------------------------------------------------------------------------- /linode/firewalldevice/tmpl/instance.gotf: -------------------------------------------------------------------------------- 1 | # Template instance for use with firewall devices 2 | 3 | {{ define "firewall_device_instance" }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/firewalldevice/tmpl/with_nodebalancer.gotf: -------------------------------------------------------------------------------- 1 | {{ define "firewall_device_with_nodebalancer" }} 2 | 3 | {{ template "firewall_device_firewall" . }} 4 | 5 | resource "linode_nodebalancer" "foobar" { 6 | label = "{{.Label}}" 7 | region = "{{.Region}}" 8 | } 9 | 10 | resource "linode_firewall_device" "foobar" { 11 | firewall_id = linode_firewall.foobar.id 12 | entity_id = linode_nodebalancer.foobar.id 13 | entity_type = "nodebalancer" 14 | } 15 | 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/firewalls/tmpl/data_all.gotf: -------------------------------------------------------------------------------- 1 | {{ define "data_linode_firewalls_all" }} 2 | 3 | {{ template "data_linode_firewalls_base" . }} 4 | 5 | data "linode_firewalls" "test" { 6 | depends_on = [linode_firewall.foobar] 7 | } 8 | 9 | {{ end }} 10 | -------------------------------------------------------------------------------- /linode/firewalls/tmpl/data_filter.gotf: -------------------------------------------------------------------------------- 1 | {{ define "data_linode_firewalls_filter" }} 2 | 3 | {{ template "data_linode_firewalls_base" . }} 4 | 5 | data "linode_firewalls" "test" { 6 | depends_on = [ linode_firewall.foobar ] 7 | 8 | order_by = "created" 9 | order = "desc" 10 | 11 | filter { 12 | name = "created" 13 | values = [linode_firewall.foobar.created] 14 | } 15 | 16 | filter { 17 | name = "label" 18 | values = ["{{ .Label }}"] 19 | } 20 | 21 | filter { 22 | name = "tags" 23 | values = ["foo", "bar"] 24 | } 25 | 26 | filter { 27 | name = "status" 28 | values = ["enabled"] 29 | } 30 | } 31 | 32 | {{ end }} 33 | -------------------------------------------------------------------------------- /linode/firewalls/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Label string 11 | Region string 12 | } 13 | 14 | func DataAll(t testing.TB, label, region string) string { 15 | return acceptance.ExecuteTemplate(t, 16 | "data_linode_firewalls_all", TemplateData{ 17 | Label: label, 18 | Region: region, 19 | }) 20 | } 21 | 22 | func DataFilter(t testing.TB, label, region string) string { 23 | return acceptance.ExecuteTemplate(t, 24 | "data_linode_firewalls_filter", TemplateData{ 25 | Label: label, 26 | Region: region, 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /linode/helper/constant.go: -------------------------------------------------------------------------------- 1 | package helper 2 | 3 | const TIME_FORMAT = "2006-01-02T15:04:05Z" 4 | -------------------------------------------------------------------------------- /linode/helper/customdiffs/computedwithdefault.go: -------------------------------------------------------------------------------- 1 | package customdiffs 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" 7 | ) 8 | 9 | // ComputedWithDefault allows a computed field to have an explicit default if 10 | // it is not defined by the user. 11 | // 12 | // This is hacky but allows us to avoid a breaking change on fields using 13 | // CaseInsensitiveSet (computed) when not specifying a field. 14 | func ComputedWithDefault[T any](field string, defaultValue T) schema.CustomizeDiffFunc { 15 | return func(ctx context.Context, diff *schema.ResourceDiff, i interface{}) error { 16 | if !diff.GetRawConfig().GetAttr(field).IsNull() { 17 | return nil 18 | } 19 | 20 | return diff.SetNew(field, defaultValue) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /linode/helper/default_value.go: -------------------------------------------------------------------------------- 1 | package helper 2 | 3 | import ( 4 | "github.com/hashicorp/terraform-plugin-framework/types" 5 | "github.com/hashicorp/terraform-plugin-framework/types/basetypes" 6 | ) 7 | 8 | // returns a Float64Value with default value 0 if nil or a known value. 9 | func Float64PointerValueWithDefault(value *float64) basetypes.Float64Value { 10 | if value != nil { 11 | return types.Float64PointerValue(value) 12 | } else { 13 | return types.Float64Value(0) 14 | } 15 | } 16 | 17 | // returns an Int64Value with default value 0 if nil or a known value. 18 | func IntPointerValueWithDefault(value *int) basetypes.Int64Value { 19 | if value != nil { 20 | return types.Int64Value(int64(*value)) 21 | } else { 22 | return types.Int64Value(0) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /linode/helper/filter_test.go: -------------------------------------------------------------------------------- 1 | //go:build unit 2 | 3 | package helper_test 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/linode/terraform-provider-linode/v2/linode/helper" 9 | ) 10 | 11 | func TestGetLatestVersion(t *testing.T) { 12 | versions := []string{"2.7.3", "0.5.0", "1.7.3", "8.0.27", "4.36.0", "2.56.100", "7.55.3", "8.0.26"} 13 | versionsMaps := make([]map[string]interface{}, len(versions)) 14 | for i, ver := range versions { 15 | versionsMaps[i] = map[string]interface{}{ 16 | "version": ver, 17 | } 18 | } 19 | 20 | var f helper.FilterConfig 21 | 22 | latest, err := f.GetLatestVersion(versionsMaps) 23 | if err != nil { 24 | t.Fatal(err) 25 | } 26 | 27 | if latest["version"] != "8.0.27" { 28 | t.Fatalf("expected 8.0.27, got %s", latest["version"]) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /linode/helper/frameworkfilter/filter_test.go: -------------------------------------------------------------------------------- 1 | //go:build unit 2 | 3 | package frameworkfilter 4 | 5 | var testFilterConfig = Config{ 6 | "foo": {APIFilterable: false, TypeFunc: FilterTypeString}, 7 | "bar": {APIFilterable: false, TypeFunc: FilterTypeString}, 8 | "api_foo": {APIFilterable: true, TypeFunc: FilterTypeString}, 9 | "api_bar": {APIFilterable: true, TypeFunc: FilterTypeString}, 10 | "api_foo_int": {APIFilterable: true, TypeFunc: FilterTypeInt}, 11 | "api_foo_bool": {APIFilterable: true, TypeFunc: FilterTypeBool}, 12 | } 13 | -------------------------------------------------------------------------------- /linode/helper/normalize.go: -------------------------------------------------------------------------------- 1 | package helper 2 | 3 | import ( 4 | "net" 5 | ) 6 | 7 | func CompareIPv6Ranges(i, v string) (bool, error) { 8 | ipi, ipneti, err := net.ParseCIDR(i) 9 | if err != nil { 10 | return false, err 11 | } 12 | 13 | ipv, ipnetv, err := net.ParseCIDR(v) 14 | if err != nil { 15 | return false, err 16 | } 17 | 18 | return ipi.Equal(ipv) && ipneti.Mask.String() == ipnetv.Mask.String(), nil 19 | } 20 | -------------------------------------------------------------------------------- /linode/helper/regex.go: -------------------------------------------------------------------------------- 1 | package helper 2 | 3 | import ( 4 | "regexp" 5 | 6 | "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" 7 | "github.com/hashicorp/terraform-plugin-framework/schema/validator" 8 | ) 9 | 10 | func StringToRegex(pattern string) *regexp.Regexp { 11 | return regexp.MustCompile(pattern) 12 | } 13 | 14 | func RegexMatches(pattern string, errorMessage string) validator.String { 15 | patternRegEx := StringToRegex(pattern) 16 | return stringvalidator.RegexMatches(patternRegEx, errorMessage) 17 | } 18 | -------------------------------------------------------------------------------- /linode/helper/sdkv2_cty_test.go: -------------------------------------------------------------------------------- 1 | //go:build unit 2 | 3 | package helper_test 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/hashicorp/go-cty/cty" 9 | "github.com/stretchr/testify/require" 10 | 11 | "github.com/linode/terraform-provider-linode/v2/linode/helper" 12 | ) 13 | 14 | func TestSDKv2PathToCtyPath(t *testing.T) { 15 | result := helper.SDKv2PathToCtyPath("wow.0.cool.2.field") 16 | 17 | require.Len(t, result, 5) 18 | require.Equal(t, "wow", result[0].(cty.GetAttrStep).Name) 19 | require.True(t, result[1].(cty.IndexStep).Key.Equals(cty.NumberIntVal(0)).True()) 20 | require.Equal(t, "cool", result[2].(cty.GetAttrStep).Name) 21 | require.True(t, result[3].(cty.IndexStep).Key.Equals(cty.NumberIntVal(2)).True()) 22 | require.Equal(t, "field", result[4].(cty.GetAttrStep).Name) 23 | } 24 | -------------------------------------------------------------------------------- /linode/helper/stateupgrade/rfc3339.go: -------------------------------------------------------------------------------- 1 | package stateupgrade 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes" 7 | ) 8 | 9 | func UpgradeTimeFormatToRFC3339(oldTime string) (timetypes.RFC3339, error) { 10 | if newTime, err := time.Parse(time.RFC3339, oldTime); err == nil { 11 | return timetypes.NewRFC3339TimeValue(newTime), nil 12 | } 13 | 14 | newTime, err := time.Parse("2006-01-02 15:04:05.999999999 -0700 MST", oldTime) 15 | if err != nil { 16 | return timetypes.NewRFC3339Null(), err 17 | } 18 | 19 | return timetypes.NewRFC3339TimeValue(newTime), nil 20 | } 21 | -------------------------------------------------------------------------------- /linode/helper/version.go: -------------------------------------------------------------------------------- 1 | package helper 2 | 3 | import ( 4 | "fmt" 5 | "runtime/debug" 6 | "strings" 7 | ) 8 | 9 | func getDepVersion(depPath string) string { 10 | info, ok := debug.ReadBuildInfo() 11 | 12 | if !ok { 13 | fmt.Println("No build information available") 14 | return "" 15 | } 16 | 17 | for _, dep := range info.Deps { 18 | if dep.Path == depPath { 19 | return strings.TrimLeft(dep.Version, "v") 20 | } 21 | } 22 | 23 | return "" 24 | } 25 | 26 | func GetSDKv2Version() string { 27 | return getDepVersion("github.com/hashicorp/terraform-plugin-sdk/v2") 28 | } 29 | 30 | func GetFrameworkVersion() string { 31 | return getDepVersion("github.com/hashicorp/terraform-plugin-framework") 32 | } 33 | -------------------------------------------------------------------------------- /linode/image/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "image_basic" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Image}}" 7 | group = "tf_test" 8 | type = "g6-standard-1" 9 | region = "{{ .Region }}" 10 | disk { 11 | label = "disk" 12 | size = 1000 13 | filesystem = "ext4" 14 | } 15 | firewall_id = linode_firewall.e2e_test_firewall.id 16 | } 17 | 18 | resource "linode_image" "foobar" { 19 | linode_id = "${linode_instance.foobar.id}" 20 | disk_id = "${linode_instance.foobar.disk.0.id}" 21 | label = "{{.Image}}" 22 | description = "descriptive text" 23 | cloud_init = true 24 | tags = ["{{.Tag}}"] 25 | } 26 | 27 | {{ end }} -------------------------------------------------------------------------------- /linode/image/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "image_data_basic" }} 2 | 3 | data "linode_image" "foobar" { 4 | id = "{{.ID}}" 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/image/tmpl/data_replicate.gotf: -------------------------------------------------------------------------------- 1 | {{ define "image_data_replicate" }} 2 | 3 | {{ template "image_replicate" . }} 4 | 5 | data "linode_image" "foobar" { 6 | id = linode_image.foobar.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/image/tmpl/no_replica_regions.gotf: -------------------------------------------------------------------------------- 1 | {{ define "image_no_replica_regions" }} 2 | 3 | resource "linode_image" "foobar" { 4 | label = "{{.Image}}" 5 | file_path = "{{.FilePath}}" 6 | file_hash = filemd5("{{.FilePath}}") 7 | region = "{{ .Region }}" 8 | description = "really descriptive text" 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/image/tmpl/replicate.gotf: -------------------------------------------------------------------------------- 1 | {{ define "image_replicate" }} 2 | 3 | resource "linode_image" "foobar" { 4 | label = "{{.Image}}" 5 | file_path = "{{.FilePath}}" 6 | file_hash = filemd5("{{.FilePath}}") 7 | region = "{{ .Region }}" 8 | description = "really descriptive text" 9 | replica_regions = ["{{ .Region }}", "{{ .ReplicaRegion }}"] 10 | wait_for_replications = true 11 | } 12 | 13 | {{ end }} -------------------------------------------------------------------------------- /linode/image/tmpl/updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "image_updates" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Image}}" 7 | group = "tf_test" 8 | type = "g6-standard-1" 9 | region = "{{ .Region }}" 10 | disk { 11 | label = "disk" 12 | size = 1000 13 | filesystem = "ext4" 14 | } 15 | firewall_id = linode_firewall.e2e_test_firewall.id 16 | } 17 | 18 | resource "linode_image" "foobar" { 19 | linode_id = "${linode_instance.foobar.id}" 20 | disk_id = "${linode_instance.foobar.disk.0.id}" 21 | label = "{{.Image}}_renamed" 22 | description = "more descriptive text" 23 | tags = ["{{.Tag}}"] 24 | } 25 | 26 | {{ end }} -------------------------------------------------------------------------------- /linode/image/tmpl/upload.gotf: -------------------------------------------------------------------------------- 1 | {{ define "image_upload" }} 2 | 3 | resource "linode_image" "foobar" { 4 | label = "{{.Image}}" 5 | file_path = "{{.FilePath}}" 6 | file_hash = filemd5("{{.FilePath}}") 7 | region = "{{ .Region }}" 8 | description = "really descriptive text" 9 | tags = ["{{.Tag}}"] 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/images/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "images_data_basic" }} 2 | 3 | {{ template "images_data_base" . }} 4 | 5 | data "linode_images" "foobar" { 6 | filter { 7 | name = "label" 8 | values = [linode_image.foobar.label] 9 | } 10 | 11 | filter { 12 | name = "is_public" 13 | values = ["false"] 14 | } 15 | 16 | filter { 17 | name = "tags" 18 | values = ["test"] 19 | } 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/images/tmpl/data_clientfilter.gotf: -------------------------------------------------------------------------------- 1 | {{ define "images_data_clientfilter" }} 2 | 3 | {{ template "images_data_base" . }} 4 | 5 | data "linode_images" "foobar" { 6 | filter { 7 | name = "id" 8 | values = [linode_image.foobar.id] 9 | } 10 | 11 | filter { 12 | name = "status" 13 | values = [linode_image.foobar.status] 14 | } 15 | 16 | filter { 17 | name = "description" 18 | values = [linode_image.foobar.description] 19 | } 20 | 21 | filter { 22 | name = "created_by" 23 | values = [linode_image.foobar.created_by] 24 | } 25 | } 26 | 27 | {{ end }} -------------------------------------------------------------------------------- /linode/images/tmpl/data_latest.gotf: -------------------------------------------------------------------------------- 1 | {{ define "images_data_latest" }} 2 | 3 | {{ template "images_data_base" . }} 4 | 5 | data "linode_images" "foobar" { 6 | latest = true 7 | 8 | filter { 9 | name = "label" 10 | values = [linode_image.foobar.label] 11 | match_by = "substring" 12 | } 13 | 14 | filter { 15 | name = "is_public" 16 | values = ["false"] 17 | } 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/images/tmpl/data_latest_empty.gotf: -------------------------------------------------------------------------------- 1 | {{ define "images_data_latest_empty" }} 2 | 3 | {{ template "images_data_base" . }} 4 | 5 | data "linode_images" "foobar" { 6 | latest = true 7 | 8 | filter { 9 | name = "label" 10 | values = ["not-a-real-image"] 11 | } 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/images/tmpl/data_order.gotf: -------------------------------------------------------------------------------- 1 | {{ define "images_data_order" }} 2 | 3 | {{ template "images_data_base" . }} 4 | 5 | data "linode_images" "foobar" { 6 | order_by = "size" 7 | order = "desc" 8 | 9 | filter { 10 | name = "label" 11 | values = [linode_image.foobar.label] 12 | } 13 | 14 | filter { 15 | name = "is_public" 16 | values = ["false"] 17 | } 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/images/tmpl/data_substring.gotf: -------------------------------------------------------------------------------- 1 | {{ define "images_data_substring" }} 2 | 3 | {{ template "images_data_base" . }} 4 | 5 | data "linode_images" "foobar" { 6 | filter { 7 | name = "label" 8 | values = ["Alpine"] 9 | match_by = "substring" 10 | } 11 | 12 | filter { 13 | name = "is_public" 14 | values = [true] 15 | } 16 | } 17 | 18 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/authorized_keys_empty.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_authorized_keys_empty" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | authorized_keys = [ 12 | "" 13 | ] 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/authorized_users.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_authorized_users" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | data "linode_profile" "profile" {} 6 | 7 | resource "linode_sshkey" "key" { 8 | label = "tf_test_authorized_keys" 9 | ssh_key = "{{.PubKey}}" 10 | } 11 | 12 | resource "linode_instance" "foobar" { 13 | label = "{{.Label}}" 14 | group = "tf_test" 15 | type = "g6-nanode-1" 16 | image = "{{.Image}}" 17 | region = "{{ .Region }}" 18 | root_pass = "{{ .RootPass }}" 19 | swap_size = 256 20 | authorized_users = [ "${data.linode_profile.profile.username}" ] 21 | firewall_id = linode_firewall.e2e_test_firewall.id 22 | } 23 | 24 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_basic" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | root_pass = "{{ .RootPass }}" 12 | swap_size = 256 13 | authorized_keys = ["{{.PubKey}}"] 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/config_updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_updates" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}_r" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | group = "tf_test_r" 10 | 11 | alerts { 12 | cpu = 80 13 | } 14 | 15 | config { 16 | label = "config" 17 | kernel = "linode/latest-32bit" 18 | root_device = "/dev/sda" 19 | helpers { 20 | network = false 21 | } 22 | } 23 | boot_config_label = "config" 24 | firewall_id = linode_firewall.e2e_test_firewall.id 25 | } 26 | 27 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/data_clientfilter.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_data_clientfilter" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | count = 3 5 | 6 | label = "{{.Label}}-${count.index}" 7 | tags = ["{{ .Tag }}-${count.index}"] 8 | type = "g6-nanode-1" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | root_pass = "{{ .RootPass }}" 12 | } 13 | 14 | data "linode_instances" "foobar" { 15 | depends_on = [ 16 | linode_instance.foobar, 17 | ] 18 | 19 | filter { 20 | name = "tags" 21 | values = linode_instance.foobar[0].tags 22 | } 23 | 24 | filter { 25 | name = "status" 26 | values = ["running"] 27 | } 28 | } 29 | 30 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/data_multiple.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_data_multiple" }} 2 | 3 | {{ template "instance_data_multiple_base" . }} 4 | 5 | data "linode_instances" "foobar" { 6 | depends_on = [ 7 | linode_instance.foobar, 8 | ] 9 | 10 | filter { 11 | name = "tags" 12 | values = ["{{ .Tag }}"] 13 | } 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/data_multiple_base.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_data_multiple_base" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | count = 3 5 | 6 | label = "{{.Label}}-${count.index}" 7 | tags = ["{{ .Tag }}"] 8 | type = "g6-nanode-1" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | root_pass = "{{ .RootPass }}" 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/data_multiple_order.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_data_multiple_order" }} 2 | 3 | {{ template "instance_data_multiple_base" . }} 4 | 5 | data "linode_instances" "asc" { 6 | depends_on = [ 7 | linode_instance.foobar 8 | ] 9 | 10 | order_by = "id" 11 | 12 | filter { 13 | name = "tags" 14 | values = ["{{ .Tag }}"] 15 | } 16 | } 17 | 18 | data "linode_instances" "desc" { 19 | depends_on = [ 20 | linode_instance.foobar 21 | ] 22 | 23 | order_by = "id" 24 | order = "desc" 25 | 26 | filter { 27 | name = "tags" 28 | values = ["{{ .Tag }}"] 29 | } 30 | } 31 | 32 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/data_multiple_regex.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_data_multiple_regex" }} 2 | 3 | {{ template "instance_data_multiple_base" . }} 4 | 5 | data "linode_instances" "foobar" { 6 | depends_on = [ 7 | linode_instance.foobar, 8 | ] 9 | 10 | filter { 11 | name = "label" 12 | values = ["{{.Label}}-.*"] 13 | match_by = "re" 14 | } 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/data_with_block_storage_encryption.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_data_with_block_storage_encryption" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | root_pass = "{{ .RootPass }}" 10 | firewall_id = linode_firewall.e2e_test_firewall.id 11 | } 12 | 13 | data "linode_instances" "foobar" { 14 | filter { 15 | name = "id" 16 | values = [linode_instance.foobar.id] 17 | } 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/data_with_pg.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_data_with_pg" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_placement_group" "foobar" { 6 | label = "{{ $.Label }}" 7 | region = "{{ $.Region }}" 8 | placement_group_type = "anti_affinity:local" 9 | placement_group_policy = "flexible" 10 | } 11 | 12 | resource "linode_instance" "foobar" { 13 | label = "{{ .Label }}" 14 | type = "g6-nanode-1" 15 | region = "{{ .Region }}" 16 | placement_group { 17 | id = linode_placement_group.foobar.id 18 | } 19 | } 20 | 21 | data "linode_instances" "foobar" { 22 | filter { 23 | name = "id" 24 | values = [linode_instance.foobar.id] 25 | } 26 | } 27 | 28 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/disk.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | disk { 11 | label = "disk" 12 | image = "{{.Image}}" 13 | root_pass = "{{ .RootPass }}" 14 | authorized_keys = ["{{.PubKey}}"] 15 | size = 3000 16 | } 17 | firewall_id = linode_firewall.e2e_test_firewall.id 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/disk_authorized_keys_empty.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk_authorized_keys_empty" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | 10 | disk { 11 | label = "boot" 12 | size = 4096 13 | image = "{{.Image}}" 14 | authorized_keys = [""] 15 | root_pass = "{{.RootPass}}" 16 | } 17 | firewall_id = linode_firewall.e2e_test_firewall.id 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/disk_boot_image.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk_boot_image" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | disk { 11 | label = "boot" 12 | size = 5000 13 | filesystem = "ext4" 14 | image = "{{.Image}}" 15 | } 16 | disk { 17 | label = "swap" 18 | size = 512 19 | filesystem = "ext4" 20 | } 21 | firewall_id = linode_firewall.e2e_test_firewall.id 22 | } 23 | 24 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/disk_config.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk_config" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region}}" 9 | group = "tf_test" 10 | 11 | disk { 12 | label = "disk" 13 | image = "{{.Image}}" 14 | root_pass = "{{ .RootPass }}" 15 | authorized_keys = ["{{.PubKey}}"] 16 | size = 3000 17 | } 18 | 19 | config { 20 | label = "config" 21 | kernel = "linode/latest-64bit" 22 | devices { 23 | sda { 24 | disk_label = "disk" 25 | } 26 | } 27 | } 28 | firewall_id = linode_firewall.e2e_test_firewall.id 29 | } 30 | 31 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/disk_encryption.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk_encryption" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{.Label}}" 5 | type = "g6-nanode-1" 6 | image = "{{.Image}}" 7 | region = "{{ .Region }}" 8 | root_pass = "{{ .RootPass }}" 9 | 10 | {{ if not (eq .DiskEncryption nil) }} 11 | disk_encryption = "{{ .DiskEncryption }}" 12 | {{ end }} 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/disk_multiple.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk_multiple" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | disk { 11 | label = "diska" 12 | image = "{{.Image}}" 13 | root_pass = "{{ .RootPass }}" 14 | authorized_keys = ["{{.PubKey}}"] 15 | size = 3000 16 | } 17 | disk { 18 | label = "diskb" 19 | filesystem = "swap" 20 | size = 512 21 | } 22 | 23 | firewall_id = linode_firewall.e2e_test_firewall.id 24 | } 25 | 26 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/firewall_on_creation.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_firewall_on_creation" }} 2 | 3 | resource "linode_firewall" "foobar" { 4 | label = "{{.Label}}_fw" 5 | inbound_policy = "DROP" 6 | outbound_policy = "ACCEPT" 7 | } 8 | 9 | resource "linode_instance" "foobar" { 10 | label = "{{.Label}}" 11 | group = "tf_test" 12 | type = "g6-nanode-1" 13 | image = "{{.Image}}" 14 | region = "{{ .Region }}" 15 | root_pass = "{{ .RootPass }}" 16 | firewall_id = linode_firewall.foobar.id 17 | } 18 | 19 | {{ end }} 20 | -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/instance_with_reserved_ip.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_with_reserved_ip" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_networking_ip" "test" { 6 | type = "ipv4" 7 | region = "{{ .Region }}" 8 | public = true 9 | reserved = true 10 | } 11 | 12 | resource "linode_instance" "foobar" { 13 | label = "{{ .Label }}" 14 | type = "g6-nanode-1" 15 | region = "{{ .Region }}" 16 | image = "{{ .Image }}" 17 | firewall_id = linode_firewall.e2e_test_firewall.id 18 | root_pass = "{{ .RootPass }}" 19 | authorized_keys = ["{{ .PubKey }}"] 20 | 21 | ipv4 = [linode_networking_ip.test.address] 22 | } 23 | 24 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/interfaces.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_interfaces" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | image = "{{.Image}}" 11 | 12 | interface { 13 | purpose = "vlan" 14 | label = "tf-really-cool-vlan" 15 | ipam_address = "10.0.0.2/24" 16 | } 17 | firewall_id = linode_firewall.e2e_test_firewall.id 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/interfaces_update.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_interfaces_update" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | image = "{{.Image}}" 11 | 12 | interface { 13 | purpose = "public" 14 | } 15 | 16 | interface { 17 | purpose = "vlan" 18 | label = "tf-really-cool-vlan" 19 | ipam_address = "10.0.0.2/24" 20 | } 21 | firewall_id = linode_firewall.e2e_test_firewall.id 22 | } 23 | 24 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/interfaces_update_empty.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_interfaces_update_empty" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | image = "{{.Image}}" 11 | 12 | interface { 13 | purpose = "vlan" 14 | label = "tf-really-cool-vlan" 15 | ipam_address = "10.0.0.2/24" 16 | } 17 | firewall_id = linode_firewall.e2e_test_firewall.id 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/ipv4_sharing.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_ipv4_sharing" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "primary" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | firewall_id = linode_firewall.e2e_test_firewall.id 11 | } 12 | 13 | resource "linode_instance" "failover" { 14 | label = "{{.Label}}-failover" 15 | group = "tf_test" 16 | type = "g6-nanode-1" 17 | region = "{{ .Region }}" 18 | 19 | shared_ipv4 = [linode_instance.primary.ip_address] 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/ipv4_sharing_allocation.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_ipv4_sharing_allocation" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "primary" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | firewall_id = linode_firewall.e2e_test_firewall.id 11 | } 12 | 13 | resource "linode_instance_ip" "allocation" { 14 | linode_id = linode_instance.primary.id 15 | public = true 16 | } 17 | 18 | resource "linode_instance" "failover" { 19 | label = "{{.Label}}-failover" 20 | group = "tf_test" 21 | type = "g6-nanode-1" 22 | region = "{{ .Region }}" 23 | 24 | shared_ipv4 = [linode_instance_ip.allocation.address] 25 | } 26 | 27 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/ipv4_sharing_bad_input.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_ipv4_sharing_bad_input" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "primary" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | firewall_id = linode_firewall.e2e_test_firewall.id 11 | } 12 | 13 | resource "linode_instance" "failover" { 14 | label = "{{.Label}}-failover" 15 | group = "tf_test" 16 | type = "g6-nanode-1" 17 | region = "{{ .Region }}" 18 | 19 | shared_ipv4 = ["FE80:CD00:0:CDE:1257:0:211E:729C"] 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/ipv4_sharing_empty.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_ipv4_sharing_empty" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "primary" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | 11 | shared_ipv4 = [] 12 | firewall_id = linode_firewall.e2e_test_firewall.id 13 | } 14 | 15 | resource "linode_instance" "failover" { 16 | label = "{{.Label}}-failover" 17 | group = "tf_test" 18 | type = "g6-nanode-1" 19 | region = "{{ .Region }}" 20 | 21 | shared_ipv4 = [] 22 | } 23 | 24 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/many_linodes.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_many_linodes" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | count = 12 7 | label = "{{.Label}}-${count.index}" 8 | type = "g6-nanode-1" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | root_pass = "{{ .RootPass }}" 12 | swap_size = 256 13 | authorized_keys = ["{{.PubKey}}"] 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/multiple_configs.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_multiple_configs" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | config { 11 | label = "configa" 12 | kernel = "linode/latest-64bit" 13 | root_device = "/dev/sda" 14 | } 15 | config { 16 | label = "configb" 17 | kernel = "linode/latest-32bit" 18 | root_device = "/dev/sda" 19 | } 20 | 21 | boot_config_label = "configa" 22 | firewall_id = linode_firewall.e2e_test_firewall.id 23 | } 24 | 25 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/no_image.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_no_image" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | {{ $resource_name := "foobar" }} 6 | 7 | resource "linode_instance" "{{ $resource_name }}" { 8 | label = "{{ .Label }}" 9 | group = "tf_test" 10 | type = "g6-nanode-1" 11 | region = "{{ .Region }}" 12 | booted = false 13 | firewall_id = linode_firewall.e2e_test_firewall.id 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/power_state.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_boot_state" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | image = "{{.Image}}" 8 | group = "tf_test" 9 | type = "g6-nanode-1" 10 | region = "{{ .Region }}" 11 | booted = {{.Booted}} 12 | 13 | interface { 14 | purpose = "vlan" 15 | label = "cool" 16 | ipam_address = "10.0.0.3/24" 17 | } 18 | firewall_id = linode_firewall.e2e_test_firewall.id 19 | } 20 | 21 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/power_state_interface.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_boot_state_interface" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | image = "{{.Image}}" 8 | group = "tf_test" 9 | type = "g6-nanode-1" 10 | region = "{{ .Region }}" 11 | booted = {{.Booted}} 12 | 13 | interface { 14 | purpose = "public" 15 | } 16 | 17 | interface { 18 | purpose = "vlan" 19 | label = "tf-test" 20 | ipam_address = "10.0.0.7/24" 21 | } 22 | 23 | firewall_id = linode_firewall.e2e_test_firewall.id 24 | } 25 | 26 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/power_state_noimage.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_boot_state_noimage" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | booted = {{.Booted}} 11 | 12 | firewall_id = linode_firewall.e2e_test_firewall.id 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/private_networking.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_private_networking" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | image = "{{.Image}}" 9 | region = "{{ .Region }}" 10 | root_pass = "{{ .RootPass }}" 11 | swap_size = 256 12 | private_ip = true 13 | authorized_keys = ["{{.PubKey}}"] 14 | group = "tf_test" 15 | firewall_id = linode_firewall.e2e_test_firewall.id 16 | } 17 | 18 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/public_interface.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_public_interface" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_vpc" "foobar" { 6 | label = "{{.Label}}" 7 | region = "{{.Region}}" 8 | } 9 | 10 | resource "linode_vpc_subnet" "foobar" { 11 | vpc_id = linode_vpc.foobar.id 12 | label = "{{.Label}}" 13 | ipv4 = "10.0.4.0/24" 14 | } 15 | 16 | resource "linode_instance" "foobar" { 17 | label = "{{.Label}}" 18 | type = "g6-nanode-1" 19 | region = "{{ .Region }}" 20 | image = "{{ .Image }}" 21 | 22 | interface { 23 | purpose = "public" 24 | } 25 | 26 | firewall_id = linode_firewall.e2e_test_firewall.id 27 | } 28 | 29 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/raw_disk.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_raw_disk" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | disk { 11 | label = "disk" 12 | size = 3000 13 | } 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/raw_disk_deleted.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_raw_disk_deleted" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{.Label}}" 5 | group = "tf_test" 6 | type = "g6-nanode-1" 7 | region = "{{ .Region }}" 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/raw_disk_expanded.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_raw_disk_expanded" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-standard-1" 9 | region = "{{ .Region }}" 10 | disk { 11 | label = "disk" 12 | size = 6000 13 | } 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/tag.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_tag" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | tags = ["tf_test"] 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | config { 11 | label = "config" 12 | kernel = "linode/latest-64bit" 13 | } 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/tag_update.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_tag_update" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | tags = ["tf_test", "tf_test_2"] 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | config { 11 | label = "config" 12 | kernel = "linode/latest-64bit" 13 | } 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/tag_update_case_change.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_tag_update_case_change" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | tags = ["tf_TeSt", "tf_test_2"] 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | config { 11 | label = "config" 12 | kernel = "linode/latest-64bit" 13 | } 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/tag_volume.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_tag_volume" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_volume" "foobar" { 6 | label = "{{.Label}}" 7 | region = "{{ .Region }}" 8 | size = 20 9 | } 10 | 11 | resource "linode_instance" "foobar" { 12 | label = "{{.Label}}" 13 | tags = ["{{.Tag}}"] 14 | type = "g6-nanode-1" 15 | region = "{{ .Region }}" 16 | 17 | config { 18 | label = "config" 19 | kernel = "linode/latest-64bit" 20 | devices { 21 | sda { 22 | volume_id = linode_volume.foobar.id 23 | } 24 | } 25 | } 26 | firewall_id = linode_firewall.e2e_test_firewall.id 27 | } 28 | 29 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/type_change_disk.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_type_change_disk" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "{{.Type}}" 9 | region = "{{ .Region }}" 10 | image = "{{.Image}}" 11 | resize_disk = true 12 | firewall_id = linode_firewall.e2e_test_firewall.id 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/type_change_disk_explicit.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_type_change_disk_explicit" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "{{.Type}}" 9 | region = "{{ .Region }}" 10 | 11 | # We expect this to fail as the user has defined their own disks 12 | {{ if .ResizeDisk }} resize_disk = {{.ResizeDisk}} {{ end }} 13 | 14 | disk { 15 | label = "disk" 16 | size = 6000 17 | } 18 | 19 | firewall_id = linode_firewall.e2e_test_firewall.id 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/type_change_disk_none.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_type_change_disk_none" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "{{.Type}}" 9 | region = "{{ .Region }}" 10 | 11 | {{ if .ResizeDisk }} resize_disk = {{.ResizeDisk}} {{ end }} 12 | 13 | firewall_id = linode_firewall.e2e_test_firewall.id 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/type_change_warm.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_type_change_warm" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{.Label}}" 5 | group = "tf_test" 6 | type = "{{.Type}}" 7 | region = "{{ .Region }}" 8 | image = "{{.Image}}" 9 | resize_disk = true 10 | migration_type = "warm" 11 | } 12 | 13 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_updates" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}_r" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | group = "tf_test_r" 10 | 11 | config { 12 | label = "config" 13 | kernel = "linode/latest-64bit" 14 | root_device = "/dev/sda" 15 | } 16 | 17 | boot_config_label = "config" 18 | firewall_id = linode_firewall.e2e_test_firewall.id 19 | } 20 | 21 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/userdata.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_userdata" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | image = "{{.Image}}" 9 | region = "{{ .Region }}" 10 | root_pass = "{{ .RootPass }}" 11 | booted = false 12 | 13 | metadata { 14 | user_data = base64encode("myuserdata") 15 | } 16 | 17 | firewall_id = linode_firewall.e2e_test_firewall.id 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/vpu.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_vpu" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g1-accelerated-netint-vpu-t1u1-s" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | root_pass = "{{ .RootPass }}" 12 | swap_size = 256 13 | authorized_keys = ["{{.PubKey}}"] 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/watchdog_disabled.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_watchdog_disabled" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | region = "{{ .Region }}" 8 | image = "{{.Image}}" 9 | type = "g6-nanode-1" 10 | root_pass = "{{ .RootPass }}" 11 | 12 | watchdog_enabled = false 13 | firewall_id = linode_firewall.e2e_test_firewall.id 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/with_config.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_with_config" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | alerts { 11 | cpu = 60 12 | } 13 | config { 14 | label = "config" 15 | kernel = "linode/latest-64bit" 16 | root_device = "/dev/sda" 17 | 18 | run_level = "binbash" 19 | virt_mode = "fullvirt" 20 | memory_limit = 1024 21 | 22 | helpers { 23 | network = true 24 | } 25 | } 26 | 27 | boot_config_label = "config" 28 | firewall_id = linode_firewall.e2e_test_firewall.id 29 | } 30 | 31 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/with_pg.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_with_pg" }} 2 | 3 | {{ range $group_id := .PlacementGroups }} 4 | 5 | resource "linode_placement_group" "{{ $group_id }}" { 6 | label = "{{ $.Label }}-{{ $group_id }}" 7 | region = "{{ $.Region }}" 8 | placement_group_type = "anti_affinity:local" 9 | placement_group_policy = "flexible" 10 | } 11 | 12 | {{ end }} 13 | 14 | resource "linode_instance" "foobar" { 15 | label = "{{.Label}}" 16 | type = "g6-nanode-1" 17 | region = "{{ .Region }}" 18 | 19 | {{ if ne .AssignedGroup "" }} 20 | placement_group { 21 | id = linode_placement_group.{{ .AssignedGroup }}.id 22 | } 23 | {{ end }} 24 | } 25 | 26 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/with_swapsize.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_with_swap_size" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | root_pass = "{{ .RootPass }}" 12 | swap_size = {{.SwapSize}} 13 | authorized_keys = ["{{.PubKey}}"] 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instance/tmpl/templates/with_type.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_with_type" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "{{.Type}}" 9 | image = "{{.Image}}" 10 | region = "{{ .Region }}" 11 | root_pass = "{{ .RootPass }}" 12 | swap_size = 256 13 | authorized_keys = ["{{.PubKey}}"] 14 | firewall_id = linode_firewall.e2e_test_firewall.id 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_basic" }} 2 | 3 | {{ template "instance_config_empty_instance" . }} 4 | 5 | resource "linode_instance_config" "foobar" { 6 | linode_id = linode_instance.foobar.id 7 | label = "my-config" 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/booted.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_booted" }} 2 | 3 | {{ template "instance_config_empty_instance" . }} 4 | 5 | {{ template "instance_config_disk" . }} 6 | 7 | resource "linode_instance_config" "foobar" { 8 | linode_id = linode_instance.foobar.id 9 | label = "my-config" 10 | 11 | devices { 12 | sda { 13 | disk_id = linode_instance_disk.foobar.id 14 | } 15 | } 16 | 17 | booted = {{ .Booted }} 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/device_block.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_device_block" }} 2 | 3 | {{ template "instance_config_empty_instance" . }} 4 | 5 | {{ template "instance_config_disk_with_swap" . }} 6 | 7 | resource "linode_instance_config" "foobar" { 8 | linode_id = linode_instance.foobar.id 9 | label = "my-config" 10 | 11 | device { 12 | device_name = "sda" 13 | disk_id = linode_instance_disk.foobar.id 14 | } 15 | 16 | device { 17 | device_name = "sdb" 18 | disk_id = linode_instance_disk.foobar_swap.id 19 | } 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/device_named_block.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_device_named_block" }} 2 | 3 | {{ template "instance_config_empty_instance" . }} 4 | 5 | {{ template "instance_config_disk_with_swap" . }} 6 | 7 | resource "linode_instance_config" "foobar" { 8 | linode_id = linode_instance.foobar.id 9 | label = "my-config" 10 | 11 | devices { 12 | sda { 13 | disk_id = linode_instance_disk.foobar.id 14 | } 15 | 16 | sdb { 17 | disk_id = linode_instance_disk.foobar_swap.id 18 | } 19 | } 20 | } 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/empty_instance.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_empty_instance" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{ .Label }}" 5 | type = "g6-nanode-1" 6 | region = "{{ .Region }}" 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/instance_disk.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_disk" }} 2 | 3 | resource "linode_instance_disk" "foobar" { 4 | label = "boot" 5 | linode_id = linode_instance.foobar.id 6 | size = linode_instance.foobar.specs.0.disk 7 | 8 | image = "linode/alpine3.20" 9 | root_pass = "{{ .RootPass }}" 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/instance_disk_with_swap.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_disk_with_swap" }} 2 | 3 | resource "linode_instance_disk" "foobar" { 4 | label = "boot" 5 | linode_id = linode_instance.foobar.id 6 | size = linode_instance.foobar.specs.0.disk - linode_instance_disk.foobar_swap.size 7 | 8 | image = "linode/ubuntu22.04" 9 | root_pass = "{{ .RootPass }}" 10 | } 11 | 12 | resource "linode_instance_disk" "foobar_swap" { 13 | label = "swap" 14 | linode_id = linode_instance.foobar.id 15 | size = 1024 16 | filesystem = "swap" 17 | } 18 | 19 | {{ end }} 20 | -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/provisioner.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_config_provisioner" }} 2 | 3 | {{ template "instance_config_empty_instance" . }} 4 | 5 | {{ template "instance_config_disk" . }} 6 | 7 | resource "linode_instance_config" "foobar" { 8 | linode_id = linode_instance.foobar.id 9 | label = "my-config" 10 | 11 | devices { 12 | sda { 13 | disk_id = linode_instance_disk.foobar.id 14 | } 15 | } 16 | 17 | booted = true 18 | 19 | connection { 20 | host = linode_instance.foobar.ip_address 21 | user = "root" 22 | password = "{{ .RootPass }}" 23 | } 24 | 25 | provisioner "remote-exec" { 26 | inline = [ 27 | "echo 'Hello World!'" 28 | ] 29 | } 30 | } 31 | 32 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceconfig/tmpl/vpc.gotf: -------------------------------------------------------------------------------- 1 | {{ define "vpc_for_instance_config" }} 2 | 3 | resource "linode_vpc" "foobar" { 4 | label = join("", ["{{.Label}}", "-vpc"]) 5 | region = "{{.Region}}" 6 | description = "test description" 7 | } 8 | 9 | resource "linode_vpc_subnet" "foobar" { 10 | vpc_id = linode_vpc.foobar.id 11 | label = join("", ["{{.Label}}", "-subnet"]) 12 | ipv4 = "10.0.4.0/24" 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/instancedisk/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk_basic" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{ .Label }}" 5 | type = "g6-nanode-1" 6 | region = "{{ .Region }}" 7 | } 8 | 9 | resource "linode_instance_disk" "foobar" { 10 | label = "{{ .Label }}" 11 | linode_id = linode_instance.foobar.id 12 | size = {{ .Size }} 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/instancedisk/tmpl/booted_resize.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_disk_booted_resize" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{ .Label }}" 5 | type = "g6-nanode-1" 6 | region = "{{ .Region }}" 7 | } 8 | 9 | resource "linode_instance_disk" "foobar" { 10 | label = "{{ .Label }}" 11 | linode_id = linode_instance.foobar.id 12 | size = {{ .Size }} 13 | 14 | image = "linode/debian12" 15 | root_pass = "{{ .RootPass }}" 16 | } 17 | 18 | resource "linode_instance_config" "cfg" { 19 | linode_id = linode_instance.foobar.id 20 | label = "my-config" 21 | 22 | devices { 23 | sda { 24 | disk_id = linode_instance_disk.foobar.id 25 | } 26 | } 27 | 28 | booted = true 29 | } 30 | 31 | {{ end }} -------------------------------------------------------------------------------- /linode/instanceip/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_ip_basic" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{.Label}}" 5 | group = "tf_test" 6 | type = "g6-nanode-1" 7 | region = "{{ .Region }}" 8 | image = "linode/debian12" 9 | } 10 | 11 | resource "linode_instance_ip" "test" { 12 | linode_id = linode_instance.foobar.id 13 | public = true 14 | apply_immediately = {{.ApplyImmediately}} 15 | } 16 | 17 | {{ end }} 18 | -------------------------------------------------------------------------------- /linode/instanceip/tmpl/no_boot.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_ip_no_boot" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{.Label}}" 5 | group = "tf_test" 6 | type = "g6-nanode-1" 7 | region = "{{ .Region }}" 8 | } 9 | 10 | resource "linode_instance_ip" "test" { 11 | linode_id = linode_instance.foobar.id 12 | public = true 13 | apply_immediately = {{.ApplyImmediately}} 14 | } 15 | 16 | {{ end }} -------------------------------------------------------------------------------- /linode/instancenetworking/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_networking_data_basic" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{.Label}}" 5 | type = "g6-nanode-1" 6 | region = "{{ .Region }}" 7 | image = "linode/debian12" 8 | } 9 | 10 | data "linode_instance_networking" "test" { 11 | linode_id = linode_instance.foobar.id 12 | } 13 | 14 | {{ end }} 15 | -------------------------------------------------------------------------------- /linode/instancenetworking/tmpl/data_basic_reserved.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_networking_data_basic_with_reserved" }} 2 | 3 | resource "linode_instance" "foobar" { 4 | label = "{{.Label}}" 5 | type = "g6-nanode-1" 6 | region = "{{ .Region }}" 7 | image = "linode/debian12" 8 | } 9 | 10 | resource "linode_networking_ip" "reserved_ip" { 11 | region = "{{ .Region }}" 12 | public = true 13 | type = "ipv4" 14 | reserved = true 15 | linode_id = linode_instance.foobar.id 16 | } 17 | 18 | data "linode_instance_networking" "test" { 19 | linode_id = linode_instance.foobar.id 20 | } 21 | 22 | {{ end }} 23 | -------------------------------------------------------------------------------- /linode/instancenetworking/tmpl/data_vpc.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_networking_data_vpc" }} 2 | 3 | {{ template "vpc_subnet_basic" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | image = "linode/debian12" 10 | 11 | interface { 12 | purpose = "vpc" 13 | subnet_id = linode_vpc_subnet.foobar.id 14 | ipv4 { 15 | vpc = "{{ .InterfaceIPv4 }}" 16 | nat_1_1 = "any" 17 | } 18 | } 19 | } 20 | 21 | data "linode_instance_networking" "test" { 22 | linode_id = linode_instance.foobar.id 23 | } 24 | 25 | {{ end }} 26 | -------------------------------------------------------------------------------- /linode/instancereservedipassignment/tmpl/AddReservedIPToInstance.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_ip_add_reservedIP" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | group = "tf_test" 8 | type = "g6-nanode-1" 9 | region = "{{ .Region }}" 10 | image = "linode/debian12" 11 | firewall_id = linode_firewall.e2e_test_firewall.id 12 | } 13 | 14 | resource "linode_networking_ip" "test" { 15 | type = "ipv4" 16 | region = "{{ .Region }}" 17 | public = true 18 | reserved = true 19 | } 20 | 21 | resource "linode_reserved_ip_assignment" "test" { 22 | linode_id = linode_instance.foobar.id 23 | public = true 24 | address = linode_networking_ip.test.address 25 | } 26 | 27 | {{ end }} -------------------------------------------------------------------------------- /linode/instancereservedipassignment/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Label string 11 | ApplyImmediately bool 12 | Region string 13 | } 14 | 15 | func AddReservedIP(t *testing.T, instanceLabel, region string) string { 16 | return acceptance.ExecuteTemplate(t, 17 | "instance_ip_add_reservedIP", TemplateData{ 18 | Label: instanceLabel, 19 | Region: region, 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /linode/instancesharedips/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Label string 11 | Region string 12 | } 13 | 14 | func SingleNode(t testing.TB, instanceLabel, region string) string { 15 | return acceptance.ExecuteTemplate(t, 16 | "instance_shared_ips_single_node", TemplateData{ 17 | Label: instanceLabel, 18 | Region: region, 19 | }) 20 | } 21 | 22 | func DualNode(t testing.TB, instanceLabel, region string) string { 23 | return acceptance.ExecuteTemplate(t, 24 | "instance_shared_ips_dual_node", TemplateData{ 25 | Label: instanceLabel, 26 | Region: region, 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /linode/instancetype/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_type_data_basic" }} 2 | 3 | data "linode_instance_type" "foobar" { 4 | id = "{{.ID}}" 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/instancetype/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | ID string 11 | } 12 | 13 | func DataBasic(t testing.TB, id string) string { 14 | return acceptance.ExecuteTemplate(t, 15 | "instance_type_data_basic", TemplateData{ 16 | ID: id, 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /linode/instancetypes/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_types_data_basic" }} 2 | 3 | data "linode_instance_types" "foobar" { 4 | order_by = "vcpus" 5 | order = "desc" 6 | 7 | filter { 8 | name = "label" 9 | values = ["Linode 4GB"] 10 | } 11 | } 12 | 13 | {{ end }} -------------------------------------------------------------------------------- /linode/instancetypes/tmpl/data_by_class.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_types_data_by_class" }} 2 | 3 | data "linode_instance_types" "foobar" { 4 | filter { 5 | name = "vcpus" 6 | values = [ "4" ] 7 | } 8 | filter { 9 | name = "memory" 10 | values = [ "8192" ] 11 | } 12 | filter { 13 | name = "class" 14 | values = [ "standard" ] 15 | } 16 | } 17 | 18 | {{ end }} -------------------------------------------------------------------------------- /linode/instancetypes/tmpl/data_regex.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_types_data_regex" }} 2 | 3 | data "linode_instance_types" "foobar" { 4 | filter { 5 | name = "label" 6 | values = ["Dedicated .*"] 7 | match_by = "re" 8 | } 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/instancetypes/tmpl/data_substring.gotf: -------------------------------------------------------------------------------- 1 | {{ define "instance_types_data_substring" }} 2 | 3 | data "linode_instance_types" "foobar" { 4 | filter { 5 | name = "label" 6 | values = ["Linode"] 7 | match_by = "substring" 8 | } 9 | } 10 | 11 | {{ end }} -------------------------------------------------------------------------------- /linode/instancetypes/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | func DataBasic(t testing.TB) string { 10 | return acceptance.ExecuteTemplate(t, 11 | "instance_types_data_basic", nil) 12 | } 13 | 14 | func DataSubstring(t testing.TB) string { 15 | return acceptance.ExecuteTemplate(t, 16 | "instance_types_data_substring", nil) 17 | } 18 | 19 | func DataRegex(t testing.TB) string { 20 | return acceptance.ExecuteTemplate(t, 21 | "instance_types_data_regex", nil) 22 | } 23 | 24 | func DataByClass(t testing.TB) string { 25 | return acceptance.ExecuteTemplate(t, 26 | "instance_types_data_by_class", nil) 27 | } 28 | -------------------------------------------------------------------------------- /linode/ipv6range/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "ipv6range_basic" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | booted = false 10 | firewall_id = linode_firewall.e2e_test_firewall.id 11 | } 12 | 13 | resource "linode_ipv6_range" "foobar" { 14 | linode_id = linode_instance.foobar.id 15 | 16 | prefix_length = 64 17 | } 18 | 19 | {{ end }} -------------------------------------------------------------------------------- /linode/ipv6range/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "ipv6range_data_basic" }} 2 | 3 | {{ template "ipv6range_basic" . }} 4 | 5 | data "linode_ipv6_range" "foobar" { 6 | range = linode_ipv6_range.foobar.range 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/ipv6range/tmpl/no_id.gotf: -------------------------------------------------------------------------------- 1 | {{ define "ipv6range_no_id" }} 2 | 3 | resource "linode_ipv6_range" "foobar" { 4 | prefix_length = 64 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/ipv6range/tmpl/race_condition.gotf: -------------------------------------------------------------------------------- 1 | {{ define "ipv6range_race_condition" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | count = 5 7 | 8 | label = "{{.Label}}-${count.index}" 9 | type = "g6-nanode-1" 10 | region = "{{ .Region }}" 11 | booted = false 12 | firewall_id = linode_firewall.e2e_test_firewall.id 13 | } 14 | 15 | resource "linode_ipv6_range" "foobar" { 16 | count = 5 17 | 18 | linode_id = linode_instance.foobar[count.index].id 19 | 20 | prefix_length = 64 21 | } 22 | 23 | {{ end }} -------------------------------------------------------------------------------- /linode/ipv6range/tmpl/route_target.gotf: -------------------------------------------------------------------------------- 1 | {{ define "ipv6range_route_target" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_instance" "foobar" { 6 | label = "{{.Label}}" 7 | type = "g6-nanode-1" 8 | region = "{{ .Region }}" 9 | booted = false 10 | firewall_id = linode_firewall.e2e_test_firewall.id 11 | } 12 | 13 | resource "linode_ipv6_range" "foobar" { 14 | route_target = linode_instance.foobar.ipv6 15 | 16 | prefix_length = 64 17 | } 18 | 19 | {{ end }} -------------------------------------------------------------------------------- /linode/ipv6ranges/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Label string 11 | Region string 12 | } 13 | 14 | func DataBasic(t testing.TB, label, region string) string { 15 | return acceptance.ExecuteTemplate(t, 16 | "ipv6ranges_data_basic", TemplateData{ 17 | Label: label, 18 | Region: region, 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /linode/kernel/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "kernel_data_basic" }} 2 | 3 | data "linode_kernel" "foobar" { 4 | id = "{{.ID}}" 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/kernel/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | ID string 11 | } 12 | 13 | func DataBasic(t testing.TB, kernelID string) string { 14 | return acceptance.ExecuteTemplate(t, 15 | "kernel_data_basic", TemplateData{ID: kernelID}) 16 | } 17 | -------------------------------------------------------------------------------- /linode/kernels/tmpl/data_base.gotf: -------------------------------------------------------------------------------- 1 | {{ define "kernels_data_base" }} 2 | 3 | data "linode_kernel" "kernel" { 4 | count = 1 5 | id = "{{.Id}}" 6 | } 7 | 8 | {{ end }} -------------------------------------------------------------------------------- /linode/kernels/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "kernels_data_basic" }} 2 | 3 | {{ template "kernels_data_base" .}} 4 | 5 | data "linode_kernels" "kernels" { 6 | filter { 7 | name = "id" 8 | values = [data.linode_kernel.kernel.0.id] 9 | } 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/kernels/tmpl/data_filter.gotf: -------------------------------------------------------------------------------- 1 | {{ define "kernels_data_filter" }} 2 | 3 | {{ template "kernels_data_base" . }} 4 | 5 | data "linode_kernels" "kernels" { 6 | filter { 7 | name = "id" 8 | values = ["{{.Id}}"] 9 | } 10 | 11 | filter { 12 | name = "architecture" 13 | values = ["x86_64"] 14 | } 15 | 16 | filter { 17 | name = "deprecated" 18 | values = [false] 19 | } 20 | 21 | filter { 22 | name = "kvm" 23 | values = [true] 24 | } 25 | 26 | filter { 27 | name = "label" 28 | values = ["Latest 64 bit"] 29 | match_by="substring" 30 | } 31 | 32 | filter { 33 | name = "pvops" 34 | values = [true] 35 | } 36 | 37 | } 38 | 39 | {{ end }} -------------------------------------------------------------------------------- /linode/kernels/tmpl/data_filter_empty.gotf: -------------------------------------------------------------------------------- 1 | {{ define "kernels_data_filter_empty" }} 2 | 3 | {{ template "kernels_data_base" . }} 4 | 5 | data "linode_kernels" "kernels" { 6 | filter { 7 | name = "label" 8 | values = ["not-real-label"] 9 | } 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/kernels/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Id string 11 | } 12 | 13 | func DataBasic(t testing.TB, id string) string { 14 | return acceptance.ExecuteTemplate(t, 15 | "kernels_data_basic", TemplateData{ 16 | Id: id, 17 | }) 18 | } 19 | 20 | func DataFilter(t testing.TB, id string) string { 21 | return acceptance.ExecuteTemplate(t, 22 | "kernels_data_filter", TemplateData{ 23 | Id: id, 24 | }) 25 | } 26 | 27 | func DataFilterEmpty(t testing.TB, id string) string { 28 | return acceptance.ExecuteTemplate(t, 29 | "kernels_data_filter_empty", TemplateData{ 30 | Id: id, 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /linode/lke/tmpl/acl_disabled_addresses_disallowed.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_acl_disabled_addresses_disallowed" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{ .Label }}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{ .K8sVersion }}" 7 | tags = ["test"] 8 | 9 | control_plane { 10 | acl { 11 | enabled = false 12 | addresses { 13 | ipv4 = ["0.0.0.0/0"] 14 | ipv6 = ["2001:db8::/32"] 15 | } 16 | } 17 | } 18 | 19 | pool { 20 | type = "g6-standard-1" 21 | count = 1 22 | } 23 | } 24 | 25 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/apl.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_apl_enabled" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | apl_enabled = "true" 10 | 11 | pool { 12 | type = "g6-dedicated-4" 13 | count = 3 14 | tags = ["test"] 15 | } 16 | } 17 | 18 | data "linode_instances" "test" { 19 | depends_on = [linode_lke_cluster.test] 20 | 21 | filter { 22 | name = "id" 23 | values = [linode_lke_cluster.test.pool.0.nodes.0.instance_id] 24 | } 25 | } 26 | 27 | {{ end }} 28 | -------------------------------------------------------------------------------- /linode/lke/tmpl/autoscaler.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_autoscaler" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | 10 | pool { 11 | autoscaler { 12 | min = 1 13 | max = 5 14 | } 15 | type = "g6-standard-1" 16 | count = 3 17 | } 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/autoscaler_many_pools.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_autoscaler_many_pools" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{ .Label }}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{ .K8sVersion }}" 7 | tags = ["test"] 8 | tier = "standard" 9 | 10 | pool { 11 | autoscaler { 12 | min = 3 13 | max = 8 14 | } 15 | type = "g6-standard-1" 16 | count = 5 17 | } 18 | pool { 19 | autoscaler { 20 | min = 1 21 | max = 8 22 | } 23 | type = "g6-standard-1" 24 | count = 3 25 | } 26 | } 27 | 28 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/autoscaler_no_count.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_autoscaler_no_count" }} 2 | 3 | # This is expected to fail 4 | resource "linode_lke_cluster" "test" { 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | k8s_version = "{{.K8sVersion}}" 8 | tier = "standard" 9 | 10 | pool { 11 | type = "g6-standard-1" 12 | 13 | autoscaler { 14 | min = 2 15 | max = 4 16 | } 17 | } 18 | } 19 | 20 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/autoscaler_updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_autoscaler_updates" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | pool { 10 | autoscaler { 11 | min = 1 12 | max = 8 13 | } 14 | type = "g6-standard-1" 15 | count = 3 16 | } 17 | } 18 | 19 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_basic" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | 10 | pool { 11 | type = "g6-standard-1" 12 | count = 3 13 | tags = ["test"] 14 | } 15 | } 16 | 17 | data "linode_instances" "test" { 18 | depends_on = [linode_lke_cluster.test] 19 | 20 | filter { 21 | name = "id" 22 | values = [linode_lke_cluster.test.pool.0.nodes.0.instance_id] 23 | } 24 | } 25 | 26 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/complex_pools.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_complex_pools" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | 10 | pool { 11 | type = "g6-standard-2" 12 | count = 2 13 | } 14 | 15 | pool { 16 | type = "g6-standard-1" 17 | count = 1 18 | } 19 | 20 | pool { 21 | type = "g6-standard-1" 22 | count = 2 23 | } 24 | 25 | pool { 26 | type = "g6-standard-4" 27 | count = 2 28 | } 29 | } 30 | 31 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/control_plane.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_control_plane" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | 10 | control_plane { 11 | high_availability = {{ .HighAvailability }} 12 | acl { 13 | enabled = {{ .ACLEnabled }} 14 | addresses { 15 | ipv4 = ["{{.IPv4}}"] 16 | ipv6 = ["{{.IPv6}}"] 17 | } 18 | } 19 | } 20 | 21 | pool { 22 | type = "g6-standard-2" 23 | count = 1 24 | } 25 | } 26 | 27 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/data_autoscaler.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_data_autoscaler" }} 2 | 3 | {{ template "lke_cluster_autoscaler" . }} 4 | 5 | data "linode_lke_cluster" "test" { 6 | id = linode_lke_cluster.test.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_data_basic" }} 2 | 3 | {{ template "lke_cluster_basic" . }} 4 | 5 | data "linode_lke_cluster" "test" { 6 | id = linode_lke_cluster.test.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/data_control_plane.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_data_control_plane" }} 2 | 3 | {{ template "lke_cluster_control_plane" . }} 4 | 5 | data "linode_lke_cluster" "test" { 6 | id = linode_lke_cluster.test.id 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/data_taints_labels.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_data_taints_labels" }} 2 | 3 | {{ template "lke_cluster_taints_labels" . }} 4 | 5 | data "linode_lke_cluster" "test" { 6 | id = linode_lke_cluster.test.id 7 | } 8 | 9 | {{ end }} 10 | -------------------------------------------------------------------------------- /linode/lke/tmpl/enterprise.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_enterprise" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "enterprise" 9 | 10 | pool { 11 | type = "g6-standard-1" 12 | count = 3 13 | tags = ["test"] 14 | } 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/many_pools.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_many_pools" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | 10 | pool { 11 | type = "g6-standard-1" 12 | count = 1 13 | } 14 | 15 | pool { 16 | type = "g6-standard-1" 17 | count = 1 18 | } 19 | } 20 | 21 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/no_count.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_no_count" }} 2 | 3 | # This is expected to fail 4 | resource "linode_lke_cluster" "test" { 5 | label = "{{.Label}}" 6 | region = "{{ .Region }}" 7 | k8s_version = "{{.K8sVersion}}" 8 | 9 | pool { 10 | type = "g6-standard-1" 11 | } 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/lke/tmpl/updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_cluster_updates" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test", "new_tag"] 8 | tier = "standard" 9 | 10 | pool { 11 | type = "g6-standard-1" 12 | count = 4 13 | tags = ["test", "test-2"] 14 | } 15 | } 16 | 17 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeclusters/tmpl/data_base.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_clusters_data_base" }} 2 | 3 | resource "linode_lke_cluster" "test" { 4 | label = "{{.Label}}" 5 | region = "{{ .Region }}" 6 | k8s_version = "{{.K8sVersion}}" 7 | tags = ["test"] 8 | tier = "standard" 9 | 10 | pool { 11 | type = "g6-standard-2" 12 | count = 3 13 | } 14 | } 15 | 16 | resource "linode_lke_cluster" "test2" { 17 | label = "{{.Label}}-2" 18 | region = "{{ .Region }}" 19 | k8s_version = "{{.K8sVersion}}" 20 | tags = ["test-2"] 21 | tier = "standard" 22 | 23 | pool { 24 | type = "g6-standard-2" 25 | count = 1 26 | } 27 | } 28 | 29 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeclusters/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_clusters_data_basic" }} 2 | 3 | {{ template "lke_clusters_data_base" . }} 4 | 5 | data "linode_lke_clusters" "test" { 6 | depends_on = [linode_lke_cluster.test, linode_lke_cluster.test2] 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeclusters/tmpl/data_filter.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_clusters_data_filter" }} 2 | 3 | {{ template "lke_clusters_data_base" . }} 4 | 5 | data "linode_lke_clusters" "test" { 6 | depends_on = [linode_lke_cluster.test, linode_lke_cluster.test2] 7 | filter { 8 | name = "label" 9 | values = ["{{.Label}}"] 10 | } 11 | 12 | filter { 13 | name = "tier" 14 | values = ["standard"] 15 | } 16 | } 17 | 18 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeclusters/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateData struct { 10 | Label string 11 | K8sVersion string 12 | HighAvailability bool 13 | Region string 14 | } 15 | 16 | func DataBasic(t testing.TB, name, version, region string) string { 17 | return acceptance.ExecuteTemplate(t, 18 | "lke_clusters_data_basic", TemplateData{Label: name, K8sVersion: version, Region: region}) 19 | } 20 | 21 | func DataFilter(t testing.TB, name, version, region string) string { 22 | return acceptance.ExecuteTemplate(t, 23 | "lke_clusters_data_filter", TemplateData{Label: name, K8sVersion: version, Region: region}) 24 | } 25 | -------------------------------------------------------------------------------- /linode/lketypes/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_types_data_basic" }} 2 | 3 | data "linode_lke_types" "foobar" { 4 | filter { 5 | name = "label" 6 | values = ["LKE Standard Availability"] 7 | } 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/lketypes/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | func DataBasic(t testing.TB) string { 10 | return acceptance.ExecuteTemplate(t, 11 | "lke_types_data_basic", nil) 12 | } 13 | -------------------------------------------------------------------------------- /linode/lkeversion/tmpl/data_no_tier.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_version_data_no_tier" }} 2 | 3 | data "linode_lke_version" "foobar" { 4 | id = "{{.ID}}" 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeversion/tmpl/data_tier.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_version_data_tier" }} 2 | 3 | data "linode_lke_version" "foobar" { 4 | id = "{{.ID}}" 5 | tier = "{{.Tier}}" 6 | } 7 | 8 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeversion/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateDataNoTier struct { 10 | ID string 11 | } 12 | 13 | type TemplateDataTier struct { 14 | ID string 15 | Tier string 16 | } 17 | 18 | func DataNoTier(t testing.TB, id string) string { 19 | return acceptance.ExecuteTemplate(t, 20 | "lke_version_data_no_tier", TemplateDataNoTier{ 21 | ID: id, 22 | }) 23 | } 24 | 25 | func DataTier(t testing.TB, id, tier string) string { 26 | return acceptance.ExecuteTemplate(t, 27 | "lke_version_data_tier", TemplateDataTier{ 28 | ID: id, 29 | Tier: tier, 30 | }) 31 | } 32 | -------------------------------------------------------------------------------- /linode/lkeversions/tmpl/data_no_tier.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_versions_data_no_tier" }} 2 | 3 | data "linode_lke_versions" "foobar" {} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeversions/tmpl/data_tier.gotf: -------------------------------------------------------------------------------- 1 | {{ define "lke_versions_data_tier" }} 2 | 3 | data "linode_lke_versions" "foobar" { 4 | tier = "{{.Tier}}" 5 | } 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /linode/lkeversions/tmpl/template.go: -------------------------------------------------------------------------------- 1 | package tmpl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/linode/terraform-provider-linode/v2/linode/acceptance" 7 | ) 8 | 9 | type TemplateDataTier struct { 10 | Tier string 11 | } 12 | 13 | func DataNoTier(t testing.TB) string { 14 | return acceptance.ExecuteTemplate(t, 15 | "lke_versions_data_no_tier", nil) 16 | } 17 | 18 | func DataTier(t testing.TB, tier string) string { 19 | return acceptance.ExecuteTemplate(t, 20 | "lke_versions_data_tier", TemplateDataTier{ 21 | Tier: tier, 22 | }) 23 | } 24 | -------------------------------------------------------------------------------- /linode/nb/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_basic" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_nodebalancer" "foobar" { 6 | label = "{{.Label}}" 7 | region = "{{ .Region }}" 8 | client_conn_throttle = 20 9 | client_udp_sess_throttle = 10 10 | tags = ["tf_test"] 11 | firewall_id = linode_firewall.e2e_test_firewall.id 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/nb/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_data_basic" }} 2 | 3 | {{ template "nodebalancer_basic" . }} 4 | 5 | data "linode_nodebalancer" "foobar" { 6 | id = "${linode_nodebalancer.foobar.id}" 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/nb/tmpl/data_firewalls.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_data_firewalls" }} 2 | 3 | {{ template "nodebalancer_firewall" . }} 4 | 5 | data "linode_nodebalancer" "foobar" { 6 | id = "${linode_nodebalancer.foobar.id}" 7 | } 8 | 9 | {{ end }} -------------------------------------------------------------------------------- /linode/nb/tmpl/firewall_updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_firewall_updates" }} 2 | 3 | resource "linode_nodebalancer" "foobar" { 4 | label = "{{.Label}}_r" 5 | region = "{{ .Region }}" 6 | client_conn_throttle = 0 7 | tags = ["tf_test", "tf_test_2"] 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/nb/tmpl/updates.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_updates" }} 2 | 3 | {{ template "e2e_test_firewall" . }} 4 | 5 | resource "linode_nodebalancer" "foobar" { 6 | label = "{{.Label}}_r" 7 | region = "{{ .Region }}" 8 | client_conn_throttle = 0 9 | client_udp_sess_throttle = 5 10 | tags = ["tf_test", "tf_test_2"] 11 | firewall_id = linode_firewall.e2e_test_firewall.id 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/nbconfig/tmpl/basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_config_basic" }} 2 | 3 | {{ template "nodebalancer_basic" .NodeBalancer }} 4 | 5 | resource "linode_nodebalancer_config" "foofig" { 6 | nodebalancer_id = "${linode_nodebalancer.foobar.id}" 7 | port = 8080 8 | protocol = "http" 9 | check = "http" 10 | check_passive = true 11 | check_path = "/" 12 | } 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /linode/nbconfig/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_config_data_basic" }} 2 | 3 | {{ template "nodebalancer_config_basic" . }} 4 | 5 | data "linode_nodebalancer_config" "foofig" { 6 | id = "${linode_nodebalancer_config.foofig.id}" 7 | nodebalancer_id = "${linode_nodebalancer.foobar.id}" 8 | } 9 | 10 | {{ end }} -------------------------------------------------------------------------------- /linode/nbconfig/tmpl/proxy_protocol.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_config_proxy_protocol" }} 2 | 3 | {{ template "nodebalancer_basic" .NodeBalancer }} 4 | 5 | resource "linode_nodebalancer_config" "foofig" { 6 | nodebalancer_id = "${linode_nodebalancer.foobar.id}" 7 | port = 80 8 | protocol = "tcp" 9 | proxy_protocol = "v2" 10 | } 11 | 12 | {{ end }} -------------------------------------------------------------------------------- /linode/nbconfig/tmpl/ssl.gotf: -------------------------------------------------------------------------------- 1 | {{ define "nodebalancer_config_ssl" }} 2 | 3 | {{ template "nodebalancer_basic" .NodeBalancer }} 4 | 5 | resource "linode_nodebalancer_config" "foofig" { 6 | nodebalancer_id = "${linode_nodebalancer.foobar.id}" 7 | port = 8080 8 | protocol = "https" 9 | check = "http" 10 | check_passive = true 11 | check_path = "/" 12 | ssl_cert = < 8 | echo bye 9 | EOF 10 | images = ["linode/ubuntu18.04", "linode/ubuntu16.04lts"] 11 | description = "tf_test stackscript" 12 | rev_note = "second" 13 | } 14 | 15 | {{ end }} -------------------------------------------------------------------------------- /linode/stackscript/tmpl/data_basic.gotf: -------------------------------------------------------------------------------- 1 | {{ define "stackscript_data_basic" }} 2 | 3 | resource "linode_stackscript" "stackscript" { 4 | label = "my_stackscript" 5 | script = <