From 84c6251c41238cd736a693437560e2304b5354bf Mon Sep 17 00:00:00 2001
From: "Thomas F. Duellmann" <duelle@users.noreply.github.com>
Date: Tue, 13 Apr 2021 12:46:13 +0000
Subject: [PATCH] AWS S3 Bucket URLs (#91)

---
 nodetypes/radon.nodes.aws/AwsS3Bucket/NodeType.tosca        | 6 ++++++
 nodetypes/radon.nodes.aws/AwsS3Bucket/README.md             | 2 ++
 .../radon.nodes.aws/AwsS3Bucket/files/create/create.yml     | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/nodetypes/radon.nodes.aws/AwsS3Bucket/NodeType.tosca b/nodetypes/radon.nodes.aws/AwsS3Bucket/NodeType.tosca
index 584355cf..dc78baf5 100644
--- a/nodetypes/radon.nodes.aws/AwsS3Bucket/NodeType.tosca
+++ b/nodetypes/radon.nodes.aws/AwsS3Bucket/NodeType.tosca
@@ -12,6 +12,12 @@ node_types:
         type: string
       region:
         type: string
+      bucket_url_path:
+        type: string
+        description: URL of the bucket using path-style access (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html)
+      bucket_url_vhost:
+        type: string
+        description: URL of the bucket using virtual-hosted-style access (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html)
     requirements:
       - host:
           capability: tosca.capabilities.Container
diff --git a/nodetypes/radon.nodes.aws/AwsS3Bucket/README.md b/nodetypes/radon.nodes.aws/AwsS3Bucket/README.md
index 3473a9c4..2b7d13f7 100644
--- a/nodetypes/radon.nodes.aws/AwsS3Bucket/README.md
+++ b/nodetypes/radon.nodes.aws/AwsS3Bucket/README.md
@@ -14,6 +14,8 @@ A node type that represents an AWS S3 Bucket.
 | Name | Type | Default Value | Description |
 |:---- |:---- |:------------- |:----------- |
 | `arn` | `string` |   | Amazon's resource name for this bucket |
+| `bucket_url_path` | `string` |  | URL of the bucket using path-style access (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html) |
+| `bucket_url_vhost` | `string` |  | URL of the bucket using virtual-hosted-style access (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html) |
 
 ### Requirements
 
diff --git a/nodetypes/radon.nodes.aws/AwsS3Bucket/files/create/create.yml b/nodetypes/radon.nodes.aws/AwsS3Bucket/files/create/create.yml
index cd3456b7..fd01e410 100644
--- a/nodetypes/radon.nodes.aws/AwsS3Bucket/files/create/create.yml
+++ b/nodetypes/radon.nodes.aws/AwsS3Bucket/files/create/create.yml
@@ -12,3 +12,5 @@
         data:
           bucket_name: "{{ bucket_name }}"
           region: "{{ aws_region }}"
+          bucket_url_vhost: "https://s3.{{ aws_region }}.amazonaws.com/{{ bucket_name }}"
+          bucket_url_path: "https://{{ bucket_name }}.s3.{{ aws_region }}.amazonaws.com"
-- 
GitLab