aws-cloudformation / aws-cloudformation-resource-providers-codeartifact

The CloudFormation Resource Provider Package for the AWS CodeArtifact service
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_CodeArtifact.html
Apache License 2.0
27 stars 7 forks source link

Fixing GettAtt and Ref functions. #29

Closed jonjara closed 3 years ago

jonjara commented 3 years ago

Issue #, if available:

Description of changes: Apparently, Ref and GetAtt send model with only arn because its the primary identifier. Updating so the handlers can handler this scenario.

Also removing some properties from schema's based on feedback from discussions. I am removing Arn from readOnly because this conflicts with contract tests that prevent Create being called with readOnly properties, which does happen GetAtt is called in a create template. It's a bit intuitive..

The ArnUtils class should be shared between packages, I tried doing this but couldnt get maven to do what I wanted, so I am tabling this for later in the interest of time

Testing cfn submit and deployed these stacks


Parameters:
  Name:
    Type: String
Resources:
  TestCodeArtifactDomain:
    Type: 'AWS::CodeArtifact::Domain'
    Properties:
      DomainName: !Ref Name
Outputs:
  DomainOwner:
    Value: !GetAtt TestCodeArtifactDomain.DomainOwner
  Arn:
    Value: !Ref TestCodeArtifactDomain    
Parameters:
  Name:
    Type: String
  DomainName:
    Type: String    
Resources:
  TestCodeArtifacRepository:
    Type: 'AWS::CodeArtifact::Repository'
    Properties:
      RepositoryName: !Ref Name
      DomainName: !Ref DomainName

Outputs:
  Arn:
    Value: !Ref TestCodeArtifacRepository

  Admin:
    Value: !GetAtt TestCodeArtifacRepository.AdministratorAccount    

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.