├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── actions │ └── build │ │ └── action.yaml ├── docs │ └── contribution-guide │ │ ├── resource.go │ │ └── utils │ │ └── util.go ├── images │ └── stackit-logo.svg ├── pull_request_template.md ├── renovate.json └── workflows │ ├── ci.yaml │ ├── release.yaml │ ├── renovate.yaml │ ├── stale.yaml │ └── tf-acc-test.yaml ├── .gitignore ├── .goreleaser.yaml ├── CONTRIBUTION.md ├── LICENSE.md ├── MIGRATION.md ├── Makefile ├── NOTICE.txt ├── README.md ├── RELEASE.md ├── SECURITY.md ├── docs ├── data-sources │ ├── affinity_group.md │ ├── cdn_custom_domain.md │ ├── cdn_distribution.md │ ├── dns_record_set.md │ ├── dns_zone.md │ ├── git.md │ ├── image.md │ ├── key_pair.md │ ├── loadbalancer.md │ ├── logme_credential.md │ ├── logme_instance.md │ ├── mariadb_credential.md │ ├── mariadb_instance.md │ ├── mongodbflex_instance.md │ ├── mongodbflex_user.md │ ├── network.md │ ├── network_area.md │ ├── network_area_route.md │ ├── network_interface.md │ ├── objectstorage_bucket.md │ ├── objectstorage_credential.md │ ├── objectstorage_credentials_group.md │ ├── observability_alertgroup.md │ ├── observability_instance.md │ ├── observability_logalertgroup.md │ ├── observability_scrapeconfig.md │ ├── opensearch_credential.md │ ├── opensearch_instance.md │ ├── postgresflex_database.md │ ├── postgresflex_instance.md │ ├── postgresflex_user.md │ ├── public_ip.md │ ├── public_ip_ranges.md │ ├── rabbitmq_credential.md │ ├── rabbitmq_instance.md │ ├── redis_credential.md │ ├── redis_instance.md │ ├── resourcemanager_project.md │ ├── secretsmanager_instance.md │ ├── secretsmanager_user.md │ ├── security_group.md │ ├── security_group_rule.md │ ├── server.md │ ├── server_backup_schedule.md │ ├── server_backup_schedules.md │ ├── server_update_schedule.md │ ├── server_update_schedules.md │ ├── service_account.md │ ├── ske_cluster.md │ ├── sqlserverflex_instance.md │ ├── sqlserverflex_user.md │ └── volume.md ├── guides │ ├── aws_provider_s3_stackit.md │ ├── kubernetes_provider_ske.md │ ├── opting_into_beta_resources.md │ ├── ske_kube_state_metric_alerts.md │ ├── ske_log_alerts.md │ ├── stackit_cdn_with_custom_domain.md │ ├── stackit_org_service_account.md │ ├── using_loadbalancer_with_observability.md │ └── vault_secrets_manager.md ├── index.md └── resources │ ├── affinity_group.md │ ├── authorization_organization_role_assignment.md │ ├── authorization_project_role_assignment.md │ ├── cdn_custom_domain.md │ ├── cdn_distribution.md │ ├── dns_record_set.md │ ├── dns_zone.md │ ├── git.md │ ├── image.md │ ├── key_pair.md │ ├── loadbalancer.md │ ├── loadbalancer_observability_credential.md │ ├── logme_credential.md │ ├── logme_instance.md │ ├── mariadb_credential.md │ ├── mariadb_instance.md │ ├── modelserving_token.md │ ├── mongodbflex_instance.md │ ├── mongodbflex_user.md │ ├── network.md │ ├── network_area.md │ ├── network_area_route.md │ ├── network_interface.md │ ├── objectstorage_bucket.md │ ├── objectstorage_credential.md │ ├── objectstorage_credentials_group.md │ ├── observability_alertgroup.md │ ├── observability_credential.md │ ├── observability_instance.md │ ├── observability_logalertgroup.md │ ├── observability_scrapeconfig.md │ ├── opensearch_credential.md │ ├── opensearch_instance.md │ ├── postgresflex_database.md │ ├── postgresflex_instance.md │ ├── postgresflex_user.md │ ├── public_ip.md │ ├── public_ip_associate.md │ ├── rabbitmq_credential.md │ ├── rabbitmq_instance.md │ ├── redis_credential.md │ ├── redis_instance.md │ ├── resourcemanager_project.md │ ├── secretsmanager_instance.md │ ├── secretsmanager_user.md │ ├── security_group.md │ ├── security_group_rule.md │ ├── server.md │ ├── server_backup_schedule.md │ ├── server_network_interface_attach.md │ ├── server_service_account_attach.md │ ├── server_update_schedule.md │ ├── server_volume_attach.md │ ├── service_account.md │ ├── service_account_access_token.md │ ├── service_account_key.md │ ├── ske_cluster.md │ ├── ske_kubeconfig.md │ ├── sqlserverflex_instance.md │ ├── sqlserverflex_user.md │ └── volume.md ├── examples ├── data-sources │ ├── stackit_affinity_group │ │ └── data-source.tf │ ├── stackit_cdn_custom_domain │ │ └── data-source.tf │ ├── stackit_cdn_distribution │ │ └── data-source.tf │ ├── stackit_dns_record_set │ │ └── data-source.tf │ ├── stackit_dns_zone │ │ └── data-source.tf │ ├── stackit_git │ │ └── data-source.tf │ ├── stackit_image │ │ └── data-source.tf │ ├── stackit_key_pair │ │ └── data-source.tf │ ├── stackit_loadbalancer │ │ └── data-source.tf │ ├── stackit_logme_credential │ │ └── data-source.tf │ ├── stackit_logme_instance │ │ └── data-source.tf │ ├── stackit_mariadb_credential │ │ └── data-source.tf │ ├── stackit_mariadb_instance │ │ └── data-source.tf │ ├── stackit_mongodbflex_instance │ │ └── data-source.tf │ ├── stackit_mongodbflex_user │ │ └── data-source.tf │ ├── stackit_network │ │ └── data-source.tf │ ├── stackit_network_area │ │ └── data-source.tf │ ├── stackit_network_area_route │ │ └── data-source.tf │ ├── stackit_network_interface │ │ └── data-source.tf │ ├── stackit_objectstorage_bucket │ │ └── data-source.tf │ ├── stackit_objectstorage_credential │ │ └── data-source.tf │ ├── stackit_objectstorage_credentials_group │ │ └── data-source.tf │ ├── stackit_observability_alertgroup │ │ └── data-source.tf │ ├── stackit_observability_instance │ │ └── data-source.tf │ ├── stackit_observability_logalertgroup │ │ └── data-source.tf │ ├── stackit_observability_scrapeconfig │ │ └── data-source.tf │ ├── stackit_opensearch_credential │ │ └── data-source.tf │ ├── stackit_opensearch_instance │ │ └── data-source.tf │ ├── stackit_postgresflex_database │ │ └── data-source.tf │ ├── stackit_postgresflex_instance │ │ └── data-source.tf │ ├── stackit_postgresflex_user │ │ └── data-source.tf │ ├── stackit_public_ip │ │ └── data-source.tf │ ├── stackit_public_ip_ranges │ │ └── data-source.tf │ ├── stackit_rabbitmq_credential │ │ └── data-source.tf │ ├── stackit_rabbitmq_instance │ │ └── data-source.tf │ ├── stackit_redis_credential │ │ └── data-source.tf │ ├── stackit_redis_instance │ │ └── data-source.tf │ ├── stackit_resourcemanager_project │ │ └── data-source.tf │ ├── stackit_secretsmanager_instance │ │ └── data-source.tf │ ├── stackit_secretsmanager_user │ │ └── data-source.tf │ ├── stackit_security_group │ │ └── data-source.tf │ ├── stackit_security_group_rule │ │ └── data-source.tf │ ├── stackit_server │ │ └── data-source.tf │ ├── stackit_server_backup_schedule │ │ └── data-source.tf │ ├── stackit_server_backup_schedules │ │ └── data-source.tf │ ├── stackit_server_update_schedule │ │ └── data-source.tf │ ├── stackit_server_update_schedules │ │ └── data-source.tf │ ├── stackit_service_account │ │ └── data-source.tf │ ├── stackit_ske_cluster │ │ └── data-source.tf │ ├── stackit_sqlserverflex_instance │ │ └── data-source.tf │ ├── stackit_sqlserverflex_user │ │ └── data-source.tf │ └── stackit_volume │ │ └── data-source.tf ├── provider │ └── provider.tf └── resources │ ├── stackit_affinity_group │ └── resource.tf │ ├── stackit_authorization_organization_role_assignment │ └── resource.tf │ ├── stackit_authorization_project_role_assignment │ └── resource.tf │ ├── stackit_cdn_custom_domain │ └── resource.tf │ ├── stackit_cdn_distribution │ └── resource.tf │ ├── stackit_dns_record_set │ └── resource.tf │ ├── stackit_dns_zone │ └── resource.tf │ ├── stackit_git │ └── resource.tf │ ├── stackit_image │ └── resource.tf │ ├── stackit_loadbalancer │ └── resource.tf │ ├── stackit_loadbalancer_observability_credential │ └── resource.tf │ ├── stackit_logme_credential │ └── resource.tf │ ├── stackit_logme_instance │ └── resource.tf │ ├── stackit_mariadb_credential │ └── resource.tf │ ├── stackit_mariadb_instance │ └── resource.tf │ ├── stackit_mongodbflex_instance │ └── resource.tf │ ├── stackit_mongodbflex_user │ └── resource.tf │ ├── stackit_network │ └── resource.tf │ ├── stackit_network_area │ └── resource.tf │ ├── stackit_network_area_route │ └── resource.tf │ ├── stackit_network_interface │ └── resource.tf │ ├── stackit_objectstorage_bucket │ └── resource.tf │ ├── stackit_objectstorage_credential │ └── resource.tf │ ├── stackit_objectstorage_credentials_group │ └── resource.tf │ ├── stackit_observability_alertgroup │ └── resource.tf │ ├── stackit_observability_credential │ └── resource.tf │ ├── stackit_observability_instance │ └── resource.tf │ ├── stackit_observability_logalertgroup │ └── resource.tf │ ├── stackit_observability_scrapeconfig │ └── resource.tf │ ├── stackit_opensearch_credential │ └── resource.tf │ ├── stackit_opensearch_instance │ └── resource.tf │ ├── stackit_postgresflex_database │ └── resource.tf │ ├── stackit_postgresflex_instance │ └── resource.tf │ ├── stackit_postgresflex_user │ └── resource.tf │ ├── stackit_public_ip │ └── resource.tf │ ├── stackit_public_ip_associate │ └── resource.tf │ ├── stackit_rabbitmq_credential │ └── resource.tf │ ├── stackit_rabbitmq_instance │ └── resource.tf │ ├── stackit_redis_credential │ └── resource.tf │ ├── stackit_redis_instance │ └── resource.tf │ ├── stackit_resourcemanager_project │ └── resource.tf │ ├── stackit_secretsmanager_instance │ └── resource.tf │ ├── stackit_secretsmanager_user │ └── resource.tf │ ├── stackit_security_group │ └── resource.tf │ ├── stackit_security_group_rule │ └── resource.tf │ ├── stackit_server_backup_schedule │ └── resource.tf │ ├── stackit_server_network_interface_attach │ └── resource.tf │ ├── stackit_server_service_account_attach │ └── resource.tf │ ├── stackit_server_update_schedule │ └── resource.tf │ ├── stackit_server_volume_attach │ └── resource.tf │ ├── stackit_service_account │ └── resource.tf │ ├── stackit_ske_cluster │ └── resource.tf │ ├── stackit_ske_kubeconfig │ └── resource.tf │ ├── stackit_sqlserverflex_instance │ └── resource.tf │ ├── stackit_sqlserverflex_user │ └── resource.tf │ └── stackit_volume │ └── resource.tf ├── go.mod ├── go.sum ├── golang-ci.yaml ├── main.go ├── scripts ├── check-docs.sh ├── lint-golangci-lint.sh ├── project.sh ├── replace.sh └── tfplugindocs.sh ├── stackit ├── internal │ ├── conversion │ │ ├── conversion.go │ │ └── conversion_test.go │ ├── core │ │ ├── core.go │ │ └── core_test.go │ ├── features │ │ ├── beta.go │ │ ├── beta_test.go │ │ ├── experiments.go │ │ └── experiments_test.go │ ├── services │ │ ├── authorization │ │ │ ├── authorization_acc_test.go │ │ │ ├── roleassignments │ │ │ │ └── resource.go │ │ │ ├── testfiles │ │ │ │ ├── double-definition.tf │ │ │ │ ├── invalid-role.tf │ │ │ │ ├── organization-role.tf │ │ │ │ ├── prerequisites.tf │ │ │ │ └── project-owner.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── cdn │ │ │ ├── cdn_acc_test.go │ │ │ ├── customdomain │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── distribution │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── dns │ │ │ ├── dns_acc_test.go │ │ │ ├── recordset │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── testdata │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ ├── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ │ └── zone │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ ├── git │ │ │ ├── git_acc_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── testdata │ │ │ │ └── resource.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── iaas │ │ │ ├── affinitygroup │ │ │ │ ├── const.go │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── iaas_acc_test.go │ │ │ ├── image │ │ │ │ ├── datasource.go │ │ │ │ ├── datasource_test.go │ │ │ │ ├── resource.go │ │ │ │ ├── resource_test.go │ │ │ │ └── testdata │ │ │ │ │ └── mock-image.txt │ │ │ ├── keypair │ │ │ │ ├── const.go │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── network │ │ │ │ ├── datasource.go │ │ │ │ ├── datasource_test.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── networkarea │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── networkarearoute │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── networkinterface │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── networkinterfaceattach │ │ │ │ └── resource.go │ │ │ ├── publicip │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── publicipassociate │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── publicipranges │ │ │ │ └── datasource.go │ │ │ ├── securitygroup │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── securitygrouprule │ │ │ │ ├── datasource.go │ │ │ │ ├── planmodifier.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── server │ │ │ │ ├── const.go │ │ │ │ ├── datasource.go │ │ │ │ ├── datasource_test.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── serviceaccountattach │ │ │ │ └── resource.go │ │ │ ├── testdata │ │ │ │ ├── resource-affinity-group-min.tf │ │ │ │ ├── resource-image-max.tf │ │ │ │ ├── resource-image-min.tf │ │ │ │ ├── resource-key-pair-max.tf │ │ │ │ ├── resource-key-pair-min.tf │ │ │ │ ├── resource-network-area-max.tf │ │ │ │ ├── resource-network-area-min.tf │ │ │ │ ├── resource-network-interface-max.tf │ │ │ │ ├── resource-network-interface-min.tf │ │ │ │ ├── resource-network-max.tf │ │ │ │ ├── resource-network-min.tf │ │ │ │ ├── resource-security-group-max.tf │ │ │ │ ├── resource-security-group-min.tf │ │ │ │ ├── resource-server-max-server-attachments.tf │ │ │ │ ├── resource-server-max.tf │ │ │ │ ├── resource-server-min.tf │ │ │ │ ├── resource-volume-max.tf │ │ │ │ └── resource-volume-min.tf │ │ │ ├── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ │ ├── volume │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ └── volumeattach │ │ │ │ └── resource.go │ │ ├── loadbalancer │ │ │ ├── loadbalancer │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── loadbalancer_acc_test.go │ │ │ ├── observability-credential │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── testfiles │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── logme │ │ │ ├── credential │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── logme_acc_test.go │ │ │ ├── testdata │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── mariadb │ │ │ ├── credential │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── mariadb_acc_test.go │ │ │ ├── testfiles │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── modelserving │ │ │ ├── modelserving_acc_test.go │ │ │ ├── token │ │ │ │ ├── description.md │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── mongodbflex │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── mongodbflex_acc_test.go │ │ │ ├── user │ │ │ │ ├── datasource.go │ │ │ │ ├── datasource_test.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── objectstorage │ │ │ ├── bucket │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── credential │ │ │ │ ├── datasource.go │ │ │ │ ├── datasource_test.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── credentialsgroup │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── objectstorage_acc_test.go │ │ │ ├── testfiles │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── observability │ │ │ ├── alertgroup │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── credential │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── log-alertgroup │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── observability_acc_test.go │ │ │ ├── scrapeconfig │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── testdata │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── opensearch │ │ │ ├── credential │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── opensearch_acc_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── postgresflex │ │ │ ├── database │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ ├── resource_test.go │ │ │ │ └── use_state_for_unknown_if_flavor_unchanged_modifier.go │ │ │ ├── postgresflex_acc_test.go │ │ │ ├── user │ │ │ │ ├── datasource.go │ │ │ │ ├── datasource_test.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── rabbitmq │ │ │ ├── credential │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── rabbitmq_acc_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── redis │ │ │ ├── credential │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── redis_acc_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── resourcemanager │ │ │ ├── project │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── resourcemanager_acc_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── secretsmanager │ │ │ ├── instance │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── secretsmanager_acc_test.go │ │ │ ├── testdata │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ ├── user │ │ │ │ ├── datasource.go │ │ │ │ ├── datasource_test.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── serverbackup │ │ │ ├── schedule │ │ │ │ ├── resource.go │ │ │ │ ├── resource_test.go │ │ │ │ ├── schedule_datasource.go │ │ │ │ ├── schedules_datasource.go │ │ │ │ └── schedules_datasource_test.go │ │ │ ├── serverbackup_acc_test.go │ │ │ ├── testdata │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── serverupdate │ │ │ ├── schedule │ │ │ │ ├── resource.go │ │ │ │ ├── resource_test.go │ │ │ │ ├── schedule_datasource.go │ │ │ │ ├── schedules_datasource.go │ │ │ │ └── schedules_datasource_test.go │ │ │ ├── serverupdate_acc_test.go │ │ │ ├── testdata │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── serviceaccount │ │ │ ├── account │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── key │ │ │ │ ├── const.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── serviceaccount_acc_test.go │ │ │ ├── token │ │ │ │ ├── const.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── serviceenablement │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── ske │ │ │ ├── cluster │ │ │ │ ├── datasource.go │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── kubeconfig │ │ │ │ ├── resource.go │ │ │ │ └── resource_test.go │ │ │ ├── ske_acc_test.go │ │ │ ├── testdata │ │ │ │ ├── resource-max.tf │ │ │ │ └── resource-min.tf │ │ │ └── utils │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ └── sqlserverflex │ │ │ ├── instance │ │ │ ├── datasource.go │ │ │ ├── resource.go │ │ │ └── resource_test.go │ │ │ ├── sqlserverflex_acc_test.go │ │ │ ├── testdata │ │ │ ├── resource-max.tf │ │ │ └── resource-min.tf │ │ │ ├── user │ │ │ ├── datasource.go │ │ │ ├── datasource_test.go │ │ │ ├── resource.go │ │ │ └── resource_test.go │ │ │ └── utils │ │ │ ├── util.go │ │ │ └── util_test.go │ ├── testutil │ │ ├── sdk_credentials_invalid.json │ │ ├── sdk_credentials_valid.json │ │ ├── testutil.go │ │ └── testutil_test.go │ ├── utils │ │ ├── attributes.go │ │ ├── attributes_test.go │ │ ├── headers.go │ │ ├── headers_test.go │ │ ├── regions.go │ │ ├── regions_test.go │ │ ├── utils.go │ │ └── utils_test.go │ └── validate │ │ ├── testdata │ │ └── file.txt │ │ ├── validate.go │ │ └── validate_test.go └── provider.go ├── templates ├── guides │ ├── aws_provider_s3_stackit.md.tmpl │ ├── kubernetes_provider_ske.md.tmpl │ ├── opting_into_beta_resources.md.tmpl │ ├── ske_kube_state_metric_alerts.md.tmpl │ ├── ske_log_alerts.md.tmpl │ ├── stackit_cdn_with_custom_domain.md.tmpl │ ├── stackit_org_service_account.md.tmpl │ ├── using_loadbalancer_with_observability.md.tmpl │ └── vault_secrets_manager.md.tmpl └── index.md.tmpl └── terraform-registry-manifest.json /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @marceljk @bahkauv70 @Fyusel @rubenhoenle -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug in the STACKIT Terraform provider 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Description 11 | 12 | *Please add a clear and concise description of what the bug is.* 13 | 14 | ## Steps to reproduce 15 | 16 | 17 | ```terraform 18 | # put your terraform example here 19 | # ... 20 | ``` 21 | 22 | 23 | 24 | 1. Run `terraform ...` 25 | 2. ... 26 | 27 | ## Actual behavior 28 | 29 | *Please describe the current behavior of the STACKIT Terraform provider. Don't forget to add detailed information like error messages.* 30 | 31 | ## Expected behavior 32 | 33 | *Please describe the behavior which you would expect from the STACKIT Terraform provider in that case.* 34 | 35 | ## Environment 36 | - OS: 37 | - Terraform version (see `terraform --version`): `vX.X.X` 38 | - Version of the STACKIT Terraform provider: `vX.X.X` 39 | 40 | **Additional information** 41 | 42 | *Feel free to add any additional information here.* 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for the STACKIT Terraform provider 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Problem description 11 | 12 | *Is your feature request related to a problem? If so, please give us a clear and concise description of what the problem is. 13 | Example: I'm always frustrated when [...]* 14 | 15 | ## Proposed solution 16 | 17 | *A clear and concise description of what you want to happen.* 18 | 19 | 20 | 21 | ```terraform 22 | # put your terraform example here 23 | # ... 24 | ``` 25 | 26 | ## Alternative solutions (optional) 27 | 28 | *A clear and concise description of any alternative solutions or features you've considered. (optional)* 29 | 30 | ## Additional information 31 | 32 | *Feel free to add any additional information here.* 33 | 34 | -------------------------------------------------------------------------------- /.github/actions/build/action.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | description: "Build pipeline" 3 | inputs: 4 | go-version: 5 | description: "Go version to install" 6 | required: true 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Install Go ${{ inputs.go-version }} 11 | uses: actions/setup-go@v5 12 | with: 13 | go-version: ${{ inputs.go-version }} 14 | - name: Install project tools and dependencies 15 | shell: bash 16 | run: make project-tools -------------------------------------------------------------------------------- /.github/docs/contribution-guide/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/foo" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *foo.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.FooCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.FooCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := foo.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 7 | 8 | relates to #1234 9 | 10 | ## Checklist 11 | 12 | - [ ] Issue was linked above 13 | - [ ] Code format was applied: `make fmt` 14 | - [ ] Examples were added / adjusted (see `examples/` directory) 15 | - [x] Docs are up-to-date: `make generate-docs` (will be checked by CI) 16 | - [ ] Unit tests got implemented or updated 17 | - [ ] Acceptance tests got implemented or updated (see e.g. [here](https://github.com/stackitcloud/terraform-provider-stackit/blob/f5f99d170996b208672ae684b6da53420e369563/stackit/internal/services/dns/dns_acc_test.go)) 18 | - [x] Unit tests are passing: `make test` (will be checked by CI) 19 | - [x] No linter issues: `make lint` (will be checked by CI) 20 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:recommended"], 4 | "prHourlyLimit": 10, 5 | "labels": ["renovate"], 6 | "repositories": ["stackitcloud/terraform-provider-stackit"], 7 | "enabledManagers": ["gomod", "github-actions"], 8 | "packageRules": [ 9 | { 10 | "matchSourceUrls": ["https://github.com/stackitcloud/stackit-sdk-go"], 11 | "groupName": "STACKIT SDK modules" 12 | } 13 | ], 14 | "postUpdateOptions": ["gomodTidy", "gomodUpdateImportPaths"] 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: CI Workflow 2 | 3 | on: [pull_request, workflow_dispatch] 4 | 5 | env: 6 | GO_VERSION: "1.24" 7 | 8 | jobs: 9 | main: 10 | name: CI 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4 15 | 16 | - name: Build 17 | uses: ./.github/actions/build 18 | with: 19 | go-version: ${{ env.GO_VERSION }} 20 | 21 | - name: Setup Terraform 22 | uses: hashicorp/setup-terraform@v2 23 | with: 24 | terraform_wrapper: false 25 | 26 | - name: "Ensure docs are up-to-date" 27 | if: ${{ github.event_name == 'pull_request' }} 28 | run: ./scripts/check-docs.sh 29 | 30 | - name: Lint 31 | run: make lint 32 | 33 | - name: Test 34 | run: make test 35 | 36 | config: 37 | name: Check GoReleaser config 38 | runs-on: ubuntu-latest 39 | steps: 40 | - name: Checkout 41 | uses: actions/checkout@v4 42 | 43 | - name: Check GoReleaser 44 | uses: goreleaser/goreleaser-action@v6 45 | with: 46 | args: check 47 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | # Terraform Provider release workflow. 2 | name: Release 3 | 4 | # This GitHub action creates a release when a tag that matches the pattern 5 | # "v*" (e.g. v0.1.0) is created. 6 | on: 7 | push: 8 | tags: 9 | - "v*" 10 | workflow_dispatch: 11 | 12 | # Releases need permissions to read and write the repository contents. 13 | # GitHub considers creating releases and uploading assets as writing contents. 14 | permissions: 15 | contents: write 16 | 17 | jobs: 18 | goreleaser: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v4 22 | with: 23 | # Allow goreleaser to access older tag information. 24 | fetch-depth: 0 25 | - uses: actions/setup-go@v5 26 | with: 27 | go-version-file: "go.mod" 28 | cache: true 29 | - name: Import GPG key 30 | uses: crazy-max/ghaction-import-gpg@v6 31 | id: import_gpg 32 | with: 33 | gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} 34 | - name: Run GoReleaser 35 | uses: goreleaser/goreleaser-action@v6 36 | with: 37 | args: release --clean 38 | env: 39 | # GitHub sets the GITHUB_TOKEN secret automatically. 40 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 41 | GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} 42 | -------------------------------------------------------------------------------- /.github/workflows/renovate.yaml: -------------------------------------------------------------------------------- 1 | name: Renovate 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | workflow_dispatch: 7 | 8 | jobs: 9 | renovate: 10 | name: Renovate 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4 15 | - name: Self-hosted Renovate 16 | uses: renovatebot/github-action@v41.0.0 17 | with: 18 | configurationFile: .github/renovate.json 19 | token: ${{ secrets.RENOVATE_TOKEN }} 20 | -------------------------------------------------------------------------------- /.github/workflows/stale.yaml: -------------------------------------------------------------------------------- 1 | name: "Stale" 2 | on: 3 | schedule: 4 | # every night at 01:30 5 | - cron: "30 1 * * *" 6 | # run this workflow if the workflow definition gets changed within a PR 7 | pull_request: 8 | branches: ["main"] 9 | paths: [".github/workflows/stale.yaml"] 10 | 11 | env: 12 | DAYS_BEFORE_PR_STALE: 7 13 | DAYS_BEFORE_PR_CLOSE: 7 14 | 15 | permissions: 16 | issues: write 17 | pull-requests: write 18 | 19 | jobs: 20 | stale: 21 | name: "Stale" 22 | runs-on: ubuntu-latest 23 | timeout-minutes: 10 24 | steps: 25 | - name: "Mark old PRs as stale" 26 | uses: actions/stale@v9 27 | with: 28 | repo-token: ${{ secrets.GITHUB_TOKEN }} 29 | stale-pr-message: "This PR was marked as stale after ${{ env.DAYS_BEFORE_PR_STALE }} days of inactivity and will be closed after another ${{ env.DAYS_BEFORE_PR_CLOSE }} days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it." 30 | close-pr-message: "This PR was closed automatically because it has been stalled for ${{ env.DAYS_BEFORE_PR_CLOSE }} days with no activity. Feel free to re-open it at any time." 31 | days-before-pr-stale: ${{ env.DAYS_BEFORE_PR_STALE }} 32 | days-before-pr-close: ${{ env.DAYS_BEFORE_PR_CLOSE }} 33 | # never mark issues as stale or close them 34 | days-before-issue-stale: -1 35 | days-before-issue-close: -1 36 | -------------------------------------------------------------------------------- /.github/workflows/tf-acc-test.yaml: -------------------------------------------------------------------------------- 1 | name: TF Acceptance Tests Workflow 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | workflow_dispatch: 8 | 9 | jobs: 10 | main: 11 | name: Acceptance Tests 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v4 16 | - name: Install project tools and dependencies 17 | run: make project-tools 18 | - name: Run tests 19 | run: | 20 | make test-acceptance-tf TF_ACC_PROJECT_ID=$${{ secrets.TF_ACC_PROJECT_ID }} TF_ACC_ORGANIZATION_ID=$${{ secrets.TF_ACC_ORGANIZATION_ID }} TF_ACC_REGION="eu01" 21 | env: 22 | STACKIT_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TF_ACC_SERVICE_ACCOUNT_TOKEN }} 23 | TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL: ${{ secrets.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL }} 24 | TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN }} 25 | TF_ACC_TEST_PROJECT_PARENT_CONTAINER_ID: ${{ secrets.TF_ACC_TEST_PROJECT_PARENT_CONTAINER_ID }} 26 | TF_ACC_TEST_PROJECT_PARENT_UUID: ${{ secrets.TF_ACC_TEST_PROJECT_PARENT_UUID }} 27 | TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ secrets.TF_ACC_TEST_PROJECT_USER_EMAIL }} 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries 2 | bin/ 3 | *.exe 4 | *.exe~ 5 | *.dll 6 | *.so 7 | *.dylib 8 | 9 | ## IDE 10 | *.idea/ 11 | *.vscode/ 12 | 13 | # Terraform 14 | **/.terraform 15 | **/terraform.tfstate** 16 | .terraform.lock.hcl 17 | .terraform.tfstate.lock.info 18 | main.tf 19 | example.tf 20 | index.tf 21 | 22 | # Test binary, built with `go test -c` 23 | *.test 24 | 25 | # Output of the go coverage tool, specifically when used with LiteIDE 26 | *.out 27 | 28 | # Dependency directories 29 | vendor/ 30 | 31 | # Go workspace file 32 | go.work 33 | go.work.sum 34 | 35 | # Unit test files 36 | stackit/internal/services/iaas/test-512k.img 37 | 38 | # Test coverage reports 39 | coverage.out 40 | coverage.html 41 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | STACKIT Terraform Provider 2 | Copyright 2024 Schwarz IT KG -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Release 2 | 3 | ## Release cycle 4 | 5 | A release should be created at least every 2 weeks. 6 | 7 | ## Release creation 8 | 9 | > [!IMPORTANT] 10 | > Consider informing / syncing with the team before creating a new release. 11 | 12 | 1. Check out latest main branch on your machine 13 | 2. Create git tag: `git tag vX.X.X` 14 | 3. Push the git tag: `git push origin --tags` 15 | 4. The [release pipeline](https://github.com/stackitcloud/terraform-provider-stackit/actions/workflows/release.yaml) will build the release and publish it on GitHub 16 | 5. Ensure the release was created properly using the 17 | - [GitHub releases page](https://github.com/stackitcloud/terraform-provider-stackit/releases) 18 | - [Terraform registry](https://registry.terraform.io/providers/stackitcloud/stackit/latest) 19 | 20 | ## Troubleshooting 21 | 22 | In case the release only shows up as a draft release in the Terraform registry, check the state of the registry update in the [settings](https://github.com/stackitcloud/terraform-provider-stackit/settings/hooks): 23 | 24 | - Select 'edit' for the terraform registry webhook (requires authentication) 25 | - Switch to the "recent deliveries" tab 26 | - Check the last release, it should have positive result value and no error indication 27 | 28 | If the delivery failed or complains that the release is a draft, try to temporariliy declare the release as a pre-release in GitHub and then revert it it immediately. 29 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting Security Issues 2 | 3 | **Please do not report security vulnerabilities through public GitHub issues.** 4 | 5 | We at STACKIT take security seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. 6 | 7 | To report a security issue, please send an email to [stackit-security@stackit.de](mailto:stackit-security@stackit.de). 8 | 9 | Our team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. 10 | -------------------------------------------------------------------------------- /docs/data-sources/affinity_group.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_affinity_group Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Affinity Group schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_affinity_group (Data Source) 10 | 11 | Affinity Group schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_affinity_group" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | affinity_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `affinity_group_id` (String) The affinity group ID. 28 | - `project_id` (String) STACKIT Project ID to which the affinity group is associated. 29 | 30 | ### Read-Only 31 | 32 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`affinity_group_id`". 33 | - `members` (List of String) Affinity Group schema. Must have a `region` specified in the provider configuration. 34 | - `name` (String) The name of the affinity group. 35 | - `policy` (String) The policy of the affinity group. 36 | -------------------------------------------------------------------------------- /docs/data-sources/cdn_custom_domain.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_cdn_custom_domain Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | CDN distribution data source schema. 7 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. 8 | --- 9 | 10 | # stackit_cdn_custom_domain (Data Source) 11 | 12 | CDN distribution data source schema. 13 | 14 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. 15 | 16 | ## Example Usage 17 | 18 | ```terraform 19 | data "stackit_cdn_custom_domain" "example" { 20 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 21 | distribution_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 22 | name = "https://xxx.xxx" 23 | } 24 | ``` 25 | 26 | 27 | ## Schema 28 | 29 | ### Required 30 | 31 | - `distribution_id` (String) CDN distribution ID 32 | - `name` (String) 33 | - `project_id` (String) STACKIT project ID associated with the distribution 34 | 35 | ### Read-Only 36 | 37 | - `errors` (List of String) List of distribution errors 38 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`distribution_id`". 39 | - `status` (String) Status of the distribution 40 | -------------------------------------------------------------------------------- /docs/data-sources/dns_record_set.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_dns_record_set Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | DNS Record Set Resource schema. 7 | --- 8 | 9 | # stackit_dns_record_set (Data Source) 10 | 11 | DNS Record Set Resource schema. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_dns_record_set" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | zone_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | record_set_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `project_id` (String) STACKIT project ID to which the dns record set is associated. 29 | - `record_set_id` (String) The rr set id. 30 | - `zone_id` (String) The zone ID to which is dns record set is associated. 31 | 32 | ### Read-Only 33 | 34 | - `active` (Boolean) Specifies if the record set is active or not. 35 | - `comment` (String) Comment. 36 | - `error` (String) Error shows error in case create/update/delete failed. 37 | - `fqdn` (String) Fully qualified domain name (FQDN) of the record set. 38 | - `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`zone_id`,`record_set_id`". 39 | - `name` (String) Name of the record which should be a valid domain according to rfc1035 Section 2.3.4. E.g. `example.com` 40 | - `records` (List of String) Records. 41 | - `state` (String) Record set state. 42 | - `ttl` (Number) Time to live. E.g. 3600 43 | - `type` (String) The record set type. E.g. `A` or `CNAME` 44 | -------------------------------------------------------------------------------- /docs/data-sources/git.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_git Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Git Instance datasource schema. 7 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. 8 | --- 9 | 10 | # stackit_git (Data Source) 11 | 12 | Git Instance datasource schema. 13 | 14 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. 15 | 16 | ## Example Usage 17 | 18 | ```terraform 19 | data "stackit_git" "git" { 20 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 21 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 22 | } 23 | ``` 24 | 25 | 26 | ## Schema 27 | 28 | ### Required 29 | 30 | - `instance_id` (String) ID linked to the git instance. 31 | - `project_id` (String) STACKIT project ID to which the git instance is associated. 32 | 33 | ### Read-Only 34 | 35 | - `id` (String) Terraform's internal resource ID, structured as "`project_id`,`instance_id`". 36 | - `name` (String) Unique name linked to the git instance. 37 | - `url` (String) Url linked to the git instance. 38 | - `version` (String) Version linked to the git instance. 39 | -------------------------------------------------------------------------------- /docs/data-sources/key_pair.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_key_pair Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Key pair resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_key_pair (Data Source) 10 | 11 | Key pair resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_key_pair" "example" { 17 | name = "example-key-pair-name" 18 | } 19 | ``` 20 | 21 | 22 | ## Schema 23 | 24 | ### Required 25 | 26 | - `name` (String) The name of the SSH key pair. 27 | 28 | ### Read-Only 29 | 30 | - `fingerprint` (String) The fingerprint of the public SSH key. 31 | - `id` (String) Terraform's internal resource ID. It takes the value of the key pair "`name`". 32 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. 33 | - `public_key` (String) A string representation of the public SSH key. E.g., `ssh-rsa ` or `ssh-ed25519 `. 34 | -------------------------------------------------------------------------------- /docs/data-sources/logme_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_logme_credential Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | LogMe credential data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_logme_credential (Data Source) 10 | 11 | LogMe credential data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_logme_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `credential_id` (String) The credential's ID. 29 | - `instance_id` (String) ID of the LogMe instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | 32 | ### Read-Only 33 | 34 | - `host` (String) 35 | - `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 36 | - `password` (String, Sensitive) 37 | - `port` (Number) 38 | - `uri` (String, Sensitive) 39 | - `username` (String) 40 | -------------------------------------------------------------------------------- /docs/data-sources/mariadb_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_mariadb_credential Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | MariaDB credential data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_mariadb_credential (Data Source) 10 | 11 | MariaDB credential data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_mariadb_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `credential_id` (String) The credential's ID. 29 | - `instance_id` (String) ID of the MariaDB instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | 32 | ### Read-Only 33 | 34 | - `host` (String) 35 | - `hosts` (List of String) 36 | - `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 37 | - `name` (String) 38 | - `password` (String, Sensitive) 39 | - `port` (Number) 40 | - `uri` (String, Sensitive) 41 | - `username` (String) 42 | -------------------------------------------------------------------------------- /docs/data-sources/mongodbflex_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_mongodbflex_user Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | MongoDB Flex user data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_mongodbflex_user (Data Source) 10 | 11 | MongoDB Flex user data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_mongodbflex_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `instance_id` (String) ID of the MongoDB Flex instance. 29 | - `project_id` (String) STACKIT project ID to which the instance is associated. 30 | - `user_id` (String) User ID. 31 | 32 | ### Read-Only 33 | 34 | - `database` (String) 35 | - `host` (String) 36 | - `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`instance_id`,`user_id`". 37 | - `port` (Number) 38 | - `roles` (Set of String) 39 | - `username` (String) 40 | -------------------------------------------------------------------------------- /docs/data-sources/network_area_route.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_network_area_route Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Network area route data resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_network_area_route (Data Source) 10 | 11 | Network area route data resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_network_area_route" "example" { 17 | organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | network_area_route_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `network_area_id` (String) The network area ID to which the network area route is associated. 29 | - `network_area_route_id` (String) The network area route ID. 30 | - `organization_id` (String) STACKIT organization ID to which the network area is associated. 31 | 32 | ### Read-Only 33 | 34 | - `id` (String) Terraform's internal data source ID. It is structured as "`organization_id`,`network_area_id`,`network_area_route_id`". 35 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container 36 | - `next_hop` (String) The IP address of the routing system, that will route the prefix configured. Should be a valid IPv4 address. 37 | - `prefix` (String) The network, that is reachable though the Next Hop. Should use CIDR notation. 38 | -------------------------------------------------------------------------------- /docs/data-sources/objectstorage_bucket.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_objectstorage_bucket Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | ObjectStorage bucket data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_objectstorage_bucket (Data Source) 10 | 11 | ObjectStorage bucket data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_objectstorage_bucket" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | name = "example-name" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `name` (String) The bucket name. It must be DNS conform. 28 | - `project_id` (String) STACKIT Project ID to which the bucket is associated. 29 | 30 | ### Optional 31 | 32 | - `region` (String) The resource region. If not defined, the provider region is used. 33 | 34 | ### Read-Only 35 | 36 | - `id` (String) Terraform's internal data source identifier. It is structured as "`project_id`,`region`,`name`". 37 | - `url_path_style` (String) 38 | - `url_virtual_hosted_style` (String) 39 | -------------------------------------------------------------------------------- /docs/data-sources/objectstorage_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_objectstorage_credential Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | ObjectStorage credential data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_objectstorage_credential (Data Source) 10 | 11 | ObjectStorage credential data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_objectstorage_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | credentials_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `credential_id` (String) The credential ID. 29 | - `credentials_group_id` (String) The credential group ID. 30 | - `project_id` (String) STACKIT Project ID to which the credential group is associated. 31 | 32 | ### Optional 33 | 34 | - `region` (String) The resource region. If not defined, the provider region is used. 35 | 36 | ### Read-Only 37 | 38 | - `expiration_timestamp` (String) 39 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`credentials_group_id`,`credential_id`". 40 | - `name` (String) 41 | -------------------------------------------------------------------------------- /docs/data-sources/objectstorage_credentials_group.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_objectstorage_credentials_group Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | ObjectStorage credentials group data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_objectstorage_credentials_group (Data Source) 10 | 11 | ObjectStorage credentials group data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_objectstorage_credentials_group" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | credentials_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `credentials_group_id` (String) The credentials group ID. 28 | - `project_id` (String) Object Storage Project ID to which the credentials group is associated. 29 | 30 | ### Optional 31 | 32 | - `region` (String) The resource region. If not defined, the provider region is used. 33 | 34 | ### Read-Only 35 | 36 | - `id` (String) Terraform's internal data source identifier. It is structured as "`project_id`,`region`,`credentials_group_id`". 37 | - `name` (String) The credentials group's display name. 38 | - `urn` (String) Credentials group uniform resource name (URN) 39 | -------------------------------------------------------------------------------- /docs/data-sources/opensearch_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_opensearch_credential Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | OpenSearch credential data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_opensearch_credential (Data Source) 10 | 11 | OpenSearch credential data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_opensearch_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `credential_id` (String) The credential's ID. 29 | - `instance_id` (String) ID of the OpenSearch instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | 32 | ### Read-Only 33 | 34 | - `host` (String) 35 | - `hosts` (List of String) 36 | - `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 37 | - `password` (String, Sensitive) 38 | - `port` (Number) 39 | - `scheme` (String) 40 | - `uri` (String, Sensitive) 41 | - `username` (String) 42 | -------------------------------------------------------------------------------- /docs/data-sources/postgresflex_database.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_postgresflex_database Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Postgres Flex database resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_postgresflex_database (Data Source) 10 | 11 | Postgres Flex database resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_postgresflex_database" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `database_id` (String) Database ID. 29 | - `instance_id` (String) ID of the Postgres Flex instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | 32 | ### Optional 33 | 34 | - `region` (String) The resource region. If not defined, the provider region is used. 35 | 36 | ### Read-Only 37 | 38 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`database_id`". 39 | - `name` (String) Database name. 40 | - `owner` (String) Username of the database owner. 41 | -------------------------------------------------------------------------------- /docs/data-sources/postgresflex_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_postgresflex_user Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Postgres Flex user data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_postgresflex_user (Data Source) 10 | 11 | Postgres Flex user data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_postgresflex_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `instance_id` (String) ID of the PostgresFlex instance. 29 | - `project_id` (String) STACKIT project ID to which the instance is associated. 30 | - `user_id` (String) User ID. 31 | 32 | ### Optional 33 | 34 | - `region` (String) The resource region. If not defined, the provider region is used. 35 | 36 | ### Read-Only 37 | 38 | - `host` (String) 39 | - `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`region`,`instance_id`,`user_id`". 40 | - `port` (Number) 41 | - `roles` (Set of String) 42 | - `username` (String) 43 | -------------------------------------------------------------------------------- /docs/data-sources/public_ip.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_public_ip Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Public IP resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_public_ip (Data Source) 10 | 11 | Public IP resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_public_ip" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | public_ip_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `project_id` (String) STACKIT project ID to which the public IP is associated. 28 | - `public_ip_id` (String) The public IP ID. 29 | 30 | ### Read-Only 31 | 32 | - `id` (String) Terraform's internal datasource ID. It is structured as "`project_id`,`public_ip_id`". 33 | - `ip` (String) The IP address. 34 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container 35 | - `network_interface_id` (String) Associates the public IP with a network interface or a virtual IP (ID). 36 | -------------------------------------------------------------------------------- /docs/data-sources/public_ip_ranges.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_public_ip_ranges Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | A list of all public IP ranges that STACKIT uses. 7 | --- 8 | 9 | # stackit_public_ip_ranges (Data Source) 10 | 11 | A list of all public IP ranges that STACKIT uses. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_public_ip_ranges" "example" {} 17 | ``` 18 | 19 | 20 | ## Schema 21 | 22 | ### Read-Only 23 | 24 | - `id` (String) Terraform's internal resource ID. It takes the values of "`public_ip_ranges.*.cidr`". 25 | - `public_ip_ranges` (Attributes List) A list of all public IP ranges. (see [below for nested schema](#nestedatt--public_ip_ranges)) 26 | 27 | 28 | ### Nested Schema for `public_ip_ranges` 29 | 30 | Read-Only: 31 | 32 | - `cidr` (String) Classless Inter-Domain Routing (CIDR) 33 | -------------------------------------------------------------------------------- /docs/data-sources/rabbitmq_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_rabbitmq_credential Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | RabbitMQ credential data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_rabbitmq_credential (Data Source) 10 | 11 | RabbitMQ credential data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_rabbitmq_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `credential_id` (String) The credential's ID. 29 | - `instance_id` (String) ID of the RabbitMQ instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | 32 | ### Read-Only 33 | 34 | - `host` (String) 35 | - `hosts` (List of String) 36 | - `http_api_uri` (String) 37 | - `http_api_uris` (List of String) 38 | - `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 39 | - `management` (String) 40 | - `password` (String, Sensitive) 41 | - `port` (Number) 42 | - `uri` (String, Sensitive) 43 | - `uris` (List of String) 44 | - `username` (String) 45 | -------------------------------------------------------------------------------- /docs/data-sources/redis_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_redis_credential Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Redis credential data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_redis_credential (Data Source) 10 | 11 | Redis credential data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_redis_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `credential_id` (String) The credential's ID. 29 | - `instance_id` (String) ID of the Redis instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | 32 | ### Read-Only 33 | 34 | - `host` (String) 35 | - `hosts` (List of String) 36 | - `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 37 | - `load_balanced_host` (String) 38 | - `password` (String, Sensitive) 39 | - `port` (Number) 40 | - `uri` (String, Sensitive) Connection URI. 41 | - `username` (String) 42 | -------------------------------------------------------------------------------- /docs/data-sources/resourcemanager_project.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_resourcemanager_project Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Resource Manager project data source schema. To identify the project, you need to provider either project_id or container_id. If you provide both, project_id will be used. 7 | --- 8 | 9 | # stackit_resourcemanager_project (Data Source) 10 | 11 | Resource Manager project data source schema. To identify the project, you need to provider either project_id or container_id. If you provide both, project_id will be used. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_resourcemanager_project" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | container_id = "example-container-abc123" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Optional 26 | 27 | - `container_id` (String) Project container ID. Globally unique, user-friendly identifier. 28 | - `project_id` (String) Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project. 29 | 30 | ### Read-Only 31 | 32 | - `id` (String) Terraform's internal data source. ID. It is structured as "`container_id`". 33 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64} 34 | - `name` (String) Project name. 35 | - `parent_container_id` (String) Parent resource identifier. Both container ID (user-friendly) and UUID are supported 36 | -------------------------------------------------------------------------------- /docs/data-sources/secretsmanager_instance.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_secretsmanager_instance Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Secrets Manager instance data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_secretsmanager_instance (Data Source) 10 | 11 | Secrets Manager instance data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_secretsmanager_instance" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `instance_id` (String) ID of the Secrets Manager instance. 28 | - `project_id` (String) STACKIT project ID to which the instance is associated. 29 | 30 | ### Read-Only 31 | 32 | - `acls` (Set of String) The access control list for this instance. Each entry is an IP or IP range that is permitted to access, in CIDR notation 33 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". 34 | - `name` (String) Instance name. 35 | -------------------------------------------------------------------------------- /docs/data-sources/secretsmanager_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_secretsmanager_user Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Secrets Manager user data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_secretsmanager_user (Data Source) 10 | 11 | Secrets Manager user data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_secretsmanager_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `instance_id` (String) ID of the Secrets Manager instance. 29 | - `project_id` (String) STACKIT Project ID to which the instance is associated. 30 | - `user_id` (String) The user's ID. 31 | 32 | ### Read-Only 33 | 34 | - `description` (String) A user chosen description to differentiate between multiple users. Can't be changed after creation. 35 | - `id` (String) Terraform's internal data source identifier. It is structured as "`project_id`,`instance_id`,`user_id`". 36 | - `username` (String) An auto-generated user name. 37 | - `write_enabled` (Boolean) If true, the user has writeaccess to the secrets engine. 38 | -------------------------------------------------------------------------------- /docs/data-sources/security_group.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_security_group Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Security group datasource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_security_group (Data Source) 10 | 11 | Security group datasource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_security_group" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | security_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `project_id` (String) STACKIT project ID to which the security group is associated. 28 | - `security_group_id` (String) The security group ID. 29 | 30 | ### Read-Only 31 | 32 | - `description` (String) The description of the security group. 33 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`security_group_id`". 34 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container 35 | - `name` (String) The name of the security group. 36 | - `stateful` (Boolean) Configures if a security group is stateful or stateless. There can only be one type of security groups per network interface/server. 37 | -------------------------------------------------------------------------------- /docs/data-sources/service_account.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_service_account Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | Service account data source schema. 7 | --- 8 | 9 | # stackit_service_account (Data Source) 10 | 11 | Service account data source schema. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_service_account" "sa" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | email = "sa01-8565oq1@sa.stackit.cloud" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `email` (String) Email of the service account. 28 | - `project_id` (String) STACKIT project ID to which the service account is associated. 29 | 30 | ### Read-Only 31 | 32 | - `id` (String) Terraform's internal resource ID, structured as "`project_id`,`email`". 33 | - `name` (String) Name of the service account. 34 | -------------------------------------------------------------------------------- /docs/data-sources/sqlserverflex_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_sqlserverflex_user Data Source - stackit" 4 | subcategory: "" 5 | description: |- 6 | SQLServer Flex user data source schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_sqlserverflex_user (Data Source) 10 | 11 | SQLServer Flex user data source schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | data "stackit_sqlserverflex_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `instance_id` (String) ID of the SQLServer Flex instance. 29 | - `project_id` (String) STACKIT project ID to which the instance is associated. 30 | - `user_id` (String) User ID. 31 | 32 | ### Optional 33 | 34 | - `region` (String) The resource region. If not defined, the provider region is used. 35 | 36 | ### Read-Only 37 | 38 | - `host` (String) 39 | - `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`region`,`instance_id`,`user_id`". 40 | - `port` (Number) 41 | - `roles` (Set of String) Database access levels for the user. 42 | - `username` (String) Username of the SQLServer Flex instance. 43 | -------------------------------------------------------------------------------- /docs/guides/stackit_org_service_account.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Creating projects in empty organization via Terraform" 3 | --- 4 | # Creating projects in empty organization via Terraform 5 | 6 | Consider the following situation: You're starting with an empty STACKIT organization and want to create projects 7 | in this organization using the `stackit_resourcemanager_project` resource. Unfortunately it's not possible to create 8 | a service account on organization level which can be used for authentication in the STACKIT Terraform provider. 9 | The following steps will help you to get started: 10 | 11 | 1. Using the STACKIT portal, create a dummy project in your organization which will hold your service account, let's name it e.g. "dummy-service-account-project". 12 | 2. In this "dummy-service-account-project", create a service account. Create and save a service account key to use for authentication for the STACKIT Terraform provider later as described in the docs. Now copy the e-mail address of the service account you just created. 13 | 3. Here comes the important part: Navigate to your organization, open it and select "Access". Click on the "Grant access" button and paste the e-mail address of your service account. Be careful to grant the service account enough permissions to create projects in your organization, e.g. by assigning the "owner" role to it. 14 | 15 | *This problem was brought up initially in [this](https://github.com/stackitcloud/terraform-provider-stackit/issues/855) issue on GitHub.* 16 | -------------------------------------------------------------------------------- /docs/resources/authorization_organization_role_assignment.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_authorization_organization_role_assignment Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | organization Role Assignment resource schema. 7 | ~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion. 8 | --- 9 | 10 | # stackit_authorization_organization_role_assignment (Resource) 11 | 12 | organization Role Assignment resource schema. 13 | 14 | ~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion. 15 | 16 | ## Example Usage 17 | 18 | ```terraform 19 | resource "stackit_authorization_organization_role_assignment" "example" { 20 | resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 21 | role = "owner" 22 | subject = "john.doe@stackit.cloud" 23 | } 24 | ``` 25 | 26 | 27 | ## Schema 28 | 29 | ### Required 30 | 31 | - `resource_id` (String) organization Resource to assign the role to. 32 | - `role` (String) Role to be assigned 33 | - `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients 34 | 35 | ### Read-Only 36 | 37 | - `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role],[subject]". 38 | -------------------------------------------------------------------------------- /docs/resources/authorization_project_role_assignment.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_authorization_project_role_assignment Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | project Role Assignment resource schema. 7 | ~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion. 8 | --- 9 | 10 | # stackit_authorization_project_role_assignment (Resource) 11 | 12 | project Role Assignment resource schema. 13 | 14 | ~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion. 15 | 16 | ## Example Usage 17 | 18 | ```terraform 19 | resource "stackit_authorization_project_role_assignment" "example" { 20 | resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 21 | role = "owner" 22 | subject = "john.doe@stackit.cloud" 23 | } 24 | ``` 25 | 26 | 27 | ## Schema 28 | 29 | ### Required 30 | 31 | - `resource_id` (String) project Resource to assign the role to. 32 | - `role` (String) Role to be assigned 33 | - `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients 34 | 35 | ### Read-Only 36 | 37 | - `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role],[subject]". 38 | -------------------------------------------------------------------------------- /docs/resources/cdn_custom_domain.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_cdn_custom_domain Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | CDN distribution data source schema. 7 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. 8 | --- 9 | 10 | # stackit_cdn_custom_domain (Resource) 11 | 12 | CDN distribution data source schema. 13 | 14 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. 15 | 16 | ## Example Usage 17 | 18 | ```terraform 19 | resource "stackit_cdn_custom_domain" "example" { 20 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 21 | distribution_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 22 | name = "https://xxx.xxx" 23 | } 24 | ``` 25 | 26 | 27 | ## Schema 28 | 29 | ### Required 30 | 31 | - `distribution_id` (String) CDN distribution ID 32 | - `name` (String) 33 | - `project_id` (String) STACKIT project ID associated with the distribution 34 | 35 | ### Read-Only 36 | 37 | - `errors` (List of String) List of distribution errors 38 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`distribution_id`". 39 | - `status` (String) Status of the distribution 40 | -------------------------------------------------------------------------------- /docs/resources/git.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_git Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Git Instance resource schema. 7 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. 8 | --- 9 | 10 | # stackit_git (Resource) 11 | 12 | Git Instance resource schema. 13 | 14 | ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. 15 | 16 | ## Example Usage 17 | 18 | ```terraform 19 | resource "stackit_git" "git" { 20 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 21 | name = "git-example-instance" 22 | } 23 | ``` 24 | 25 | 26 | ## Schema 27 | 28 | ### Required 29 | 30 | - `name` (String) Unique name linked to the git instance. 31 | - `project_id` (String) STACKIT project ID to which the git instance is associated. 32 | 33 | ### Read-Only 34 | 35 | - `id` (String) Terraform's internal resource ID, structured as "`project_id`,`instance_id`". 36 | - `instance_id` (String) ID linked to the git instance. 37 | - `url` (String) Url linked to the git instance. 38 | - `version` (String) Version linked to the git instance. 39 | -------------------------------------------------------------------------------- /docs/resources/logme_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_logme_credential Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | LogMe credential resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_logme_credential (Resource) 10 | 11 | LogMe credential resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_logme_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `instance_id` (String) ID of the LogMe instance. 28 | - `project_id` (String) STACKIT Project ID to which the instance is associated. 29 | 30 | ### Read-Only 31 | 32 | - `credential_id` (String) The credential's ID. 33 | - `host` (String) 34 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 35 | - `password` (String, Sensitive) 36 | - `port` (Number) 37 | - `uri` (String, Sensitive) 38 | - `username` (String) 39 | -------------------------------------------------------------------------------- /docs/resources/mariadb_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_mariadb_credential Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | MariaDB credential resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_mariadb_credential (Resource) 10 | 11 | MariaDB credential resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_mariadb_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `instance_id` (String) ID of the MariaDB instance. 28 | - `project_id` (String) STACKIT Project ID to which the instance is associated. 29 | 30 | ### Read-Only 31 | 32 | - `credential_id` (String) The credential's ID. 33 | - `host` (String) 34 | - `hosts` (List of String) 35 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 36 | - `name` (String) 37 | - `password` (String, Sensitive) 38 | - `port` (Number) 39 | - `uri` (String, Sensitive) 40 | - `username` (String) 41 | -------------------------------------------------------------------------------- /docs/resources/mongodbflex_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_mongodbflex_user Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | MongoDB Flex user resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_mongodbflex_user (Resource) 10 | 11 | MongoDB Flex user resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_mongodbflex_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | username = "username" 20 | roles = ["role"] 21 | database = "database" 22 | } 23 | ``` 24 | 25 | 26 | ## Schema 27 | 28 | ### Required 29 | 30 | - `database` (String) 31 | - `instance_id` (String) ID of the MongoDB Flex instance. 32 | - `project_id` (String) STACKIT project ID to which the instance is associated. 33 | - `roles` (Set of String) Database access levels for the user. Some of the possible values are: [`read`, `readWrite`, `readWriteAnyDatabase`] 34 | 35 | ### Optional 36 | 37 | - `username` (String) 38 | 39 | ### Read-Only 40 | 41 | - `host` (String) 42 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`,`user_id`". 43 | - `password` (String, Sensitive) 44 | - `port` (Number) 45 | - `uri` (String, Sensitive) 46 | - `user_id` (String) User ID. 47 | -------------------------------------------------------------------------------- /docs/resources/network_area_route.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_network_area_route Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Network area route resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_network_area_route (Resource) 10 | 11 | Network area route resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_network_area_route" "example" { 17 | organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | prefix = "192.168.0.0/24" 20 | next_hop = "192.168.0.0" 21 | labels = { 22 | "key" = "value" 23 | } 24 | } 25 | ``` 26 | 27 | 28 | ## Schema 29 | 30 | ### Required 31 | 32 | - `network_area_id` (String) The network area ID to which the network area route is associated. 33 | - `next_hop` (String) The IP address of the routing system, that will route the prefix configured. Should be a valid IPv4 address. 34 | - `organization_id` (String) STACKIT organization ID to which the network area is associated. 35 | - `prefix` (String) The network, that is reachable though the Next Hop. Should use CIDR notation. 36 | 37 | ### Optional 38 | 39 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container 40 | 41 | ### Read-Only 42 | 43 | - `id` (String) Terraform's internal resource ID. It is structured as "`organization_id`,`network_area_id`,`network_area_route_id`". 44 | - `network_area_route_id` (String) The network area route ID. 45 | -------------------------------------------------------------------------------- /docs/resources/objectstorage_bucket.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_objectstorage_bucket Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | ObjectStorage bucket resource schema. Must have a region specified in the provider configuration. If you are creating credentialsgroup and bucket resources simultaneously, please include the depends_on field so that they are created sequentially. This prevents errors from concurrent calls to the service enablement that is done in the background. 7 | --- 8 | 9 | # stackit_objectstorage_bucket (Resource) 10 | 11 | ObjectStorage bucket resource schema. Must have a `region` specified in the provider configuration. If you are creating `credentialsgroup` and `bucket` resources simultaneously, please include the `depends_on` field so that they are created sequentially. This prevents errors from concurrent calls to the service enablement that is done in the background. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_objectstorage_bucket" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | name = "example-bucket" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `name` (String) The bucket name. It must be DNS conform. 28 | - `project_id` (String) STACKIT Project ID to which the bucket is associated. 29 | 30 | ### Optional 31 | 32 | - `region` (String) The resource region. If not defined, the provider region is used. 33 | 34 | ### Read-Only 35 | 36 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`name`". 37 | - `url_path_style` (String) 38 | - `url_virtual_hosted_style` (String) 39 | -------------------------------------------------------------------------------- /docs/resources/objectstorage_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_objectstorage_credential Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | ObjectStorage credential resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_objectstorage_credential (Resource) 10 | 11 | ObjectStorage credential resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_objectstorage_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | credentials_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | expiration_timestamp = "2027-01-02T03:04:05Z" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `credentials_group_id` (String) The credential group ID. 29 | - `project_id` (String) STACKIT Project ID to which the credential group is associated. 30 | 31 | ### Optional 32 | 33 | - `expiration_timestamp` (String) Expiration timestamp, in RFC339 format without fractional seconds. Example: "2025-01-01T00:00:00Z". If not set, the credential never expires. 34 | - `region` (String) The resource region. If not defined, the provider region is used. 35 | 36 | ### Read-Only 37 | 38 | - `access_key` (String) 39 | - `credential_id` (String) The credential ID. 40 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`credentials_group_id`,`credential_id`". 41 | - `name` (String) 42 | - `secret_access_key` (String, Sensitive) 43 | -------------------------------------------------------------------------------- /docs/resources/observability_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_observability_credential Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Observability credential resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_observability_credential (Resource) 10 | 11 | Observability credential resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_observability_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `instance_id` (String) The Observability Instance ID the credential belongs to. 28 | - `project_id` (String) STACKIT project ID to which the credential is associated. 29 | 30 | ### Read-Only 31 | 32 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`,`username`". 33 | - `password` (String, Sensitive) Credential password 34 | - `username` (String) Credential username 35 | -------------------------------------------------------------------------------- /docs/resources/opensearch_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_opensearch_credential Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | OpenSearch credential resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_opensearch_credential (Resource) 10 | 11 | OpenSearch credential resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_opensearch_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `instance_id` (String) ID of the OpenSearch instance. 28 | - `project_id` (String) STACKIT Project ID to which the instance is associated. 29 | 30 | ### Read-Only 31 | 32 | - `credential_id` (String) The credential's ID. 33 | - `host` (String) 34 | - `hosts` (List of String) 35 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 36 | - `password` (String, Sensitive) 37 | - `port` (Number) 38 | - `scheme` (String) 39 | - `uri` (String, Sensitive) 40 | - `username` (String) 41 | -------------------------------------------------------------------------------- /docs/resources/postgresflex_database.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_postgresflex_database Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Postgres Flex database resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_postgresflex_database (Resource) 10 | 11 | Postgres Flex database resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_postgresflex_database" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | name = "mydb" 20 | owner = "myusername" 21 | } 22 | ``` 23 | 24 | 25 | ## Schema 26 | 27 | ### Required 28 | 29 | - `instance_id` (String) ID of the Postgres Flex instance. 30 | - `name` (String) Database name. 31 | - `owner` (String) Username of the database owner. 32 | - `project_id` (String) STACKIT project ID to which the instance is associated. 33 | 34 | ### Optional 35 | 36 | - `region` (String) The resource region. If not defined, the provider region is used. 37 | 38 | ### Read-Only 39 | 40 | - `database_id` (String) Database ID. 41 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`database_id`". 42 | -------------------------------------------------------------------------------- /docs/resources/postgresflex_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_postgresflex_user Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Postgres Flex user resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_postgresflex_user (Resource) 10 | 11 | Postgres Flex user resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_postgresflex_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | username = "username" 20 | roles = ["role"] 21 | } 22 | ``` 23 | 24 | 25 | ## Schema 26 | 27 | ### Required 28 | 29 | - `instance_id` (String) ID of the PostgresFlex instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | - `roles` (Set of String) Database access levels for the user. Supported values are: `login`, `createdb`. 32 | - `username` (String) 33 | 34 | ### Optional 35 | 36 | - `region` (String) The resource region. If not defined, the provider region is used. 37 | 38 | ### Read-Only 39 | 40 | - `host` (String) 41 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`user_id`". 42 | - `password` (String, Sensitive) 43 | - `port` (Number) 44 | - `uri` (String, Sensitive) 45 | - `user_id` (String) User ID. 46 | -------------------------------------------------------------------------------- /docs/resources/public_ip.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_public_ip Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Public IP resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_public_ip (Resource) 10 | 11 | Public IP resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_public_ip" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | labels = { 20 | "key" = "value" 21 | } 22 | } 23 | ``` 24 | 25 | 26 | ## Schema 27 | 28 | ### Required 29 | 30 | - `project_id` (String) STACKIT project ID to which the public IP is associated. 31 | 32 | ### Optional 33 | 34 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container 35 | - `network_interface_id` (String) Associates the public IP with a network interface or a virtual IP (ID). If you are using this resource with a Kubernetes Load Balancer or any other resource which associates a network interface implicitly, use the lifecycle `ignore_changes` property in this field to prevent unintentional removal of the network interface due to drift in the Terraform state 36 | 37 | ### Read-Only 38 | 39 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`public_ip_id`". 40 | - `ip` (String) The IP address. 41 | - `public_ip_id` (String) The public IP ID. 42 | -------------------------------------------------------------------------------- /docs/resources/rabbitmq_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_rabbitmq_credential Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | RabbitMQ credential resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_rabbitmq_credential (Resource) 10 | 11 | RabbitMQ credential resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_rabbitmq_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `instance_id` (String) ID of the RabbitMQ instance. 28 | - `project_id` (String) STACKIT Project ID to which the instance is associated. 29 | 30 | ### Read-Only 31 | 32 | - `credential_id` (String) The credential's ID. 33 | - `host` (String) 34 | - `hosts` (List of String) 35 | - `http_api_uri` (String) 36 | - `http_api_uris` (List of String) 37 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 38 | - `management` (String) 39 | - `password` (String, Sensitive) 40 | - `port` (Number) 41 | - `uri` (String, Sensitive) 42 | - `uris` (List of String) 43 | - `username` (String) 44 | -------------------------------------------------------------------------------- /docs/resources/redis_credential.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_redis_credential Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Redis credential resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_redis_credential (Resource) 10 | 11 | Redis credential resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_redis_credential" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `instance_id` (String) ID of the Redis instance. 28 | - `project_id` (String) STACKIT Project ID to which the instance is associated. 29 | 30 | ### Read-Only 31 | 32 | - `credential_id` (String) The credential's ID. 33 | - `host` (String) 34 | - `hosts` (List of String) 35 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`". 36 | - `load_balanced_host` (String) 37 | - `password` (String, Sensitive) 38 | - `port` (Number) 39 | - `uri` (String, Sensitive) Connection URI. 40 | - `username` (String) 41 | -------------------------------------------------------------------------------- /docs/resources/secretsmanager_instance.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_secretsmanager_instance Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Secrets Manager instance resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_secretsmanager_instance (Resource) 10 | 11 | Secrets Manager instance resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_secretsmanager_instance" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | name = "example-instance" 19 | acls = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"] 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `name` (String) Instance name. 29 | - `project_id` (String) STACKIT project ID to which the instance is associated. 30 | 31 | ### Optional 32 | 33 | - `acls` (Set of String) The access control list for this instance. Each entry is an IP or IP range that is permitted to access, in CIDR notation 34 | 35 | ### Read-Only 36 | 37 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". 38 | - `instance_id` (String) ID of the Secrets Manager instance. 39 | -------------------------------------------------------------------------------- /docs/resources/secretsmanager_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_secretsmanager_user Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Secrets Manager user resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_secretsmanager_user (Resource) 10 | 11 | Secrets Manager user resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_secretsmanager_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | description = "Example user" 20 | write_enabled = false 21 | } 22 | ``` 23 | 24 | 25 | ## Schema 26 | 27 | ### Required 28 | 29 | - `description` (String) A user chosen description to differentiate between multiple users. Can't be changed after creation. 30 | - `instance_id` (String) ID of the Secrets Manager instance. 31 | - `project_id` (String) STACKIT Project ID to which the instance is associated. 32 | - `write_enabled` (Boolean) If true, the user has writeaccess to the secrets engine. 33 | 34 | ### Read-Only 35 | 36 | - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`user_id`". 37 | - `password` (String, Sensitive) An auto-generated password. 38 | - `user_id` (String) The user's ID. 39 | - `username` (String) An auto-generated user name. 40 | -------------------------------------------------------------------------------- /docs/resources/security_group.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_security_group Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Security group resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_security_group (Resource) 10 | 11 | Security group resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_security_group" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | name = "my_security_group" 19 | labels = { 20 | "key" = "value" 21 | } 22 | } 23 | ``` 24 | 25 | 26 | ## Schema 27 | 28 | ### Required 29 | 30 | - `name` (String) The name of the security group. 31 | - `project_id` (String) STACKIT project ID to which the security group is associated. 32 | 33 | ### Optional 34 | 35 | - `description` (String) The description of the security group. 36 | - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container 37 | - `stateful` (Boolean) Configures if a security group is stateful or stateless. There can only be one type of security groups per network interface/server. 38 | 39 | ### Read-Only 40 | 41 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`security_group_id`". 42 | - `security_group_id` (String) The security group ID. 43 | -------------------------------------------------------------------------------- /docs/resources/server_network_interface_attach.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_server_network_interface_attach Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Network interface attachment resource schema. Attaches a network interface to a server. Must have a region specified in the provider configuration. The attachment only takes full effect after server reboot. 7 | --- 8 | 9 | # stackit_server_network_interface_attach (Resource) 10 | 11 | Network interface attachment resource schema. Attaches a network interface to a server. Must have a `region` specified in the provider configuration. The attachment only takes full effect after server reboot. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_server_network_interface_attach" "attached_network_interface" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `network_interface_id` (String) The network interface ID. 29 | - `project_id` (String) STACKIT project ID to which the network interface attachment is associated. 30 | - `server_id` (String) The server ID. 31 | 32 | ### Read-Only 33 | 34 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`,`network_interface_id`". 35 | -------------------------------------------------------------------------------- /docs/resources/server_service_account_attach.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_server_service_account_attach Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Service account attachment resource schema. Attaches a service account to a server. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_server_service_account_attach (Resource) 10 | 11 | Service account attachment resource schema. Attaches a service account to a server. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_server_service_account_attach" "attached_service_account" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | service_account_email = "service-account@stackit.cloud" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `project_id` (String) STACKIT project ID to which the service account attachment is associated. 29 | - `server_id` (String) The server ID. 30 | - `service_account_email` (String) The service account email. 31 | 32 | ### Read-Only 33 | 34 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`,`service_account_email`". 35 | -------------------------------------------------------------------------------- /docs/resources/server_volume_attach.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_server_volume_attach Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Volume attachment resource schema. Attaches a volume to a server. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_server_volume_attach (Resource) 10 | 11 | Volume attachment resource schema. Attaches a volume to a server. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_server_volume_attach" "attached_volume" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | volume_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `project_id` (String) STACKIT project ID to which the volume attachment is associated. 29 | - `server_id` (String) The server ID. 30 | - `volume_id` (String) The volume ID. 31 | 32 | ### Read-Only 33 | 34 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`server_id`,`volume_id`". 35 | -------------------------------------------------------------------------------- /docs/resources/service_account.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_service_account Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | Service account resource schema. 7 | --- 8 | 9 | # stackit_service_account (Resource) 10 | 11 | Service account resource schema. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_service_account" "sa" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | name = "sa01" 19 | } 20 | ``` 21 | 22 | 23 | ## Schema 24 | 25 | ### Required 26 | 27 | - `name` (String) Name of the service account. 28 | - `project_id` (String) STACKIT project ID to which the service account is associated. 29 | 30 | ### Read-Only 31 | 32 | - `email` (String) Email of the service account. 33 | - `id` (String) Terraform's internal resource ID, structured as "`project_id`,`email`". 34 | -------------------------------------------------------------------------------- /docs/resources/ske_kubeconfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_ske_kubeconfig Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | SKE kubeconfig resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_ske_kubeconfig (Resource) 10 | 11 | SKE kubeconfig resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_ske_kubeconfig" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | cluster_name = "example-cluster" 19 | refresh = true 20 | } 21 | ``` 22 | 23 | 24 | ## Schema 25 | 26 | ### Required 27 | 28 | - `cluster_name` (String) Name of the SKE cluster. 29 | - `project_id` (String) STACKIT project ID to which the cluster is associated. 30 | 31 | ### Optional 32 | 33 | - `expiration` (Number) Expiration time of the kubeconfig, in seconds. Defaults to `3600` 34 | - `refresh` (Boolean) If set to true, the provider will check if the kubeconfig has expired and will generated a new valid one in-place 35 | 36 | ### Read-Only 37 | 38 | - `creation_time` (String) Date-time when the kubeconfig was created 39 | - `expires_at` (String) Timestamp when the kubeconfig expires 40 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`cluster_name`,`kube_config_id`". 41 | - `kube_config` (String, Sensitive) Raw short-lived admin kubeconfig. 42 | - `kube_config_id` (String) Internally generated UUID to identify a kubeconfig resource in Terraform, since the SKE API doesnt return a kubeconfig identifier 43 | -------------------------------------------------------------------------------- /docs/resources/sqlserverflex_user.md: -------------------------------------------------------------------------------- 1 | --- 2 | # generated by https://github.com/hashicorp/terraform-plugin-docs 3 | page_title: "stackit_sqlserverflex_user Resource - stackit" 4 | subcategory: "" 5 | description: |- 6 | SQLServer Flex user resource schema. Must have a region specified in the provider configuration. 7 | --- 8 | 9 | # stackit_sqlserverflex_user (Resource) 10 | 11 | SQLServer Flex user resource schema. Must have a `region` specified in the provider configuration. 12 | 13 | ## Example Usage 14 | 15 | ```terraform 16 | resource "stackit_sqlserverflex_user" "example" { 17 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 18 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | username = "username" 20 | roles = ["role"] 21 | } 22 | ``` 23 | 24 | 25 | ## Schema 26 | 27 | ### Required 28 | 29 | - `instance_id` (String) ID of the SQLServer Flex instance. 30 | - `project_id` (String) STACKIT project ID to which the instance is associated. 31 | - `username` (String) Username of the SQLServer Flex instance. 32 | 33 | ### Optional 34 | 35 | - `region` (String) 36 | - `roles` (Set of String) Database access levels for the user. The values for the default roles are: `##STACKIT_DatabaseManager##`, `##STACKIT_LoginManager##`, `##STACKIT_ProcessManager##`, `##STACKIT_ServerManager##`, `##STACKIT_SQLAgentManager##`, `##STACKIT_SQLAgentUser##` 37 | 38 | ### Read-Only 39 | 40 | - `host` (String) 41 | - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`user_id`". 42 | - `password` (String, Sensitive) Password of the user account. 43 | - `port` (Number) 44 | - `user_id` (String) User ID. 45 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_affinity_group/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_affinity_group" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | affinity_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_cdn_custom_domain/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_cdn_custom_domain" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | distribution_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "https://xxx.xxx" 5 | } 6 | 7 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_cdn_distribution/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_cdn_distribution" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | distribution_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_dns_record_set/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_dns_record_set" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | zone_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | record_set_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_dns_zone/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_dns_zone" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | zone_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_git/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_git" "git" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } -------------------------------------------------------------------------------- /examples/data-sources/stackit_image/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_image" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | image_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_key_pair/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_key_pair" "example" { 2 | name = "example-key-pair-name" 3 | } 4 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_loadbalancer/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_loadbalancer" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-load-balancer" 4 | } -------------------------------------------------------------------------------- /examples/data-sources/stackit_logme_credential/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_logme_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_logme_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_logme_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_mariadb_credential/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_mariadb_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_mariadb_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_mariadb_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_mongodbflex_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_mongodbflex_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_mongodbflex_user/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_mongodbflex_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_network/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_network" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | network_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_network_area/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_network_area" "example" { 2 | organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_network_area_route/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_network_area_route" "example" { 2 | organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | network_area_route_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_network_interface/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_network_interface" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | network_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } -------------------------------------------------------------------------------- /examples/data-sources/stackit_objectstorage_bucket/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_objectstorage_bucket" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-name" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_objectstorage_credential/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_objectstorage_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | credentials_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_objectstorage_credentials_group/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_objectstorage_credentials_group" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | credentials_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_observability_alertgroup/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_observability_alertgroup" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example-alert-group" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_observability_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_observability_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_observability_logalertgroup/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_observability_logalertgroup" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example-log-alert-group" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_observability_scrapeconfig/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_observability_scrapeconfig" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_opensearch_credential/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_opensearch_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_opensearch_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_opensearch_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_postgresflex_database/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_postgresflex_database" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_postgresflex_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_postgresflex_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_postgresflex_user/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_postgresflex_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_public_ip/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_public_ip" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | public_ip_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_public_ip_ranges/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_public_ip_ranges" "example" {} -------------------------------------------------------------------------------- /examples/data-sources/stackit_rabbitmq_credential/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_rabbitmq_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_rabbitmq_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_rabbitmq_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_redis_credential/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_redis_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_redis_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_redis_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_resourcemanager_project/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_resourcemanager_project" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | container_id = "example-container-abc123" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_secretsmanager_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_secretsmanager_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_secretsmanager_user/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_secretsmanager_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_security_group/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_security_group" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | security_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_security_group_rule/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_security_group_rule" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | security_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | security_group_rule_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_server/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_server" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } -------------------------------------------------------------------------------- /examples/data-sources/stackit_server_backup_schedule/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_server_backup_schedule" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | backup_schedule_id = xxxxx 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_server_backup_schedules/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_server_backup_schedules" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_server_update_schedule/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_server_update_schedule" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | update_schedule_id = xxxxx 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_server_update_schedules/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_server_update_schedules" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_service_account/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_service_account" "sa" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | email = "sa01-8565oq1@sa.stackit.cloud" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_ske_cluster/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_ske_cluster" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-name" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_sqlserverflex_instance/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_sqlserverflex_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_sqlserverflex_user/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_sqlserverflex_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/data-sources/stackit_volume/data-source.tf: -------------------------------------------------------------------------------- 1 | data "stackit_volume" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | volume_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/provider/provider.tf: -------------------------------------------------------------------------------- 1 | provider "stackit" { 2 | default_region = "eu01" 3 | } 4 | 5 | # Authentication 6 | 7 | # Token flow 8 | provider "stackit" { 9 | default_region = "eu01" 10 | service_account_token = var.service_account_token 11 | } 12 | 13 | # Key flow 14 | provider "stackit" { 15 | default_region = "eu01" 16 | service_account_key = var.service_account_key 17 | private_key = var.private_key 18 | } 19 | 20 | # Key flow (using path) 21 | provider "stackit" { 22 | default_region = "eu01" 23 | service_account_key_path = var.service_account_key_path 24 | private_key_path = var.private_key_path 25 | } 26 | 27 | -------------------------------------------------------------------------------- /examples/resources/stackit_affinity_group/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_affinity_group" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-affinity-group-name" 4 | policy = "hard-anti-affinity" 5 | } -------------------------------------------------------------------------------- /examples/resources/stackit_authorization_organization_role_assignment/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_authorization_organization_role_assignment" "example" { 2 | resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | role = "owner" 4 | subject = "john.doe@stackit.cloud" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_authorization_project_role_assignment/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_authorization_project_role_assignment" "example" { 2 | resource_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | role = "owner" 4 | subject = "john.doe@stackit.cloud" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_cdn_custom_domain/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_cdn_custom_domain" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | distribution_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "https://xxx.xxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_cdn_distribution/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_cdn_distribution" "example_distribution" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | config = { 4 | backend = { 5 | type = "http" 6 | origin_url = "mybackend.onstackit.cloud" 7 | } 8 | regions = ["EU", "US", "ASIA", "AF", "SA"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/resources/stackit_dns_record_set/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_dns_record_set" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | zone_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example-record-set" 5 | type = "A" 6 | comment = "Example comment" 7 | records = ["1.2.3.4"] 8 | } 9 | -------------------------------------------------------------------------------- /examples/resources/stackit_dns_zone/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_dns_zone" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "Example zone" 4 | dns_name = "example-zone.com" 5 | contact_email = "aa@bb.ccc" 6 | type = "primary" 7 | acl = "192.168.0.0/24" 8 | description = "Example description" 9 | default_ttl = 1230 10 | } 11 | -------------------------------------------------------------------------------- /examples/resources/stackit_git/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_git" "git" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "git-example-instance" 4 | } -------------------------------------------------------------------------------- /examples/resources/stackit_image/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_image" "example_image" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-image" 4 | disk_format = "qcow2" 5 | local_file_path = "./path/to/image.qcow2" 6 | min_disk_size = 10 7 | min_ram = 5 8 | } 9 | -------------------------------------------------------------------------------- /examples/resources/stackit_loadbalancer_observability_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_loadbalancer_observability_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | display_name = "example-credentials" 4 | username = "example-user" 5 | password = "example-password" 6 | } 7 | -------------------------------------------------------------------------------- /examples/resources/stackit_logme_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_logme_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_logme_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_logme_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | version = "2" 5 | plan_name = "stackit-logme2-1.2.50-replica" 6 | parameters = { 7 | sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/resources/stackit_mariadb_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_mariadb_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_mariadb_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_mariadb_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | version = "10.11" 5 | plan_name = "stackit-mariadb-1.2.10-replica" 6 | parameters = { 7 | sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/resources/stackit_mongodbflex_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_mongodbflex_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"] 5 | flavor = { 6 | cpu = 1 7 | ram = 4 8 | } 9 | replicas = 1 10 | storage = { 11 | class = "class" 12 | size = 10 13 | } 14 | version = "7.0" 15 | options = { 16 | type = "Single" 17 | snapshot_retention_days = 3 18 | point_in_time_window_hours = 30 19 | } 20 | backup_schedule = "0 0 * * *" 21 | } 22 | -------------------------------------------------------------------------------- /examples/resources/stackit_mongodbflex_user/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_mongodbflex_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | username = "username" 5 | roles = ["role"] 6 | database = "database" 7 | } 8 | -------------------------------------------------------------------------------- /examples/resources/stackit_network/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_network" "example_with_name" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-with-name" 4 | } 5 | 6 | resource "stackit_network" "example_routed_network" { 7 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 8 | name = "example-routed-network" 9 | labels = { 10 | "key" = "value" 11 | } 12 | routed = true 13 | } 14 | 15 | resource "stackit_network" "example_non_routed_network" { 16 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 17 | name = "example-non-routed-network" 18 | ipv4_nameservers = ["1.2.3.4", "5.6.7.8"] 19 | ipv4_prefix_length = 24 20 | ipv4_gateway = "10.1.2.3" 21 | ipv4_prefix = "10.1.2.0/24" 22 | labels = { 23 | "key" = "value" 24 | } 25 | routed = false 26 | } -------------------------------------------------------------------------------- /examples/resources/stackit_network_area/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_network_area" "example" { 2 | organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-network-area" 4 | network_ranges = [ 5 | { 6 | prefix = "192.168.0.0/24" 7 | } 8 | ] 9 | transfer_network = "192.168.0.0/24" 10 | labels = { 11 | "key" = "value" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/resources/stackit_network_area_route/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_network_area_route" "example" { 2 | organization_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | network_area_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | prefix = "192.168.0.0/24" 5 | next_hop = "192.168.0.0" 6 | labels = { 7 | "key" = "value" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/resources/stackit_network_interface/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_network_interface" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | network_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | allowed_addresses = ["192.168.0.0/24"] 5 | security_group_ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] 6 | } -------------------------------------------------------------------------------- /examples/resources/stackit_objectstorage_bucket/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_objectstorage_bucket" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-bucket" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_objectstorage_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_objectstorage_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | credentials_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | expiration_timestamp = "2027-01-02T03:04:05Z" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_objectstorage_credentials_group/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_objectstorage_credentials_group" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-credentials-group" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_observability_alertgroup/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_observability_alertgroup" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example-alert-group" 5 | interval = "60s" 6 | rules = [ 7 | { 8 | alert = "example-alert-name" 9 | expression = "kube_node_status_condition{condition=\"Ready\", status=\"false\"} > 0" 10 | for = "60s" 11 | labels = { 12 | severity = "critical" 13 | }, 14 | annotations = { 15 | summary : "example summary" 16 | description : "example description" 17 | } 18 | }, 19 | { 20 | alert = "example-alert-name-2" 21 | expression = "kube_node_status_condition{condition=\"Ready\", status=\"false\"} > 0" 22 | for = "1m" 23 | labels = { 24 | severity = "critical" 25 | }, 26 | annotations = { 27 | summary : "example summary" 28 | description : "example description" 29 | } 30 | }, 31 | ] 32 | } -------------------------------------------------------------------------------- /examples/resources/stackit_observability_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_observability_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_observability_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_observability_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | plan_name = "Observability-Monitoring-Medium-EU01" 5 | acl = ["1.1.1.1/32", "2.2.2.2/32"] 6 | metrics_retention_days = 30 7 | metrics_retention_days_5m_downsampling = 10 8 | metrics_retention_days_1h_downsampling = 5 9 | } 10 | -------------------------------------------------------------------------------- /examples/resources/stackit_observability_logalertgroup/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_observability_logalertgroup" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example-log-alert-group" 5 | interval = "60m" 6 | rules = [ 7 | { 8 | alert = "example-log-alert-name" 9 | expression = "sum(rate({namespace=\"example\", pod=\"logger\"} |= \"Simulated error message\" [1m])) > 0" 10 | for = "60s" 11 | labels = { 12 | severity = "critical" 13 | }, 14 | annotations = { 15 | summary : "example summary" 16 | description : "example description" 17 | } 18 | }, 19 | { 20 | alert = "example-log-alert-name-2" 21 | expression = "sum(rate({namespace=\"example\", pod=\"logger\"} |= \"Another error message\" [1m])) > 0" 22 | for = "60s" 23 | labels = { 24 | severity = "critical" 25 | }, 26 | annotations = { 27 | summary : "example summary" 28 | description : "example description" 29 | } 30 | }, 31 | ] 32 | } -------------------------------------------------------------------------------- /examples/resources/stackit_observability_scrapeconfig/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_observability_scrapeconfig" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example-job" 5 | metrics_path = "/my-metrics" 6 | saml2 = { 7 | enable_url_parameters = true 8 | } 9 | targets = [ 10 | { 11 | urls = ["url1", "urls2"] 12 | labels = { 13 | "url1" = "dev" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /examples/resources/stackit_opensearch_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_opensearch_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_opensearch_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_opensearch_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | version = "2" 5 | plan_name = "stackit-opensearch-1.2.10-replica" 6 | parameters = { 7 | sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/resources/stackit_postgresflex_database/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_postgresflex_database" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "mydb" 5 | owner = "myusername" 6 | } 7 | -------------------------------------------------------------------------------- /examples/resources/stackit_postgresflex_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_postgresflex_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"] 5 | backup_schedule = "00 00 * * *" 6 | flavor = { 7 | cpu = 2 8 | ram = 4 9 | } 10 | replicas = 3 11 | storage = { 12 | class = "class" 13 | size = 5 14 | } 15 | version = 14 16 | } 17 | -------------------------------------------------------------------------------- /examples/resources/stackit_postgresflex_user/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_postgresflex_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | username = "username" 5 | roles = ["role"] 6 | } 7 | -------------------------------------------------------------------------------- /examples/resources/stackit_public_ip/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_public_ip" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | labels = { 5 | "key" = "value" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/resources/stackit_public_ip_associate/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_public_ip_associate" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | public_ip_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_rabbitmq_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_rabbitmq_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_rabbitmq_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_rabbitmq_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | version = "3.13" 5 | plan_name = "stackit-rabbitmq-1.2.10-replica" 6 | parameters = { 7 | sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" 8 | consumer_timeout = 18000000 9 | enable_monitoring = false 10 | plugins = ["rabbitmq_consistent_hash_exchange", "rabbitmq_federation", "rabbitmq_tracing"] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/resources/stackit_redis_credential/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_redis_credential" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_redis_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_redis_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | version = "7" 5 | plan_name = "stackit-redis-1.2.10-replica" 6 | parameters = { 7 | sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" 8 | enable_monitoring = false 9 | down_after_milliseconds = 30000 10 | syslog = ["logs4.your-syslog-endpoint.com:54321"] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/resources/stackit_resourcemanager_project/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_resourcemanager_project" "example" { 2 | parent_container_id = "example-parent-container-abc123" 3 | name = "example-container" 4 | labels = { 5 | "Label 1" = "foo" 6 | // "networkArea" = stackit_network_area.foo.network_area_id 7 | } 8 | owner_email = "john.doe@stackit.cloud" 9 | } 10 | -------------------------------------------------------------------------------- /examples/resources/stackit_secretsmanager_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_secretsmanager_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | acls = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"] 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_secretsmanager_user/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_secretsmanager_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | description = "Example user" 5 | write_enabled = false 6 | } 7 | -------------------------------------------------------------------------------- /examples/resources/stackit_security_group/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_security_group" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "my_security_group" 4 | labels = { 5 | "key" = "value" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/resources/stackit_security_group_rule/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_security_group_rule" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | security_group_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | direction = "ingress" 5 | icmp_parameters = { 6 | code = 0 7 | type = 8 8 | } 9 | protocol = { 10 | name = "icmp" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/resources/stackit_server_backup_schedule/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_server_backup_schedule" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example_backup_schedule_name" 5 | rrule = "DTSTART;TZID=Europe/Sofia:20200803T023000 RRULE:FREQ=DAILY;INTERVAL=1" 6 | enabled = true 7 | backup_properties = { 8 | name = "example_backup_name" 9 | retention_period = 14 10 | volume_ids = null 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/resources/stackit_server_network_interface_attach/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_server_network_interface_attach" "attached_network_interface" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_server_service_account_attach/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_server_service_account_attach" "attached_service_account" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | service_account_email = "service-account@stackit.cloud" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_server_update_schedule/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_server_update_schedule" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | name = "example_update_schedule_name" 5 | rrule = "DTSTART;TZID=Europe/Sofia:20200803T023000 RRULE:FREQ=DAILY;INTERVAL=1" 6 | enabled = true 7 | maintenance_window = 1 8 | } 9 | -------------------------------------------------------------------------------- /examples/resources/stackit_server_volume_attach/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_server_volume_attach" "attached_volume" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | volume_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_service_account/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_service_account" "sa" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "sa01" 4 | } 5 | -------------------------------------------------------------------------------- /examples/resources/stackit_ske_cluster/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_ske_cluster" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example" 4 | kubernetes_version = "x.x" 5 | node_pools = [ 6 | { 7 | name = "np-example" 8 | machine_type = "x.x" 9 | os_version = "x.x.x" 10 | minimum = "2" 11 | maximum = "3" 12 | availability_zones = ["eu01-3"] 13 | } 14 | ] 15 | maintenance = { 16 | enable_kubernetes_version_updates = true 17 | enable_machine_image_version_updates = true 18 | start = "01:00:00Z" 19 | end = "02:00:00Z" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/resources/stackit_ske_kubeconfig/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_ske_kubeconfig" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | cluster_name = "example-cluster" 4 | refresh = true 5 | } 6 | -------------------------------------------------------------------------------- /examples/resources/stackit_sqlserverflex_instance/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_sqlserverflex_instance" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "example-instance" 4 | acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"] 5 | backup_schedule = "00 00 * * *" 6 | flavor = { 7 | cpu = 4 8 | ram = 16 9 | } 10 | storage = { 11 | class = "class" 12 | size = 5 13 | } 14 | version = 2022 15 | } 16 | -------------------------------------------------------------------------------- /examples/resources/stackit_sqlserverflex_user/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_sqlserverflex_user" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 4 | username = "username" 5 | roles = ["role"] 6 | } 7 | -------------------------------------------------------------------------------- /examples/resources/stackit_volume/resource.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_volume" "example" { 2 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 3 | name = "my_volume" 4 | availability_zone = "eu01-1" 5 | size = 64 6 | labels = { 7 | "key" = "value" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "flag" 6 | "log" 7 | 8 | "github.com/hashicorp/terraform-plugin-framework/providerserver" 9 | "github.com/stackitcloud/terraform-provider-stackit/stackit" 10 | ) 11 | 12 | var ( 13 | // goreleaser configuration will override this value 14 | version string = "dev" 15 | ) 16 | 17 | func main() { 18 | var debug bool 19 | flag.BoolVar(&debug, "debug", false, "allows debugging the provider") 20 | flag.Parse() 21 | err := providerserver.Serve(context.Background(), stackit.New(version), providerserver.ServeOpts{ 22 | Address: "registry.terraform.io/stackitcloud/stackit", 23 | Debug: debug, 24 | }) 25 | if err != nil { 26 | log.Fatal(err.Error()) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scripts/check-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to ensure for PRs the docs are up-to-date via the CI pipeline 4 | # Usage: ./check-docs.sh 5 | set -eo pipefail 6 | 7 | ROOT_DIR=$(git rev-parse --show-toplevel) 8 | 9 | before_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}') 10 | 11 | # re-generate the docs 12 | $ROOT_DIR/scripts/tfplugindocs.sh 13 | 14 | after_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}') 15 | 16 | if [[ "$before_hash" == "$after_hash" ]]; then 17 | echo "Docs are up-to-date" 18 | else 19 | echo "Changes detected. Docs are *not* up-to-date." 20 | exit 1 21 | fi 22 | -------------------------------------------------------------------------------- /scripts/lint-golangci-lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script lints the SDK modules and the internal examples 3 | # Pre-requisites: golangci-lint 4 | set -eo pipefail 5 | 6 | ROOT_DIR=$(git rev-parse --show-toplevel) 7 | GOLANG_CI_YAML_PATH="${ROOT_DIR}/golang-ci.yaml" 8 | GOLANG_CI_ARGS="--allow-parallel-runners --timeout=5m --config=${GOLANG_CI_YAML_PATH}" 9 | 10 | if type -p golangci-lint >/dev/null; then 11 | : 12 | else 13 | echo "golangci-lint not installed, unable to proceed." 14 | exit 1 15 | fi 16 | 17 | cd ${ROOT_DIR} 18 | golangci-lint run ${GOLANG_CI_ARGS} 19 | -------------------------------------------------------------------------------- /scripts/project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to manage the project, only used for installing the required tools for now 4 | # Usage: ./project.sh [action] 5 | # * tools: Install required tools to run the project 6 | set -eo pipefail 7 | 8 | ROOT_DIR=$(git rev-parse --show-toplevel) 9 | 10 | action=$1 11 | 12 | if [ "$action" = "help" ]; then 13 | [ -f "$0".man ] && man "$0".man || echo "No help, please read the script in ${script}, we will add help later" 14 | elif [ "$action" = "tools" ]; then 15 | cd ${ROOT_DIR} 16 | 17 | go mod download 18 | 19 | go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0 20 | go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@v0.21.0 21 | else 22 | echo "Invalid action: '$action', please use $0 help for help" 23 | fi 24 | -------------------------------------------------------------------------------- /scripts/tfplugindocs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Pre-requisites: tfplugindocs 3 | set -eo pipefail 4 | 5 | ROOT_DIR=$(git rev-parse --show-toplevel) 6 | EXAMPLES_DIR="${ROOT_DIR}/examples" 7 | PROVIDER_NAME="stackit" 8 | 9 | # Create a new empty directory for the docs 10 | if [ -d ${ROOT_DIR}/docs ]; then 11 | rm -rf ${ROOT_DIR}/docs 12 | fi 13 | mkdir -p ${ROOT_DIR}/docs 14 | 15 | echo ">> Generating documentation" 16 | tfplugindocs generate \ 17 | --provider-name "stackit" 18 | -------------------------------------------------------------------------------- /stackit/internal/services/authorization/testfiles/double-definition.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "stackit_authorization_project_role_assignment" "serviceaccount_duplicate" { 3 | resource_id = var.project_id 4 | role = "reader" 5 | subject = var.test_service_account 6 | } 7 | -------------------------------------------------------------------------------- /stackit/internal/services/authorization/testfiles/invalid-role.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "stackit_authorization_project_role_assignment" "invalid_role" { 3 | resource_id = var.project_id 4 | role = "thisrolesdoesnotexist" 5 | subject = var.test_service_account 6 | } 7 | -------------------------------------------------------------------------------- /stackit/internal/services/authorization/testfiles/organization-role.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "stackit_authorization_organization_role_assignment" "serviceaccount" { 3 | resource_id = var.organization_id 4 | role = "organization.member" 5 | subject = var.test_service_account 6 | } -------------------------------------------------------------------------------- /stackit/internal/services/authorization/testfiles/prerequisites.tf: -------------------------------------------------------------------------------- 1 | 2 | variable "project_id" {} 3 | variable "test_service_account" {} 4 | variable "organization_id" {} 5 | 6 | resource "stackit_authorization_project_role_assignment" "serviceaccount" { 7 | resource_id = var.project_id 8 | role = "reader" 9 | subject = var.test_service_account 10 | } 11 | -------------------------------------------------------------------------------- /stackit/internal/services/authorization/testfiles/project-owner.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "stackit_authorization_project_role_assignment" "serviceaccount_project_owner" { 3 | resource_id = var.project_id 4 | role = "owner" 5 | subject = var.test_service_account 6 | } 7 | -------------------------------------------------------------------------------- /stackit/internal/services/authorization/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/authorization" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *authorization.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.AuthorizationCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.AuthorizationCustomEndpoint)) 21 | } 22 | apiClient, err := authorization.NewAPIClient(apiClientConfigOptions...) 23 | if err != nil { 24 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 25 | return nil 26 | } 27 | 28 | return apiClient 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/cdn/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/cdn" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *cdn.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.CdnCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.CdnCustomEndpoint)) 21 | } 22 | apiClient, err := cdn.NewAPIClient(apiClientConfigOptions...) 23 | if err != nil { 24 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 25 | return nil 26 | } 27 | 28 | return apiClient 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/dns/testdata/resource-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "dns_name" {} 4 | 5 | variable "record_name" {} 6 | variable "record_record1" {} 7 | variable "record_type" {} 8 | 9 | 10 | resource "stackit_dns_zone" "zone" { 11 | project_id = var.project_id 12 | name = var.name 13 | dns_name = var.dns_name 14 | } 15 | 16 | 17 | resource "stackit_dns_record_set" "record_set" { 18 | project_id = var.project_id 19 | zone_id = stackit_dns_zone.zone.zone_id 20 | name = var.record_name 21 | records = [ 22 | var.record_record1 23 | ] 24 | type = var.record_type 25 | } 26 | 27 | data "stackit_dns_zone" "zone" { 28 | project_id = var.project_id 29 | zone_id = stackit_dns_zone.zone.zone_id 30 | } 31 | 32 | data "stackit_dns_zone" "zone_name" { 33 | project_id = var.project_id 34 | dns_name = stackit_dns_zone.zone.dns_name 35 | } 36 | 37 | data "stackit_dns_record_set" "record_set" { 38 | project_id = var.project_id 39 | zone_id = stackit_dns_zone.zone.zone_id 40 | record_set_id = stackit_dns_record_set.record_set.record_set_id 41 | } 42 | -------------------------------------------------------------------------------- /stackit/internal/services/dns/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/dns" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *dns.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.DnsCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.DnsCustomEndpoint)) 21 | } 22 | apiClient, err := dns.NewAPIClient(apiClientConfigOptions...) 23 | if err != nil { 24 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 25 | return nil 26 | } 27 | 28 | return apiClient 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/git/testdata/resource.tf: -------------------------------------------------------------------------------- 1 | 2 | variable "project_id" {} 3 | variable "name" {} 4 | 5 | resource "stackit_git" "git" { 6 | project_id = var.project_id 7 | name = var.name 8 | } 9 | -------------------------------------------------------------------------------- /stackit/internal/services/git/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/git" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *git.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.GitCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.GitCustomEndpoint)) 21 | } 22 | apiClient, err := git.NewAPIClient(apiClientConfigOptions...) 23 | if err != nil { 24 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 25 | return nil 26 | } 27 | 28 | return apiClient 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/iaas/affinitygroup/const.go: -------------------------------------------------------------------------------- 1 | package affinitygroup 2 | 3 | const exampleUsageWithServer = ` 4 | 5 | ### Usage with server` + "\n" + 6 | "```terraform" + ` 7 | resource "stackit_affinity_group" "affinity-group" { 8 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 9 | name = "example-key-pair" 10 | policy = "soft-affinity" 11 | } 12 | 13 | resource "stackit_server" "example-server" { 14 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 15 | name = "example-server" 16 | boot_volume = { 17 | size = 64 18 | source_type = "image" 19 | source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | affinity_group = stackit_affinity_group.affinity-group.affinity_group_id 22 | availability_zone = "eu01-1" 23 | machine_type = "g1.1" 24 | } 25 | ` + "\n```" 26 | 27 | const policies = ` 28 | 29 | ### Policies 30 | 31 | * ` + "`hard-affinity`" + `- All servers launched in this group will be hosted on the same compute node. 32 | 33 | * ` + "`hard-anti-affinity`" + `- All servers launched in this group will be 34 | hosted on different compute nodes. 35 | 36 | * ` + "`soft-affinity`" + `- All servers launched in this group will be hosted 37 | on the same compute node if possible, but if not possible they still will be scheduled instead of failure. 38 | 39 | * ` + "`soft-anti-affinity`" + `- All servers launched in this group will be hosted on different compute nodes if possible, 40 | but if not possible they still will be scheduled instead of failure. 41 | ` 42 | -------------------------------------------------------------------------------- /stackit/internal/services/iaas/image/testdata/mock-image.txt: -------------------------------------------------------------------------------- 1 | I am a mock image file -------------------------------------------------------------------------------- /stackit/internal/services/iaas/keypair/const.go: -------------------------------------------------------------------------------- 1 | package keypair 2 | 3 | const exampleUsageWithServer = ` 4 | 5 | ### Usage with server` + "\n" + 6 | 7 | "```terraform" + ` 8 | resource "stackit_key_pair" "keypair" { 9 | name = "example-key-pair" 10 | public_key = chomp(file("path/to/id_rsa.pub")) 11 | } 12 | 13 | resource "stackit_server" "example-server" { 14 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 15 | name = "example-server" 16 | boot_volume = { 17 | size = 64 18 | source_type = "image" 19 | source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 20 | } 21 | availability_zone = "eu01-1" 22 | machine_type = "g1.1" 23 | keypair_name = "example-key-pair" 24 | } 25 | ` + "\n```" 26 | -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-affinity-group-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "policy" {} 4 | 5 | resource "stackit_affinity_group" "affinity_group" { 6 | project_id = var.project_id 7 | name = var.name 8 | policy = var.policy 9 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-image-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "disk_format" {} 4 | variable "local_file_path" {} 5 | variable "min_disk_size" {} 6 | variable "min_ram" {} 7 | variable "label" {} 8 | variable "boot_menu" {} 9 | variable "cdrom_bus" {} 10 | variable "disk_bus" {} 11 | variable "nic_model" {} 12 | variable "operating_system" {} 13 | variable "operating_system_distro" {} 14 | variable "operating_system_version" {} 15 | variable "rescue_bus" {} 16 | variable "rescue_device" {} 17 | variable "secure_boot" {} 18 | variable "uefi" {} 19 | variable "video_model" {} 20 | variable "virtio_scsi" {} 21 | 22 | resource "stackit_image" "image" { 23 | project_id = var.project_id 24 | name = var.name 25 | disk_format = var.disk_format 26 | local_file_path = var.local_file_path 27 | min_disk_size = var.min_disk_size 28 | min_ram = var.min_ram 29 | labels = { 30 | "acc-test" : var.label 31 | } 32 | config = { 33 | boot_menu = var.boot_menu 34 | cdrom_bus = var.cdrom_bus 35 | disk_bus = var.disk_bus 36 | nic_model = var.nic_model 37 | operating_system = var.operating_system 38 | operating_system_distro = var.operating_system_distro 39 | operating_system_version = var.operating_system_version 40 | rescue_bus = var.rescue_bus 41 | rescue_device = var.rescue_device 42 | secure_boot = var.secure_boot 43 | uefi = var.uefi 44 | video_model = var.video_model 45 | virtio_scsi = var.virtio_scsi 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-image-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "disk_format" {} 4 | variable "local_file_path" {} 5 | 6 | resource "stackit_image" "image" { 7 | project_id = var.project_id 8 | name = var.name 9 | disk_format = var.disk_format 10 | local_file_path = var.local_file_path 11 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-key-pair-max.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "public_key" {} 3 | variable "label" {} 4 | 5 | resource "stackit_key_pair" "key_pair" { 6 | name = var.name 7 | public_key = var.public_key 8 | labels = { 9 | "acc-test" : var.label 10 | } 11 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-key-pair-min.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "public_key" {} 3 | 4 | resource "stackit_key_pair" "key_pair" { 5 | name = var.name 6 | public_key = var.public_key 7 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-network-area-max.tf: -------------------------------------------------------------------------------- 1 | variable "organization_id" {} 2 | 3 | variable "name" {} 4 | variable "transfer_network" {} 5 | variable "network_ranges_prefix" {} 6 | variable "default_nameservers" {} 7 | variable "default_prefix_length" {} 8 | variable "max_prefix_length" {} 9 | variable "min_prefix_length" {} 10 | 11 | variable "route_prefix" {} 12 | variable "route_next_hop" {} 13 | variable "label" {} 14 | 15 | resource "stackit_network_area" "network_area" { 16 | organization_id = var.organization_id 17 | name = var.name 18 | network_ranges = [ 19 | { 20 | prefix = var.network_ranges_prefix 21 | } 22 | ] 23 | transfer_network = var.transfer_network 24 | default_nameservers = [var.default_nameservers] 25 | default_prefix_length = var.default_prefix_length 26 | max_prefix_length = var.max_prefix_length 27 | min_prefix_length = var.min_prefix_length 28 | labels = { 29 | "acc-test" : var.label 30 | } 31 | } 32 | 33 | resource "stackit_network_area_route" "network_area_route" { 34 | organization_id = stackit_network_area.network_area.organization_id 35 | network_area_id = stackit_network_area.network_area.network_area_id 36 | prefix = var.route_prefix 37 | next_hop = var.route_next_hop 38 | labels = { 39 | "acc-test" : var.label 40 | } 41 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-network-area-min.tf: -------------------------------------------------------------------------------- 1 | variable "organization_id" {} 2 | 3 | variable "name" {} 4 | variable "transfer_network" {} 5 | variable "network_ranges_prefix" {} 6 | 7 | variable "route_prefix" {} 8 | variable "route_next_hop" {} 9 | 10 | resource "stackit_network_area" "network_area" { 11 | organization_id = var.organization_id 12 | name = var.name 13 | transfer_network = var.transfer_network 14 | network_ranges = [ 15 | { 16 | prefix = var.network_ranges_prefix 17 | } 18 | ] 19 | } 20 | 21 | resource "stackit_network_area_route" "network_area_route" { 22 | organization_id = stackit_network_area.network_area.organization_id 23 | network_area_id = stackit_network_area.network_area.network_area_id 24 | prefix = var.route_prefix 25 | next_hop = var.route_next_hop 26 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-network-interface-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | 4 | resource "stackit_network" "network" { 5 | project_id = var.project_id 6 | name = var.name 7 | } 8 | 9 | resource "stackit_network_interface" "network_interface" { 10 | project_id = var.project_id 11 | network_id = stackit_network.network.network_id 12 | } 13 | 14 | resource "stackit_public_ip" "public_ip" { 15 | project_id = var.project_id 16 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-network-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "ipv4_gateway" {} 4 | variable "ipv4_nameservers" {} 5 | variable "ipv4_prefix" {} 6 | variable "ipv4_prefix_length" {} 7 | variable "routed" {} 8 | variable "label" {} 9 | 10 | resource "stackit_network" "network" { 11 | project_id = var.project_id 12 | name = var.name 13 | ipv4_gateway = var.ipv4_gateway != "" ? var.ipv4_gateway : null 14 | no_ipv4_gateway = var.ipv4_gateway != "" ? null : true 15 | ipv4_nameservers = [var.ipv4_nameservers] 16 | ipv4_prefix = var.ipv4_prefix 17 | ipv4_prefix_length = var.ipv4_prefix_length 18 | routed = var.routed 19 | labels = { 20 | "acc-test" : var.label 21 | } 22 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-network-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | 4 | resource "stackit_network" "network" { 5 | project_id = var.project_id 6 | name = var.name 7 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-security-group-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | 3 | variable "name" {} 4 | variable "direction" {} 5 | 6 | resource "stackit_security_group" "security_group" { 7 | project_id = var.project_id 8 | name = var.name 9 | } 10 | 11 | resource "stackit_security_group_rule" "security_group_rule" { 12 | project_id = var.project_id 13 | security_group_id = stackit_security_group.security_group.security_group_id 14 | direction = var.direction 15 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-server-max-server-attachments.tf: -------------------------------------------------------------------------------- 1 | resource "stackit_server_volume_attach" "data_volume_attachment" { 2 | project_id = var.project_id 3 | server_id = stackit_server.server.server_id 4 | volume_id = stackit_volume.data_volume.volume_id 5 | } 6 | 7 | resource "stackit_server_network_interface_attach" "network_interface_second_attachment" { 8 | project_id = var.project_id 9 | network_interface_id = stackit_network_interface.network_interface_second.network_interface_id 10 | server_id = stackit_server.server.server_id 11 | } 12 | -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-server-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "machine_type" {} 4 | variable "image_id" {} 5 | 6 | 7 | resource "stackit_server" "server" { 8 | project_id = var.project_id 9 | name = var.name 10 | machine_type = var.machine_type 11 | boot_volume = { 12 | source_type = "image" 13 | size = 16 14 | source_id = var.image_id 15 | delete_on_termination = true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-volume-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "availability_zone" {} 3 | variable "name" {} 4 | variable "size" {} 5 | variable "description" {} 6 | variable "performance_class" {} 7 | variable "label" {} 8 | 9 | resource "stackit_volume" "volume_size" { 10 | project_id = var.project_id 11 | availability_zone = var.availability_zone 12 | name = var.name 13 | size = var.size 14 | description = var.description 15 | performance_class = var.performance_class 16 | labels = { 17 | "acc-test" : var.label 18 | } 19 | } 20 | 21 | resource "stackit_volume" "volume_source" { 22 | project_id = var.project_id 23 | availability_zone = var.availability_zone 24 | name = var.name 25 | description = var.description 26 | performance_class = var.performance_class 27 | size = var.size 28 | source = { 29 | id = stackit_volume.volume_size.volume_id 30 | type = "volume" 31 | } 32 | labels = { 33 | "acc-test" : var.label 34 | } 35 | } -------------------------------------------------------------------------------- /stackit/internal/services/iaas/testdata/resource-volume-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "availability_zone" {} 3 | variable "size" {} 4 | 5 | resource "stackit_volume" "volume_size" { 6 | project_id = var.project_id 7 | availability_zone = var.availability_zone 8 | size = var.size 9 | } 10 | 11 | resource "stackit_volume" "volume_source" { 12 | project_id = var.project_id 13 | availability_zone = var.availability_zone 14 | source = { 15 | id = stackit_volume.volume_size.volume_id 16 | type = "volume" 17 | } 18 | } -------------------------------------------------------------------------------- /stackit/internal/services/loadbalancer/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/loadbalancer" 8 | 9 | "github.com/hashicorp/terraform-plugin-framework/diag" 10 | "github.com/stackitcloud/stackit-sdk-go/core/config" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 12 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 13 | ) 14 | 15 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *loadbalancer.APIClient { 16 | apiClientConfigOptions := []config.ConfigurationOption{ 17 | config.WithCustomAuth(providerData.RoundTripper), 18 | utils.UserAgentConfigOption(providerData.Version), 19 | } 20 | if providerData.LoadBalancerCustomEndpoint != "" { 21 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.LoadBalancerCustomEndpoint)) 22 | } 23 | apiClient, err := loadbalancer.NewAPIClient(apiClientConfigOptions...) 24 | if err != nil { 25 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 26 | return nil 27 | } 28 | 29 | return apiClient 30 | } 31 | -------------------------------------------------------------------------------- /stackit/internal/services/logme/testdata/resource-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "plan_name" {} 4 | variable "logme_version" {} 5 | 6 | resource "stackit_logme_instance" "instance" { 7 | project_id = var.project_id 8 | name = var.name 9 | plan_name = var.plan_name 10 | version = var.logme_version 11 | } 12 | 13 | resource "stackit_logme_credential" "credential" { 14 | project_id = stackit_logme_instance.instance.project_id 15 | instance_id = stackit_logme_instance.instance.instance_id 16 | } 17 | 18 | 19 | data "stackit_logme_instance" "instance" { 20 | project_id = stackit_logme_instance.instance.project_id 21 | instance_id = stackit_logme_instance.instance.instance_id 22 | } 23 | 24 | data "stackit_logme_credential" "credential" { 25 | project_id = stackit_logme_credential.credential.project_id 26 | instance_id = stackit_logme_credential.credential.instance_id 27 | credential_id = stackit_logme_credential.credential.credential_id 28 | } 29 | -------------------------------------------------------------------------------- /stackit/internal/services/logme/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/logme" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *logme.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.LogMeCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.LogMeCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := logme.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/mariadb/testfiles/resource-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "db_version" {} 4 | variable "plan_name" {} 5 | variable "observability_instance_plan_name" {} 6 | variable "parameters_enable_monitoring" {} 7 | variable "parameters_graphite" {} 8 | variable "parameters_max_disk_threshold" {} 9 | variable "parameters_metrics_frequency" {} 10 | variable "parameters_metrics_prefix" {} 11 | variable "parameters_sgw_acl" {} 12 | variable "parameters_syslog" {} 13 | 14 | resource "stackit_observability_instance" "observability_instance" { 15 | project_id = var.project_id 16 | name = var.name 17 | plan_name = var.observability_instance_plan_name 18 | } 19 | 20 | resource "stackit_mariadb_instance" "instance" { 21 | project_id = var.project_id 22 | name = var.name 23 | version = var.db_version 24 | plan_name = var.plan_name 25 | parameters = { 26 | enable_monitoring = var.parameters_enable_monitoring 27 | graphite = var.parameters_graphite 28 | max_disk_threshold = var.parameters_max_disk_threshold 29 | metrics_frequency = var.parameters_metrics_frequency 30 | metrics_prefix = var.parameters_metrics_prefix 31 | monitoring_instance_id = stackit_observability_instance.observability_instance.instance_id 32 | sgw_acl = var.parameters_sgw_acl 33 | syslog = [var.parameters_syslog] 34 | } 35 | } 36 | 37 | resource "stackit_mariadb_credential" "credential" { 38 | project_id = var.project_id 39 | instance_id = stackit_mariadb_instance.instance.instance_id 40 | } -------------------------------------------------------------------------------- /stackit/internal/services/mariadb/testfiles/resource-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "db_version" {} 4 | variable "plan_name" {} 5 | 6 | resource "stackit_mariadb_instance" "instance" { 7 | project_id = var.project_id 8 | name = var.name 9 | version = var.db_version 10 | plan_name = var.plan_name 11 | } 12 | 13 | resource "stackit_mariadb_credential" "credential" { 14 | project_id = var.project_id 15 | instance_id = stackit_mariadb_instance.instance.instance_id 16 | } -------------------------------------------------------------------------------- /stackit/internal/services/mariadb/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/mariadb" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *mariadb.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.MariaDBCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.MariaDBCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := mariadb.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/modelserving/token/description.md: -------------------------------------------------------------------------------- 1 | AI Model Serving Auth Token Resource schema. 2 | 3 | ## Example Usage 4 | 5 | ### Automatically rotate AI model serving token 6 | ```terraform 7 | resource "time_rotating" "rotate" { 8 | rotation_days = 80 9 | } 10 | 11 | resource "stackit_modelserving_token" "example" { 12 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 13 | name = "Example token" 14 | 15 | rotate_when_changed = { 16 | rotation = time_rotating.rotate.id 17 | } 18 | 19 | } 20 | ``` -------------------------------------------------------------------------------- /stackit/internal/services/modelserving/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/modelserving" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *modelserving.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.ModelServingCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ModelServingCustomEndpoint)) 21 | } 22 | apiClient, err := modelserving.NewAPIClient(apiClientConfigOptions...) 23 | if err != nil { 24 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 25 | return nil 26 | } 27 | 28 | return apiClient 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/mongodbflex/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *mongodbflex.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.MongoDBFlexCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.MongoDBFlexCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := mongodbflex.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/objectstorage/testfiles/resource-min.tf: -------------------------------------------------------------------------------- 1 | 2 | variable "project_id" {} 3 | variable "objectstorage_bucket_name" {} 4 | variable "objectstorage_credentials_group_name" {} 5 | variable "expiration_timestamp" {} 6 | 7 | resource "stackit_objectstorage_bucket" "bucket" { 8 | project_id = var.project_id 9 | name = var.objectstorage_bucket_name 10 | } 11 | 12 | resource "stackit_objectstorage_credentials_group" "credentials_group" { 13 | project_id = var.project_id 14 | name = var.objectstorage_credentials_group_name 15 | } 16 | 17 | resource "stackit_objectstorage_credential" "credential" { 18 | project_id = stackit_objectstorage_credentials_group.credentials_group.project_id 19 | credentials_group_id = stackit_objectstorage_credentials_group.credentials_group.credentials_group_id 20 | } 21 | 22 | resource "stackit_objectstorage_credential" "credential_time" { 23 | project_id = stackit_objectstorage_credentials_group.credentials_group.project_id 24 | credentials_group_id = stackit_objectstorage_credentials_group.credentials_group.credentials_group_id 25 | expiration_timestamp = var.expiration_timestamp 26 | } 27 | -------------------------------------------------------------------------------- /stackit/internal/services/objectstorage/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/objectstorage" 8 | 9 | "github.com/hashicorp/terraform-plugin-framework/diag" 10 | "github.com/stackitcloud/stackit-sdk-go/core/config" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 12 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 13 | ) 14 | 15 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *objectstorage.APIClient { 16 | apiClientConfigOptions := []config.ConfigurationOption{ 17 | config.WithCustomAuth(providerData.RoundTripper), 18 | utils.UserAgentConfigOption(providerData.Version), 19 | } 20 | if providerData.ObjectStorageCustomEndpoint != "" { 21 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ObjectStorageCustomEndpoint)) 22 | } 23 | apiClient, err := objectstorage.NewAPIClient(apiClientConfigOptions...) 24 | if err != nil { 25 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 26 | return nil 27 | } 28 | 29 | return apiClient 30 | } 31 | -------------------------------------------------------------------------------- /stackit/internal/services/observability/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/observability" 8 | 9 | "github.com/hashicorp/terraform-plugin-framework/diag" 10 | "github.com/stackitcloud/stackit-sdk-go/core/config" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 12 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 13 | ) 14 | 15 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *observability.APIClient { 16 | apiClientConfigOptions := []config.ConfigurationOption{ 17 | config.WithCustomAuth(providerData.RoundTripper), 18 | utils.UserAgentConfigOption(providerData.Version), 19 | } 20 | if providerData.ObservabilityCustomEndpoint != "" { 21 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ObservabilityCustomEndpoint)) 22 | } else { 23 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 24 | } 25 | apiClient, err := observability.NewAPIClient(apiClientConfigOptions...) 26 | if err != nil { 27 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 28 | return nil 29 | } 30 | 31 | return apiClient 32 | } 33 | -------------------------------------------------------------------------------- /stackit/internal/services/opensearch/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/opensearch" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *opensearch.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.OpenSearchCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.OpenSearchCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := opensearch.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/postgresflex/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/postgresflex" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *postgresflex.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.PostgresFlexCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.PostgresFlexCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := postgresflex.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/rabbitmq/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/rabbitmq" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *rabbitmq.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.RabbitMQCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.RabbitMQCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := rabbitmq.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/redis/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/redis" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *redis.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.RedisCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.RedisCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := redis.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/resourcemanager/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/resourcemanager" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *resourcemanager.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.ResourceManagerCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ResourceManagerCustomEndpoint)) 21 | } 22 | apiClient, err := resourcemanager.NewAPIClient(apiClientConfigOptions...) 23 | if err != nil { 24 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 25 | return nil 26 | } 27 | 28 | return apiClient 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/secretsmanager/testdata/resource-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "instance_name" {} 3 | variable "user_description" {} 4 | variable "write_enabled" {} 5 | variable "acl1" {} 6 | variable "acl2" {} 7 | 8 | resource "stackit_secretsmanager_instance" "instance" { 9 | project_id = var.project_id 10 | name = var.instance_name 11 | acls = [ 12 | var.acl1, 13 | var.acl2, 14 | ] 15 | } 16 | 17 | resource "stackit_secretsmanager_user" "user" { 18 | project_id = var.project_id 19 | instance_id = stackit_secretsmanager_instance.instance.instance_id 20 | description = var.user_description 21 | write_enabled = var.write_enabled 22 | } 23 | 24 | 25 | data "stackit_secretsmanager_instance" "instance" { 26 | project_id = var.project_id 27 | instance_id = stackit_secretsmanager_instance.instance.instance_id 28 | } 29 | 30 | data "stackit_secretsmanager_user" "user" { 31 | project_id = var.project_id 32 | instance_id = stackit_secretsmanager_instance.instance.instance_id 33 | user_id = stackit_secretsmanager_user.user.user_id 34 | } 35 | -------------------------------------------------------------------------------- /stackit/internal/services/secretsmanager/testdata/resource-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "instance_name" {} 3 | variable "user_description" {} 4 | variable "write_enabled" {} 5 | 6 | resource "stackit_secretsmanager_instance" "instance" { 7 | project_id = var.project_id 8 | name = var.instance_name 9 | } 10 | 11 | resource "stackit_secretsmanager_user" "user" { 12 | project_id = var.project_id 13 | instance_id = stackit_secretsmanager_instance.instance.instance_id 14 | description = var.user_description 15 | write_enabled = var.write_enabled 16 | } 17 | 18 | 19 | data "stackit_secretsmanager_instance" "instance" { 20 | project_id = var.project_id 21 | instance_id = stackit_secretsmanager_instance.instance.instance_id 22 | } 23 | 24 | data "stackit_secretsmanager_user" "user" { 25 | project_id = var.project_id 26 | instance_id = stackit_secretsmanager_instance.instance.instance_id 27 | user_id = stackit_secretsmanager_user.user.user_id 28 | } 29 | -------------------------------------------------------------------------------- /stackit/internal/services/secretsmanager/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/secretsmanager" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *secretsmanager.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.SecretsManagerCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.SecretsManagerCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := secretsmanager.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/serverbackup/testdata/resource-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "server_id" {} 3 | variable "schedule_name" {} 4 | variable "rrule" {} 5 | variable "enabled" {} 6 | variable "backup_name" {} 7 | variable "retention_period" {} 8 | variable "region" {} 9 | 10 | 11 | resource "stackit_server_backup_schedule" "test_schedule" { 12 | project_id = var.project_id 13 | server_id = var.server_id 14 | name = var.schedule_name 15 | rrule = var.rrule 16 | enabled = var.enabled 17 | backup_properties = { 18 | name = var.backup_name 19 | retention_period = var.retention_period 20 | volume_ids = null 21 | } 22 | region = var.region 23 | } 24 | 25 | data "stackit_server_backup_schedule" "schedule_data_test" { 26 | project_id = var.project_id 27 | server_id = var.server_id 28 | backup_schedule_id = stackit_server_backup_schedule.test_schedule.backup_schedule_id 29 | } 30 | 31 | data "stackit_server_backup_schedules" "schedules_data_test" { 32 | project_id = var.project_id 33 | server_id = var.server_id 34 | } 35 | -------------------------------------------------------------------------------- /stackit/internal/services/serverbackup/testdata/resource-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "server_id" {} 3 | variable "schedule_name" {} 4 | variable "rrule" {} 5 | variable "enabled" {} 6 | variable "backup_name" {} 7 | variable "retention_period" {} 8 | 9 | 10 | resource "stackit_server_backup_schedule" "test_schedule" { 11 | project_id = var.project_id 12 | server_id = var.server_id 13 | name = var.schedule_name 14 | rrule = var.rrule 15 | enabled = var.enabled 16 | backup_properties = { 17 | name = var.backup_name 18 | retention_period = var.retention_period 19 | volume_ids = null 20 | } 21 | } 22 | 23 | data "stackit_server_backup_schedule" "schedule_data_test" { 24 | project_id = var.project_id 25 | server_id = var.server_id 26 | backup_schedule_id = stackit_server_backup_schedule.test_schedule.backup_schedule_id 27 | } 28 | 29 | data "stackit_server_backup_schedules" "schedules_data_test" { 30 | project_id = var.project_id 31 | server_id = var.server_id 32 | } 33 | -------------------------------------------------------------------------------- /stackit/internal/services/serverbackup/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/serverbackup" 8 | 9 | "github.com/hashicorp/terraform-plugin-framework/diag" 10 | "github.com/stackitcloud/stackit-sdk-go/core/config" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 12 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 13 | ) 14 | 15 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *serverbackup.APIClient { 16 | apiClientConfigOptions := []config.ConfigurationOption{ 17 | config.WithCustomAuth(providerData.RoundTripper), 18 | utils.UserAgentConfigOption(providerData.Version), 19 | } 20 | if providerData.ServerBackupCustomEndpoint != "" { 21 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ServerBackupCustomEndpoint)) 22 | } 23 | apiClient, err := serverbackup.NewAPIClient(apiClientConfigOptions...) 24 | if err != nil { 25 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 26 | return nil 27 | } 28 | 29 | return apiClient 30 | } 31 | -------------------------------------------------------------------------------- /stackit/internal/services/serverupdate/testdata/resource-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "server_name" {} 3 | variable "schedule_name" {} 4 | variable "rrule" {} 5 | variable "enabled" {} 6 | variable "maintenance_window" {} 7 | variable "server_id" {} 8 | variable "region" {} 9 | 10 | resource "stackit_server_update_schedule" "test_schedule" { 11 | project_id = var.project_id 12 | server_id = var.server_id 13 | name = var.schedule_name 14 | rrule = var.rrule 15 | enabled = var.enabled 16 | maintenance_window = var.maintenance_window 17 | region = var.region 18 | } 19 | 20 | data "stackit_server_update_schedule" "test_schedule" { 21 | project_id = var.project_id 22 | server_id = var.server_id 23 | update_schedule_id = stackit_server_update_schedule.test_schedule.update_schedule_id 24 | } 25 | 26 | data "stackit_server_update_schedules" "schedules_data_test" { 27 | project_id = var.project_id 28 | server_id = var.server_id 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/serverupdate/testdata/resource-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "server_name" {} 3 | variable "schedule_name" {} 4 | variable "rrule" {} 5 | variable "enabled" {} 6 | variable "maintenance_window" {} 7 | variable "server_id" {} 8 | 9 | resource "stackit_server_update_schedule" "test_schedule" { 10 | project_id = var.project_id 11 | server_id = var.server_id 12 | name = var.schedule_name 13 | rrule = var.rrule 14 | enabled = var.enabled 15 | maintenance_window = var.maintenance_window 16 | } 17 | 18 | data "stackit_server_update_schedule" "test_schedule" { 19 | project_id = var.project_id 20 | server_id = var.server_id 21 | update_schedule_id = stackit_server_update_schedule.test_schedule.update_schedule_id 22 | } 23 | 24 | data "stackit_server_update_schedules" "schedules_data_test" { 25 | project_id = var.project_id 26 | server_id = var.server_id 27 | } 28 | -------------------------------------------------------------------------------- /stackit/internal/services/serverupdate/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/serverupdate" 8 | 9 | "github.com/hashicorp/terraform-plugin-framework/diag" 10 | "github.com/stackitcloud/stackit-sdk-go/core/config" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 12 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 13 | ) 14 | 15 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *serverupdate.APIClient { 16 | apiClientConfigOptions := []config.ConfigurationOption{ 17 | config.WithCustomAuth(providerData.RoundTripper), 18 | utils.UserAgentConfigOption(providerData.Version), 19 | } 20 | if providerData.ServerUpdateCustomEndpoint != "" { 21 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ServerUpdateCustomEndpoint)) 22 | } 23 | apiClient, err := serverupdate.NewAPIClient(apiClientConfigOptions...) 24 | if err != nil { 25 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 26 | return nil 27 | } 28 | 29 | return apiClient 30 | } 31 | -------------------------------------------------------------------------------- /stackit/internal/services/serviceaccount/key/const.go: -------------------------------------------------------------------------------- 1 | package key 2 | 3 | const markdownDescription = ` 4 | ## Example Usage` + "\n" + ` 5 | 6 | ### Automatically rotate service account keys` + "\n" + 7 | "```terraform" + ` 8 | resource "stackit_service_account" "sa" { 9 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 10 | name = "sa01" 11 | } 12 | 13 | resource "time_rotating" "rotate" { 14 | rotation_days = 80 15 | } 16 | 17 | resource "stackit_service_account_key" "sa_key" { 18 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | service_account_email = stackit_service_account.sa.email 20 | ttl_days = 90 21 | 22 | rotate_when_changed = { 23 | rotation = time_rotating.rotate.id 24 | } 25 | } 26 | ` + "\n```" 27 | -------------------------------------------------------------------------------- /stackit/internal/services/serviceaccount/token/const.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | const markdownDescription = ` 4 | ## Example Usage` + "\n" + ` 5 | 6 | ### Automatically rotate access tokens` + "\n" + 7 | "```terraform" + ` 8 | resource "stackit_service_account" "sa" { 9 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 10 | name = "sa01" 11 | } 12 | 13 | resource "time_rotating" "rotate" { 14 | rotation_days = 80 15 | } 16 | 17 | resource "stackit_service_account_access_token" "sa_token" { 18 | project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 19 | service_account_email = stackit_service_account.sa.email 20 | ttl_days = 180 21 | 22 | rotate_when_changed = { 23 | rotation = time_rotating.rotate.id 24 | } 25 | } 26 | ` + "\n```" 27 | -------------------------------------------------------------------------------- /stackit/internal/services/serviceaccount/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/serviceaccount" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *serviceaccount.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.ServiceAccountCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ServiceAccountCustomEndpoint)) 21 | } 22 | apiClient, err := serviceaccount.NewAPIClient(apiClientConfigOptions...) 23 | if err != nil { 24 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 25 | return nil 26 | } 27 | 28 | return apiClient 29 | } 30 | -------------------------------------------------------------------------------- /stackit/internal/services/serviceenablement/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/serviceenablement" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *serviceenablement.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.ServiceEnablementCustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.ServiceEnablementCustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := serviceenablement.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/ske/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/hashicorp/terraform-plugin-framework/diag" 8 | "github.com/stackitcloud/stackit-sdk-go/core/config" 9 | "github.com/stackitcloud/stackit-sdk-go/services/ske" 10 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 12 | ) 13 | 14 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *ske.APIClient { 15 | apiClientConfigOptions := []config.ConfigurationOption{ 16 | config.WithCustomAuth(providerData.RoundTripper), 17 | utils.UserAgentConfigOption(providerData.Version), 18 | } 19 | if providerData.SKECustomEndpoint != "" { 20 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.SKECustomEndpoint)) 21 | } else { 22 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 23 | } 24 | apiClient, err := ske.NewAPIClient(apiClientConfigOptions...) 25 | if err != nil { 26 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 27 | return nil 28 | } 29 | 30 | return apiClient 31 | } 32 | -------------------------------------------------------------------------------- /stackit/internal/services/sqlserverflex/testdata/resource-max.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "acl1" {} 4 | variable "flavor_cpu" {} 5 | variable "flavor_ram" {} 6 | variable "storage_class" {} 7 | variable "storage_size" {} 8 | variable "options_retention_days" {} 9 | variable "backup_schedule" {} 10 | variable "username" {} 11 | variable "role" {} 12 | variable "server_version" {} 13 | variable "region" {} 14 | 15 | resource "stackit_sqlserverflex_instance" "instance" { 16 | project_id = var.project_id 17 | name = var.name 18 | acl = [var.acl1] 19 | flavor = { 20 | cpu = var.flavor_cpu 21 | ram = var.flavor_ram 22 | } 23 | storage = { 24 | class = var.storage_class 25 | size = var.storage_size 26 | } 27 | version = var.server_version 28 | options = { 29 | retention_days = var.options_retention_days 30 | } 31 | backup_schedule = var.backup_schedule 32 | region = var.region 33 | } 34 | 35 | resource "stackit_sqlserverflex_user" "user" { 36 | project_id = stackit_sqlserverflex_instance.instance.project_id 37 | instance_id = stackit_sqlserverflex_instance.instance.instance_id 38 | username = var.username 39 | roles = [var.role] 40 | } 41 | 42 | data "stackit_sqlserverflex_instance" "instance" { 43 | project_id = var.project_id 44 | instance_id = stackit_sqlserverflex_instance.instance.instance_id 45 | } 46 | 47 | data "stackit_sqlserverflex_user" "user" { 48 | project_id = var.project_id 49 | instance_id = stackit_sqlserverflex_instance.instance.instance_id 50 | user_id = stackit_sqlserverflex_user.user.user_id 51 | } 52 | -------------------------------------------------------------------------------- /stackit/internal/services/sqlserverflex/testdata/resource-min.tf: -------------------------------------------------------------------------------- 1 | variable "project_id" {} 2 | variable "name" {} 3 | variable "flavor_cpu" {} 4 | variable "flavor_ram" {} 5 | variable "username" {} 6 | variable "role" {} 7 | 8 | resource "stackit_sqlserverflex_instance" "instance" { 9 | project_id = var.project_id 10 | name = var.name 11 | flavor = { 12 | cpu = var.flavor_cpu 13 | ram = var.flavor_ram 14 | } 15 | } 16 | 17 | resource "stackit_sqlserverflex_user" "user" { 18 | project_id = stackit_sqlserverflex_instance.instance.project_id 19 | instance_id = stackit_sqlserverflex_instance.instance.instance_id 20 | username = var.username 21 | roles = [var.role] 22 | } 23 | 24 | data "stackit_sqlserverflex_instance" "instance" { 25 | project_id = var.project_id 26 | instance_id = stackit_sqlserverflex_instance.instance.instance_id 27 | } 28 | 29 | data "stackit_sqlserverflex_user" "user" { 30 | project_id = var.project_id 31 | instance_id = stackit_sqlserverflex_instance.instance.instance_id 32 | user_id = stackit_sqlserverflex_user.user.user_id 33 | } 34 | -------------------------------------------------------------------------------- /stackit/internal/services/sqlserverflex/utils/util.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex" 8 | 9 | "github.com/hashicorp/terraform-plugin-framework/diag" 10 | "github.com/stackitcloud/stackit-sdk-go/core/config" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 12 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" 13 | ) 14 | 15 | func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags *diag.Diagnostics) *sqlserverflex.APIClient { 16 | apiClientConfigOptions := []config.ConfigurationOption{ 17 | config.WithCustomAuth(providerData.RoundTripper), 18 | utils.UserAgentConfigOption(providerData.Version), 19 | } 20 | if providerData.SQLServerFlexCustomEndpoint != "" { 21 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.SQLServerFlexCustomEndpoint)) 22 | } else { 23 | apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion())) 24 | } 25 | apiClient, err := sqlserverflex.NewAPIClient(apiClientConfigOptions...) 26 | if err != nil { 27 | core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err)) 28 | return nil 29 | } 30 | 31 | return apiClient 32 | } 33 | -------------------------------------------------------------------------------- /stackit/internal/testutil/sdk_credentials_invalid.json: -------------------------------------------------------------------------------- 1 | "not json" -------------------------------------------------------------------------------- /stackit/internal/testutil/sdk_credentials_valid.json: -------------------------------------------------------------------------------- 1 | { 2 | "STACKIT_SERVICE_ACCOUNT_TOKEN": "foo_token" 3 | } -------------------------------------------------------------------------------- /stackit/internal/testutil/testutil_test.go: -------------------------------------------------------------------------------- 1 | package testutil 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform-plugin-testing/config" 7 | ) 8 | 9 | func TestConvertConfigVariable(t *testing.T) { 10 | tests := []struct { 11 | name string 12 | variable config.Variable 13 | want string 14 | }{ 15 | { 16 | name: "string", 17 | variable: config.StringVariable("test"), 18 | want: "test", 19 | }, 20 | { 21 | name: "bool: true", 22 | variable: config.BoolVariable(true), 23 | want: "true", 24 | }, 25 | { 26 | name: "bool: false", 27 | variable: config.BoolVariable(false), 28 | want: "false", 29 | }, 30 | { 31 | name: "integer", 32 | variable: config.IntegerVariable(10), 33 | want: "10", 34 | }, 35 | } 36 | for _, tt := range tests { 37 | t.Run(tt.name, func(t *testing.T) { 38 | if got := ConvertConfigVariable(tt.variable); got != tt.want { 39 | t.Errorf("ConvertConfigVariable() = %v, want %v", got, tt.want) 40 | } 41 | }) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /stackit/internal/utils/attributes.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "time" 7 | 8 | "github.com/hashicorp/terraform-plugin-framework/diag" 9 | "github.com/hashicorp/terraform-plugin-framework/path" 10 | "github.com/hashicorp/terraform-plugin-framework/types" 11 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 12 | ) 13 | 14 | type attributeGetter interface { 15 | GetAttribute(ctx context.Context, attributePath path.Path, target interface{}) diag.Diagnostics 16 | } 17 | 18 | func ToTime(ctx context.Context, format string, val types.String, target *time.Time) (diags diag.Diagnostics) { 19 | var err error 20 | text := val.ValueString() 21 | *target, err = time.Parse(format, text) 22 | if err != nil { 23 | core.LogAndAddError(ctx, &diags, "cannot parse date", fmt.Sprintf("cannot parse date %q with format %q: %v", text, format, err)) 24 | return diags 25 | } 26 | return diags 27 | } 28 | 29 | // GetTimeFromStringAttribute retrieves a string attribute from e.g. a [plan.Plan], [tfsdk.Config] or a [tfsdk.State] and 30 | // converts it to a [time.Time] object with a given format, if possible. 31 | func GetTimeFromStringAttribute(ctx context.Context, attributePath path.Path, source attributeGetter, dateFormat string, target *time.Time) (diags diag.Diagnostics) { 32 | var date types.String 33 | diags.Append(source.GetAttribute(ctx, attributePath, &date)...) 34 | if diags.HasError() { 35 | return diags 36 | } 37 | if date.IsNull() || date.IsUnknown() { 38 | return diags 39 | } 40 | diags.Append(ToTime(ctx, dateFormat, date, target)...) 41 | if diags.HasError() { 42 | return diags 43 | } 44 | 45 | return diags 46 | } 47 | -------------------------------------------------------------------------------- /stackit/internal/utils/headers.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/stackitcloud/stackit-sdk-go/core/config" 7 | ) 8 | 9 | func UserAgentConfigOption(providerVersion string) config.ConfigurationOption { 10 | return config.WithUserAgent(fmt.Sprintf("stackit-terraform-provider/%s", providerVersion)) 11 | } 12 | -------------------------------------------------------------------------------- /stackit/internal/utils/headers_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | 7 | "github.com/stackitcloud/stackit-sdk-go/core/config" 8 | ) 9 | 10 | func TestUserAgentConfigOption(t *testing.T) { 11 | type args struct { 12 | providerVersion string 13 | } 14 | tests := []struct { 15 | name string 16 | args args 17 | want config.ConfigurationOption 18 | }{ 19 | { 20 | name: "TestUserAgentConfigOption", 21 | args: args{ 22 | providerVersion: "1.0.0", 23 | }, 24 | want: config.WithUserAgent("stackit-terraform-provider/1.0.0"), 25 | }, 26 | } 27 | for _, tt := range tests { 28 | t.Run(tt.name, func(t *testing.T) { 29 | clientConfigActual := config.Configuration{} 30 | err := tt.want(&clientConfigActual) 31 | if err != nil { 32 | t.Errorf("error applying configuration: %v", err) 33 | } 34 | 35 | clientConfigExpected := config.Configuration{} 36 | err = UserAgentConfigOption(tt.args.providerVersion)(&clientConfigExpected) 37 | if err != nil { 38 | t.Errorf("error applying configuration: %v", err) 39 | } 40 | 41 | if !reflect.DeepEqual(clientConfigActual, clientConfigExpected) { 42 | t.Errorf("UserAgentConfigOption() = %v, want %v", clientConfigActual, clientConfigExpected) 43 | } 44 | }) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /stackit/internal/utils/regions.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/hashicorp/terraform-plugin-framework/path" 7 | "github.com/hashicorp/terraform-plugin-framework/resource" 8 | "github.com/hashicorp/terraform-plugin-framework/types" 9 | "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" 10 | ) 11 | 12 | // AdaptRegion rewrites the region of a terraform plan 13 | func AdaptRegion(ctx context.Context, configRegion types.String, planRegion *types.String, defaultRegion string, resp *resource.ModifyPlanResponse) { 14 | // Get the intended region. This is either set directly set in the individual 15 | // config or the provider region has to be used 16 | var intendedRegion types.String 17 | if configRegion.IsNull() { 18 | if defaultRegion == "" { 19 | core.LogAndAddError(ctx, &resp.Diagnostics, "set region", "no region defined in config or provider") 20 | return 21 | } 22 | intendedRegion = types.StringValue(defaultRegion) 23 | } else { 24 | intendedRegion = configRegion 25 | } 26 | 27 | // check if the currently configured region corresponds to the planned region 28 | // on mismatch override the planned region with the intended region 29 | // and force a replacement of the resource 30 | p := path.Root("region") 31 | if !intendedRegion.Equal(*planRegion) { 32 | resp.RequiresReplace.Append(p) 33 | *planRegion = intendedRegion 34 | } 35 | resp.Diagnostics.Append(resp.Plan.SetAttribute(ctx, p, *planRegion)...) 36 | if resp.Diagnostics.HasError() { 37 | return 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /stackit/internal/validate/testdata/file.txt: -------------------------------------------------------------------------------- 1 | I am a test file -------------------------------------------------------------------------------- /templates/guides/stackit_org_service_account.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Creating projects in empty organization via Terraform" 3 | --- 4 | # Creating projects in empty organization via Terraform 5 | 6 | Consider the following situation: You're starting with an empty STACKIT organization and want to create projects 7 | in this organization using the `stackit_resourcemanager_project` resource. Unfortunately it's not possible to create 8 | a service account on organization level which can be used for authentication in the STACKIT Terraform provider. 9 | The following steps will help you to get started: 10 | 11 | 1. Using the STACKIT portal, create a dummy project in your organization which will hold your service account, let's name it e.g. "dummy-service-account-project". 12 | 2. In this "dummy-service-account-project", create a service account. Create and save a service account key to use for authentication for the STACKIT Terraform provider later as described in the docs. Now copy the e-mail address of the service account you just created. 13 | 3. Here comes the important part: Navigate to your organization, open it and select "Access". Click on the "Grant access" button and paste the e-mail address of your service account. Be careful to grant the service account enough permissions to create projects in your organization, e.g. by assigning the "owner" role to it. 14 | 15 | *This problem was brought up initially in [this](https://github.com/stackitcloud/terraform-provider-stackit/issues/855) issue on GitHub.* 16 | -------------------------------------------------------------------------------- /terraform-registry-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "metadata": { 4 | "protocol_versions": [ 5 | "6.0" 6 | ] 7 | } 8 | } --------------------------------------------------------------------------------