Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPD-7518: Add tags option to create command. #287

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

marciotoshio
Copy link
Contributor

Using custom CF template

{
  "Resources": {
    "HelloBucket": {
      "Type": "AWS::S3::Bucket"
    }
  }
}

Create options

➜ cloud-database-api ruby-2.7.3 (CPD-7518-fix) ✗ bundle exec moonshot help create                                              <aws:cloudservicesdev>
Using the Central Model for authentication
Version 2 of the Ruby SDK will enter maintenance mode as of November 20, 2020. To continue receiving service updates and new features, please upgrade to Version 3. More information can be found here: https://aws.amazon.com/blogs/developer/deprecation-schedule-for-aws-sdk-for-ruby-v2/
Using the Central Model for authentication
Usage: moonshot create [options]
    -v, --[no-]verbose               Show debug logging
    -n, --environment=NAME           Which environment to operate on.
        --[no-]interactive-logger    Enable or disable fancy logging
    -t, --token-provider=PROVIDER
        --[no-]interactive           Use interactive prompts for gathering missing configuration.
    -a, --answer-fileFILE            Load Stack Parameters from a YAML file
    -P, --parameterKEY=VALUE         Specify Stack Parameter on the command line
        --[no-]show-all-events       Show all stack events during update
    -p, --parent=PARENT_STACK        Parent stack to import parameters from
        --parents a,b,c              List of parent stacks to import parameters from
    -d, --[no-]deploy                Choose if code should be deployed immediately after the stack is created
        --version VERSION_NAME       Version for initial deployment. If unset, a new development build is created from the local directory
        --template-file=FILE         Override the path to the CloudFormation template.
    -T, --tagsKEY=VALUE              Specify stack tags on the command line

Passing tags to create command

➜ cloud-database-api ruby-2.7.3 (CPD-7518-fix) ✗ bundle exec moonshot create -ncdb-api-dev-toshio-test --template-file ./cloud_formation/test.json -Tstory=CPD-7518 -Tstory-type=bug
Using the Central Model for authentication
Version 2 of the Ruby SDK will enter maintenance mode as of November 20, 2020. To continue receiving service updates and new features, please upgrade to Version 3. More information can be found here: https://aws.amazon.com/blogs/developer/deprecation-schedule-for-aws-sdk-for-ruby-v2/
Using the Central Model for authentication
[ ✓ ] [ 0m 2s ] Created CloudFormation Stack cdb-api-cdb-api-dev-toshio-test.                                                                         
[ ✓ ] [ 0m 36s ] CloudFormation Stack cdb-api-cdb-api-dev-toshio-test successfully created.  

Stack tags

➜ cloud-database-api ruby-2.7.3 (CPD-7518-fix) ✗ aws cloudformation describe-stacks --stack-name cdb-api-cdb-api-dev-toshio-test --query Stacks[].Tags 
[
    [
        {
            "Key": "moonshot_application",
            "Value": "cdb-api"
        },
        {
            "Key": "story-type",
            "Value": "bug"
        },
        {
            "Key": "moonshot_environment",
            "Value": "cdb-api-dev-toshio-test"
        },
        {
            "Key": "story",
            "Value": "CPD-7518"
        }
    ]
]

Bucket tags

➜ cloud-database-api ruby-2.7.3 (CPD-7518-fix) ✗ aws s3api get-bucket-tagging --bucket cdb-api-cdb-api-dev-toshio-test-hellobucket-17hano27ri6xv
Enter MFA code for arn:aws:iam::484203365684:mfa/marcio.toshio: 
{
    "TagSet": [
        {
            "Key": "aws:cloudformation:stack-name",
            "Value": "cdb-api-cdb-api-dev-toshio-test"
        },
        {
            "Key": "aws:cloudformation:stack-id",
            "Value": "arn:aws:cloudformation:us-east-1:672327909798:stack/cdb-api-cdb-api-dev-toshio-test/52e0e700-53cf-11ed-9b68-0aa2623b7b2f"
        },
        {
            "Key": "moonshot_application",
            "Value": "cdb-api"
        },
        {
            "Key": "story-type",
            "Value": "bug"
        },
        {
            "Key": "moonshot_environment",
            "Value": "cdb-api-dev-toshio-test"
        },
        {
            "Key": "aws:cloudformation:logical-id",
            "Value": "HelloBucket"
        },
        {
            "Key": "story",
            "Value": "CPD-7518"
        }
    ]
}

@marciotoshio marciotoshio force-pushed the CPD-7518 branch 2 times, most recently from 55f4fab to 5b254b5 Compare October 25, 2022 19:11
@marciotoshio
Copy link
Contributor Author

I changed options --tags to --tag

@marciotoshio marciotoshio merged commit f407eea into acquia:proxy-cli-hook-aws-v2 Oct 25, 2022
tomelliot16 pushed a commit to tomelliot16/moonshot that referenced this pull request Nov 8, 2023
tomelliot16 pushed a commit to tomelliot16/moonshot that referenced this pull request Nov 8, 2023
marcingy pushed a commit that referenced this pull request Nov 8, 2023
* CPD-7518: Add tags option to create command. (#287)

* CPD-7518: Add tags option to update command. (#288)

* CPD-7696: adding tags for kms keys. (#293)

* Update stack.rb

* Update controller_config.rb

---------

Co-authored-by: Marcio Toshio Ide <[email protected]>
Co-authored-by: Justin Moore <[email protected]>
marcingy pushed a commit that referenced this pull request Nov 8, 2023
* CPD-7518: Add tags option to create command. (#287)

* CPD-7518: Add tags option to update command. (#288)

* CPD-7696: adding tags for kms keys. (#293)

* found a gap

---------

Co-authored-by: Marcio Toshio Ide <[email protected]>
Co-authored-by: Justin Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants