webup

command module
v0.0.0-...-799102c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

webup

Build Status Go Report Card

S3 is a very cost effective way to host static web content, but it requires multiple configuration changes to properly prepare a s3 bucket for web hosting. This is a simple cli tool to make it easier to prepare s3 bucket for static website hosting.

What it does

  1. Creates a s3 bucket for a given dns name(This should be the name you want to expose your content).
  2. Enables s3 bucket webhosting and sets up default files as index.html and default error file as error.html.
  3. Create DNS entries in route53 for the given dns name.

How to create a s3 buckt ready for webhosting.

webup create -n www.testwebsite.devops.lk -z Z1TI4H711TUXXX
Starting to set up bucket
2022/04/05 21:52:13 Bucket www.testwebsite.devops.lk created 
2022/04/05 21:52:14 DNS www.testwebsite.devops.lk created 
Done setting up bucket
How to upload content
webup upload -w  www.testwebsiteamilaku870306.devops.lk
How to upload folder with all content
webup upload -r true -w  www.testwebsiteamilaku870306.devops.lk

output

2022/04/08 00:12:20  create s3 client new s3 upload
2022/04/08 00:12:20 Opened file: webcontent/index.html
2022/04/08 00:12:20 Trying to upload file: index.html to s3
2022/04/08 00:12:21 Upload file: index.html to s3, object version: 0xc000550020

Functionality

  • create s3 bucket
  • configure for web hosting
  • create r53 entries
  • initialize directory upload content
  • upload files to s3

Todo

  • Upload content

This currently only updates index.html file in webcontent folder and sets public access ACL in S3 bucket, it needs to be able to upload any file available in webcontent folder.

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL