-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2-product-definition-in-portfolio.tf
49 lines (40 loc) · 1.24 KB
/
2-product-definition-in-portfolio.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
data "aws_region" "current" { }
resource "aws_s3_bucket" "bucket" {
bucket = "bucket-tfprov-demo-123"
region = data.aws_region.current.name
acl = "private"
force_destroy = true
}
resource "aws_s3_bucket_object" "tfprov-demo-template" {
bucket = aws_s3_bucket.bucket.id
key = "demo-tf-prov.json"
content = <<EOF
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Very dull sample product for demo",
"Resources": {
"Empty": {
"Type": "AWS::CloudFormation::WaitConditionHandle"
}
}
}
EOF
}
resource "aws_servicecatalog_product" "demo" {
name = "product-tfprov-demo-123"
product_type = "CLOUD_FORMATION_TEMPLATE"
owner = "Cloudsoft"
support_email = "[email protected]"
support_url = "http://cloudsoft.io"
provisioning_artifact {
description = "v1"
name = "pa-tfprov-demo-123"
info = {
LoadTemplateFromURL = "https://s3.amazonaws.com/${aws_s3_bucket.bucket.id}/${aws_s3_bucket_object.tfprov-demo-template.key}"
}
}
}
resource "aws_servicecatalog_portfolio_product_association" "association" {
portfolio_id = aws_servicecatalog_portfolio.demo.id
product_id = aws_servicecatalog_product.demo.id
}