How to add a new version to the existing Service Catalog product through CloudFormation template

0

We are able to successfully create a Service Catalog CloudFormation product using the below CFN resource:

  MLOPSProduct:
    Type: AWS::ServiceCatalog::CloudFormationProduct
    Properties: 
      AcceptLanguage: en
      Description: "Service Catalog Product description"
      Name: "Annotation Project"
      Owner: "ProductOwner"
      ReplaceProvisioningArtifacts: True
      ProvisioningArtifactParameters: 
        - Description: "SageMaker Project"
          Info:
            LoadTemplateFromURL: !Join [ '', [ 'https://',  '{{resolve:ssm:/mlops/infra/artifact-bucket}}', !Sub '.s3.${AWS::Region}.amazonaws.com/version1/smproject.yaml' ] ]
          Name: "Version1"
      Tags: 
        - Key: sagemaker:studio-visibility
          Value: true
        - Key: Owner
          Value: 'infra'

However, I am not able to create the new version of the product. When I change value of Name under ProvisioningArtifactParameters, CFN stack updates successfully but it doesn't create a new version of the Service Catalog product. Its just replacing the existing product with new version value.

I don't see the details of the same in the document as well. Please let me know if there is an option to create this. Thanks.

gefragt vor 7 Monaten368 Aufrufe
1 Antwort
-1

Hello.

you need to make sure that the combination of Product Name and Artifact is unique. Otherwise Cloudformation will update the thing in place.

Please check on this code where I put in the different approach:

MLOPSProduct:
  Type: AWS::ServiceCatalog::CloudFormationProduct
  Properties: 
    AcceptLanguage: en
    Description: "Service Catalog Product description"
    Name: "Annotation Project"  # Keep the same product name
    Owner: "ProductOwner"
    ReplaceProvisioningArtifacts: False  # Set to False to create a new version
    ProvisioningArtifactParameters: 
      - Description: "SageMaker Project"
        Info:
          LoadTemplateFromURL: !Join [ '', [ 'https://', '{{resolve:ssm:/mlops/infra/artifact-bucket}}', !Sub '.s3.${AWS::Region}.amazonaws.com/version1/smproject.yaml' ] ]
        Name: "Version2"  # Change the provisioning artifact name to create a new version
    Tags: 
      - Key: sagemaker:studio-visibility
        Value: true
      - Key: Owner
        Value: 'infra'

profile picture
EXPERTE
beantwortet vor 7 Monaten
profile picture
EXPERTE
überprüft vor 7 Monaten
  • Thanks. As I have mentioned in the question, this is what I have been trying (changing the value of Name field to version2) and it still doesn't create a new version. Its replacing the existing version itself. It shows only 1 version under Product Version section in Service Catalog. I tried with both the options for ReplaceProvisioningArtifacts (True as well as False).

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen