我已经使用Terraform创建了一个Amazon MQ代理(引擎类型为RabbitMQ)。现在我想导入一个XML定义文件。这可以很容易地手动完成,我只需要导出定义文件并手动将其导入到AWS MQ。但我需要使用Terraform自动化此过程。任何建议都将受到欢迎。这是我的terraform代码:
resource "aws_mq_broker" "rabbitmq_broker" {
broker_name = "mq_test"
engine_type = var.mq_engine_type
engine_version = var.mq_engine_version
host_instance_type = var.mq_instance_type
deployment_mode = var.mq_deployment_mode
security_groups = [aws_security_group.ecs_private.id]
apply_immediately = "true"
publicly_accessible = "false"
subnet_ids = [aws_subnet.private.id]
user {
console_access = "true"
username = var.mq_username
password = "password"
}
tags = {
env = "${terraform.workspace}",
}
}
1条答案
按热度按时间bhmjp9jg1#
首先,需要创建一个MQ Configuration,它是XML文件传递到的对象,然后将配置传递给代理。